From 07436668f4a98db8bf91c8d1c2a970448404d689 Mon Sep 17 00:00:00 2001 From: Serge Bazanski Date: Sat, 3 Apr 2021 16:13:10 +0000 Subject: [PATCH] third_party/cargo: update --- third_party/cargo/BUILD.bazel | 10 +- third_party/cargo/Cargo.lock | 240 +- third_party/cargo/Cargo.toml | 29 +- third_party/cargo/patches/BUILD.bazel | 2 +- .../vendor/adler-0.2.3/.cargo-checksum.json | 1 - .../vendor/adler-1.0.2/.cargo-checksum.json | 1 + .../{adler-0.2.3 => adler-1.0.2}/BUILD.bazel | 2 +- .../{adler-0.2.3 => adler-1.0.2}/CHANGELOG.md | 30 + .../{adler-0.2.3 => adler-1.0.2}/Cargo.toml | 11 +- .../{adler-0.2.3 => adler-1.0.2}/LICENSE-0BSD | 0 .../LICENSE-APACHE | 0 .../{adler-0.2.3 => adler-1.0.2}/LICENSE-MIT | 0 .../{adler-0.2.3 => adler-1.0.2}/README.md | 5 +- .../RELEASE_PROCESS.md | 0 .../benches/bench.rs | 0 .../{adler-0.2.3 => adler-1.0.2}/src/algo.rs | 0 .../{adler-0.2.3 => adler-1.0.2}/src/lib.rs | 88 +- .../cargo/vendor/andrew-0.3.1/BUILD.bazel | 4 +- .../cargo/vendor/atty-0.2.14/BUILD.bazel | 2 +- .../bytemuck-1.4.1/.cargo-checksum.json | 1 - .../bytemuck-1.5.1/.cargo-checksum.json | 1 + .../BUILD.bazel | 2 +- .../Cargo.toml | 2 +- .../LICENSE-APACHE | 122 +- .../LICENSE-MIT | 18 +- .../LICENSE-ZLIB | 22 +- .../README.md | 54 +- .../changelog.md | 146 +- .../rustfmt.toml | 32 +- .../src/allocation.rs | 378 +-- .../src/contiguous.rs | 406 +-- .../src/lib.rs | 892 ++++--- .../src/offset_of.rs | 264 +- .../src/pod.rs | 198 +- .../src/transparent.rs | 270 +- .../src/zeroable.rs | 284 +- .../tests/cast_slice_tests.rs | 330 +-- .../tests/derive.rs | 48 +- .../tests/doc_tests.rs | 242 +- .../tests/offset_of_tests.rs | 118 +- .../tests/std_tests.rs | 74 +- .../byteorder-1.3.4/.cargo-checksum.json | 1 - .../cargo/vendor/byteorder-1.3.4/build.rs | 90 - .../byteorder-1.4.3/.cargo-checksum.json | 1 + .../BUILD.bazel | 6 +- .../CHANGELOG.md | 25 + .../COPYING | 0 .../Cargo.toml | 15 +- .../LICENSE-MIT | 0 .../README.md | 10 +- .../UNLICENSE | 0 .../benches/bench.rs | 236 +- .../rustfmt.toml | 0 .../src/io.rs | 95 +- .../src/lib.rs | 1793 +++++++++---- .../cargo/vendor/calloop-0.6.5/BUILD.bazel | 2 +- .../.cargo-checksum.json | 2 +- .../{cc-1.0.66 => cc-1.0.67}/BUILD.bazel | 4 +- .../{cc-1.0.66 => cc-1.0.67}/Cargo.lock | 2 +- .../{cc-1.0.66 => cc-1.0.67}/Cargo.toml | 2 +- .../{cc-1.0.66 => cc-1.0.67}/LICENSE-APACHE | 0 .../{cc-1.0.66 => cc-1.0.67}/LICENSE-MIT | 0 .../vendor/{cc-1.0.66 => cc-1.0.67}/README.md | 14 +- .../src/bin/gcc-shim.rs | 0 .../{cc-1.0.66 => cc-1.0.67}/src/com.rs | 0 .../{cc-1.0.66 => cc-1.0.67}/src/lib.rs | 38 +- .../{cc-1.0.66 => cc-1.0.67}/src/registry.rs | 0 .../src/setup_config.rs | 0 .../{cc-1.0.66 => cc-1.0.67}/src/winapi.rs | 0 .../src/windows_registry.rs | 0 .../{cc-1.0.66 => cc-1.0.67}/tests/cc_env.rs | 0 .../{cc-1.0.66 => cc-1.0.67}/tests/cflags.rs | 0 .../tests/cxxflags.rs | 0 .../tests/support/mod.rs | 0 .../{cc-1.0.66 => cc-1.0.67}/tests/test.rs | 0 .../cargo/vendor/cocoa-0.20.2/BUILD.bazel | 2 +- .../cargo/vendor/cocoa-0.24.0/BUILD.bazel | 2 +- .../vendor/cocoa-foundation-0.1.0/BUILD.bazel | 2 +- .../const_fn-0.4.5/.cargo-checksum.json | 1 - .../cargo/vendor/const_fn-0.4.5/BUILD.bazel | 55 - .../cargo/vendor/const_fn-0.4.5/CHANGELOG.md | 149 -- .../cargo/vendor/const_fn-0.4.5/Cargo.toml | 30 - .../vendor/const_fn-0.4.5/LICENSE-APACHE | 177 -- .../cargo/vendor/const_fn-0.4.5/README.md | 71 - .../cargo/vendor/const_fn-0.4.5/build.rs | 102 - .../cargo/vendor/const_fn-0.4.5/src/ast.rs | 141 - .../cargo/vendor/const_fn-0.4.5/src/error.rs | 37 - .../cargo/vendor/const_fn-0.4.5/src/iter.rs | 39 - .../cargo/vendor/const_fn-0.4.5/src/lib.rs | 233 -- .../vendor/const_fn-0.4.5/src/to_tokens.rs | 36 - .../cargo/vendor/const_fn-0.4.5/src/utils.rs | 46 - .../vendor/core-foundation-0.7.0/BUILD.bazel | 2 +- .../vendor/core-foundation-0.9.1/BUILD.bazel | 2 +- .../vendor/core-graphics-0.19.2/BUILD.bazel | 2 +- .../vendor/core-graphics-0.22.2/BUILD.bazel | 2 +- .../core-graphics-types-0.1.1/BUILD.bazel | 2 +- .../vendor/core-video-sys-0.1.4/BUILD.bazel | 2 +- .../crossbeam-channel-0.5.0/BUILD.bazel | 2 +- .../vendor/crossbeam-deque-0.8.0/BUILD.bazel | 4 +- .../.cargo-checksum.json | 1 - .../vendor/crossbeam-epoch-0.9.1/Cargo.lock | 140 - .../examples/treiber_stack.rs | 107 - .../vendor/crossbeam-epoch-0.9.1/src/lib.rs | 91 - .../crossbeam-epoch-0.9.1/src/sync/mod.rs | 4 - .../.cargo-checksum.json | 1 + .../BUILD.bazel | 13 +- .../CHANGELOG.md | 11 + .../Cargo.lock | 254 +- .../Cargo.toml | 18 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../README.md | 4 +- .../benches/defer.rs | 0 .../benches/flush.rs | 0 .../benches/pin.rs | 0 .../examples/sanitize.rs | 2 +- .../src/atomic.rs | 239 +- .../src/collector.rs | 11 +- .../src/default.rs | 4 +- .../src/deferred.rs | 8 +- .../src/epoch.rs | 55 +- .../src/guard.rs | 0 .../src/internal.rs | 89 +- .../vendor/crossbeam-epoch-0.9.3/src/lib.rs | 187 ++ .../src/sync/list.rs | 24 +- .../crossbeam-epoch-0.9.3/src/sync/mod.rs | 4 + .../src/sync/queue.rs | 44 +- .../crossbeam-epoch-0.9.3/tests/loom.rs | 157 ++ .../.cargo-checksum.json | 1 - .../vendor/crossbeam-utils-0.8.1/src/lib.rs | 56 - .../.cargo-checksum.json | 1 + .../BUILD.bazel | 2 +- .../CHANGELOG.md | 13 +- .../Cargo.toml | 8 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../README.md | 2 +- .../benches/atomic_cell.rs | 8 +- .../build.rs | 0 .../src/atomic/atomic_cell.rs | 27 +- .../src/atomic/consume.rs | 14 +- .../src/atomic/mod.rs | 5 + .../src/atomic/seq_lock.rs | 14 +- .../src/atomic/seq_lock_wide.rs | 14 +- .../src/backoff.rs | 15 +- .../src/cache_padded.rs | 60 +- .../vendor/crossbeam-utils-0.8.3/src/lib.rs | 115 + .../src/sync/mod.rs | 2 + .../src/sync/parker.rs | 110 +- .../src/sync/sharded_lock.rs | 0 .../src/sync/wait_group.rs | 2 +- .../src/thread.rs | 3 - .../tests/atomic_cell.rs | 0 .../tests/cache_padded.rs | 4 +- .../tests/parker.rs | 4 +- .../tests/sharded_lock.rs | 7 +- .../tests/thread.rs | 0 .../tests/wait_group.rs | 0 .../vendor/darling_core-0.10.2/BUILD.bazel | 6 +- .../vendor/darling_macro-0.10.2/BUILD.bazel | 4 +- .../cargo/vendor/deflate-0.8.6/BUILD.bazel | 2 +- .../derivative-2.1.3/.cargo-checksum.json | 1 - .../cargo/vendor/derivative-2.1.3/Makefile | 7 - .../cargo/vendor/derivative-2.1.3/book.json | 12 - .../vendor/derivative-2.1.3/doc/SUMMARY.md | 25 - .../derivative-2.1.3/doc/debug-transparent.rs | 3 - .../cargo/vendor/derivative-2.1.3/src/cmp.rs | 346 --- .../derivative-2.2.0/.cargo-checksum.json | 1 + .../BUILD.bazel | 18 +- .../CHANGELOG.md | 8 + .../CONTRIBUTING.md | 4 +- .../Cargo.toml | 2 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../README.md | 2 +- .../cargo/vendor/derivative-2.2.0/book.toml | 16 + .../doc/Clone.md | 2 +- .../doc/Debug.md | 46 +- .../doc/Default.md | 18 +- .../doc/Hash.md | 22 +- .../doc/README.md | 107 +- .../vendor/derivative-2.2.0/doc/SUMMARY.md | 25 + .../doc/cmp.md | 42 +- .../vendor/derivative-2.2.0/doc/custom.css | 24 + .../doc/debug-transparent-orig.rs | 3 +- .../derivative-2.2.0/doc/debug-transparent.rs | 5 + .../doc/default-enum-orig.rs | 5 + .../doc/default-enum.rs | 4 +- .../doc/default-value-orig.rs | 8 +- .../doc/default-value.rs | 10 +- .../doc/eq-ignore-orig.rs | 5 +- .../doc/eq-ignore.rs | 6 +- .../doc/styles/website.css | 0 .../src/ast.rs | 9 +- .../src/attr.rs | 24 +- .../src/bound.rs | 0 .../src/clone.rs | 16 +- .../cargo/vendor/derivative-2.2.0/src/cmp.rs | 407 +++ .../src/debug.rs | 56 +- .../src/default.rs | 0 .../src/hash.rs | 8 +- .../src/lib.rs | 0 .../src/matcher.rs | 102 +- .../src/paths.rs | 0 .../src/utils.rs | 0 .../tests/clippy-warning-clone-from.rs | 0 .../tests/compile-fail/derive-debug-unused.rs | 19 + .../compile-fail/derive-debug-unused.stderr | 11 + .../tests/compile-fail/derive-debug.rs | 0 .../tests/compile-fail/derive-debug.stderr | 1 - .../tests/compile-fail/derive-partial-ord.rs | 0 .../compile-fail/derive-partial-ord.stderr | 0 .../tests/compile-fail/invalid-attribute.rs | 0 .../compile-fail/invalid-attribute.stderr | 0 .../tests/compile-fail/unknown-attribute.rs | 0 .../compile-fail/unknown-attribute.stderr | 0 .../tests/compile-fail/unknown-derive.rs | 0 .../tests/compile-fail/unknown-derive.stderr | 0 .../tests/compile-test.rs | 0 .../tests/derive-clone-generics.rs | 0 .../tests/derive-clone.rs | 0 .../tests/derive-debug-bounds.rs | 4 +- .../tests/derive-debug-generics.rs | 2 + .../tests/derive-debug-packed.rs | 74 + .../tests/derive-debug-transparent.rs | 0 .../tests/derive-debug.rs | 2 + .../tests/derive-default-bounds.rs | 0 .../tests/derive-default.rs | 0 .../tests/derive-eq-packed.rs | 61 + .../tests/derive-eq.rs | 0 .../tests/derive-hash.rs | 0 .../tests/derive-ord-packed.rs | 264 ++ .../tests/derive-ord.rs | 0 .../tests/derive-partial-eq-packed.rs | 120 + .../tests/derive-partial-eq.rs | 2 +- .../tests/issue-37-turbofish.rs | 0 .../tests/issue-55.rs | 0 .../tests/issue-57.rs | 0 .../tests/issue-58.rs | 2 +- .../tests/issue-67.rs | 0 .../vendor/derivative-2.2.0/tests/issue-82.rs | 13 + .../tests/rustc-class-implement-traits.rs | 0 .../tests/rustc-deriving-bounds.rs | 0 .../tests/rustc-deriving-clone-array.rs | 0 .../tests/rustc-deriving-clone-enum.rs | 0 .../rustc-deriving-clone-generic-enum.rs | 0 ...stc-deriving-clone-generic-tuple-struct.rs | 0 .../tests/rustc-deriving-clone-struct.rs | 0 .../rustc-deriving-clone-tuple-struct.rs | 0 .../tests/rustc-deriving-cmp-generic-enum.rs | 0 .../rustc-deriving-cmp-generic-struct-enum.rs | 0 .../rustc-deriving-cmp-generic-struct.rs | 0 ...rustc-deriving-cmp-generic-tuple-struct.rs | 0 .../tests/rustc-deriving-copyclone.rs | 0 .../tests/rustc-deriving-default-box.rs | 0 .../rustc-deriving-enum-single-variant.rs | 0 .../tests/rustc-deriving-hash.rs | 0 .../tests/rustc-deriving-in-fn.rs | 0 .../tests/rustc-deriving-meta-multiple.rs | 0 .../tests/rustc-deriving-meta.rs | 0 .../tests/rustc-deriving-show-2.rs | 0 .../tests/rustc-deriving-show.rs | 0 .../rustc-deriving-via-extension-hash-enum.rs | 0 ...ustc-deriving-via-extension-hash-struct.rs | 0 ...ustc-deriving-via-extension-type-params.rs | 0 .../tests/rustc-expr-copy.rs | 0 .../tests/rustc-exterior.rs | 0 .../tests/rustc-issue-12860.rs | 0 .../tests/rustc-issue-13434.rs | 0 .../tests/rustc-issue-16530.rs | 0 .../tests/rustc-issue-19037.rs | 0 .../tests/rustc-issue-19102.rs | 0 .../tests/rustc-issue-19135.rs | 0 .../tests/rustc-issue-19358.rs | 0 .../tests/rustc-issue-21402.rs | 0 .../tests/rustc-issue-23649-3.rs | 0 .../tests/rustc-issue-24085.rs | 0 .../tests/rustc-issue-25394.rs | 0 .../tests/rustc-issue-28561.rs | 0 .../tests/rustc-issue-29030.rs | 0 .../tests/rustc-issue-29540.rs | 0 .../tests/rustc-issue-29710.rs | 0 .../tests/rustc-issue-32292.rs | 0 .../tests/rustc-issue-3935.rs | 0 .../tests/rustc-issue-42453.rs | 0 .../tests/rustc-issue-58319.rs | 0 .../tests/rustc-issue-6341.rs | 0 .../tests/rustc-typeclasses-eq-example.rs | 0 .../tests/rustc-zero-sized-btreemap-insert.rs | 0 .../cargo/vendor/dlib-0.4.2/BUILD.bazel | 3 +- .../vendor/dlib-0.5.0/.cargo-checksum.json | 1 + .../cargo/vendor/dlib-0.5.0/BUILD.bazel | 54 + .../cargo/vendor/dlib-0.5.0/Cargo.toml | 25 + .../LICENSE.txt | 0 third_party/cargo/vendor/dlib-0.5.0/README.md | 136 + .../cargo/vendor/dlib-0.5.0/src/lib.rs | 386 +++ .../cargo/vendor/env_logger-0.6.2/BUILD.bazel | 4 +- .../vendor/flatbuffers-0.6.1/BUILD.bazel | 2 +- .../vendor/gif-0.11.1/.cargo-checksum.json | 1 - .../vendor/gif-0.11.2/.cargo-checksum.json | 1 + .../{gif-0.11.1 => gif-0.11.2}/BUILD.bazel | 14 +- .../cargo/vendor/gif-0.11.2/Cargo.lock | 646 +++++ .../{gif-0.11.1 => gif-0.11.2}/Cargo.toml | 23 +- .../{gif-0.11.1 => gif-0.11.2}/Changes.md | 5 + .../{gif-0.11.1 => gif-0.11.2}/LICENSE-APACHE | 0 .../{gif-0.11.1 => gif-0.11.2}/LICENSE-MIT | 0 .../{gif-0.11.1 => gif-0.11.2}/README.md | 6 +- .../benches/decode.rs | 0 .../vendor/gif-0.11.2/examples/explode.rs | 44 + .../{gif-0.11.1 => gif-0.11.2}/src/common.rs | 23 + .../{gif-0.11.1 => gif-0.11.2}/src/encoder.rs | 1 + .../{gif-0.11.1 => gif-0.11.2}/src/lib.rs | 4 +- .../src/reader/decoder.rs | 10 +- .../src/reader/mod.rs | 17 + .../{gif-0.11.1 => gif-0.11.2}/src/traits.rs | 0 .../gif-0.11.2/tests/check_testimages.rs | 170 ++ .../vendor/gif-0.11.2/tests/crashtest.rs | 28 + .../cargo/vendor/gif-0.11.2/tests/decode.rs | 84 + .../cargo/vendor/gif-0.11.2/tests/results.txt | 10 + .../vendor/gif-0.11.2/tests/roundtrip.rs | 55 + .../vendor/half-1.6.0/.cargo-checksum.json | 1 - .../cargo/vendor/half-1.6.0/appveyor.yml | 156 -- .../vendor/half-1.7.1/.cargo-checksum.json | 1 + .../{half-1.6.0 => half-1.7.1}/BUILD.bazel | 2 +- .../{half-1.6.0 => half-1.7.1}/CHANGELOG.md | 23 +- .../{half-1.6.0 => half-1.7.1}/Cargo.toml | 16 +- .../{half-1.6.0 => half-1.7.1}/LICENSE-APACHE | 0 .../{half-1.6.0 => half-1.7.1}/LICENSE-MIT | 0 .../{half-1.6.0 => half-1.7.1}/README.md | 7 +- .../benches/convert.rs | 0 .../{half-1.6.0 => half-1.7.1}/src/bfloat.rs | 106 +- .../src/bfloat/convert.rs | 0 .../src/binary16.rs | 106 +- .../src/binary16/convert.rs | 0 .../{half-1.6.0 => half-1.7.1}/src/lib.rs | 7 +- .../{half-1.6.0 => half-1.7.1}/src/slice.rs | 0 .../{half-1.6.0 => half-1.7.1}/src/vec.rs | 0 .../tests/version-numbers.rs | 0 .../.cargo-checksum.json | 2 +- .../BUILD.bazel | 4 +- .../Cargo.toml | 2 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../README.md | 0 .../rust-toolchain | 0 .../src/lib.rs | 3 +- .../src/tcplistener.rs | 0 .../src/tcpstream.rs | 0 .../vendor/image-0.23.12/.cargo-checksum.json | 1 - .../vendor/image-0.23.14/.cargo-checksum.json | 1 + .../BUILD.bazel | 14 +- .../CHANGES.md | 38 +- .../Cargo.toml | 24 +- .../Cargo.toml.public-private-dependencies | 0 .../{image-0.23.12 => image-0.23.14}/LICENSE | 0 .../README.md | 23 +- .../benches/README.md | 0 .../vendor/image-0.23.14/benches/copy_from.rs | 14 + .../benches/decode.rs | 0 .../benches/encode.rs | 0 .../cargo/vendor/image-0.23.14/clippy.toml | 1 + .../docs/2019-04-23-memory-unsafety.md | 0 .../release.sh | 0 .../src/animation.rs | 5 + .../src/buffer.rs | 24 +- .../image-0.23.14/src/codecs/avif/decoder.rs | 163 ++ .../src/codecs/avif/encoder.rs} | 69 +- .../image-0.23.14/src/codecs/avif/mod.rs | 14 + .../src/codecs/bmp/decoder.rs | 13 +- .../src/codecs/bmp/encoder.rs | 0 .../src/codecs/bmp/mod.rs | 0 .../src/codecs/dds.rs | 38 + .../src/codecs/dxt.rs | 0 .../src/codecs/farbfeld.rs | 30 +- .../src/codecs/gif.rs | 223 +- .../src/codecs/hdr/decoder.rs | 29 +- .../src/codecs/hdr/encoder.rs | 0 .../src/codecs/hdr/mod.rs | 0 .../src/codecs/ico/decoder.rs | 63 +- .../src/codecs/ico/encoder.rs | 0 .../src/codecs/ico/mod.rs | 0 .../src/codecs/jpeg/decoder.rs | 4 +- .../src/codecs/jpeg/encoder.rs | 37 +- .../src/codecs/jpeg/entropy.rs | 10 +- .../src/codecs/jpeg/mod.rs | 0 .../src/codecs/jpeg/transform.rs | 0 .../src/codecs/png.rs | 0 .../src/codecs/pnm/autobreak.rs | 0 .../src/codecs/pnm/decoder.rs | 36 +- .../src/codecs/pnm/encoder.rs | 5 +- .../src/codecs/pnm/header.rs | 0 .../src/codecs/pnm/mod.rs | 0 .../src/codecs/tga/decoder.rs | 82 +- .../src/codecs/tga/encoder.rs | 0 .../src/codecs/tga/header.rs | 0 .../src/codecs/tga/mod.rs | 0 .../src/codecs/tiff.rs | 2 +- .../src/codecs/webp/decoder.rs | 0 .../src/codecs/webp/mod.rs | 0 .../src/codecs/webp/transform.rs | 0 .../src/codecs/webp/vp8.rs | 10 +- .../src/color.rs | 3 + .../src/dynimage.rs | 59 +- .../src/error.rs | 0 .../src/flat.rs | 0 .../src/image.rs | 134 +- .../src/imageops/affine.rs | 0 .../src/imageops/colorops.rs | 134 +- .../src/imageops/mod.rs | 36 +- .../src/imageops/sample.rs | 63 +- .../src/io/free_functions.rs | 76 +- .../src/io/mod.rs | 0 .../src/io/reader.rs | 0 .../src/lib.rs | 11 +- .../src/math/mod.rs | 0 .../src/math/nq.rs | 0 .../src/math/rect.rs | 0 .../src/math/utils.rs | 8 + .../src/traits.rs | 0 .../src/utils/mod.rs | 7 + .../cargo/vendor/iovec-0.1.4/BUILD.bazel | 2 +- .../jpeg-decoder-0.1.20/.cargo-checksum.json | 1 - .../vendor/jpeg-decoder-0.1.20/Cargo.lock | 639 ----- .../src/worker/threaded.rs | 53 - .../jpeg-decoder-0.1.22/.cargo-checksum.json | 1 + .../BUILD.bazel | 3 +- .../CHANGELOG.md | 12 + .../vendor/jpeg-decoder-0.1.22/Cargo.lock | 636 +++++ .../Cargo.toml | 5 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../README.md | 0 .../appveyor.yml | 0 .../benches/decoding_benchmark.rs | 0 .../benches/tower.jpg | Bin .../benches/tower_grayscale.jpg | Bin .../benches/tower_progressive.jpg | Bin .../examples/decode.rs | 0 .../src/decoder.rs | 281 +- .../src/error.rs | 0 .../src/huffman.rs | 12 +- .../src/idct.rs | 11 +- .../src/lib.rs | 13 +- .../src/marker.rs | 0 .../src/parser.rs | 110 +- .../src/upsampler.rs | 4 +- .../src/worker/immediate.rs | 0 .../src/worker/mod.rs | 4 +- .../src/worker/multithreaded.rs | 87 + .../vendor/libc-0.2.82/.cargo-checksum.json | 1 - .../libc-0.2.82/src/cloudabi/aarch64.rs | 4 - .../vendor/libc-0.2.82/src/cloudabi/arm.rs | 4 - .../vendor/libc-0.2.82/src/cloudabi/mod.rs | 375 --- .../vendor/libc-0.2.82/src/cloudabi/x86.rs | 4 - .../vendor/libc-0.2.82/src/cloudabi/x86_64.rs | 4 - .../libc-0.2.82/src/unix/uclibc/align.rs | 66 - .../vendor/libc-0.2.82/src/unix/uclibc/mod.rs | 2365 ----------------- .../src/unix/uclibc/x86_64/align.rs | 77 - .../src/unix/uclibc/x86_64/no_align.rs | 59 - .../vendor/libc-0.2.92/.cargo-checksum.json | 1 + .../{libc-0.2.82 => libc-0.2.92}/BUILD.bazel | 4 +- .../CONTRIBUTING.md | 6 +- .../{libc-0.2.82 => libc-0.2.92}/Cargo.toml | 2 +- .../LICENSE-APACHE | 0 .../{libc-0.2.82 => libc-0.2.92}/LICENSE-MIT | 0 .../{libc-0.2.82 => libc-0.2.92}/README.md | 2 +- .../{libc-0.2.82 => libc-0.2.92}/build.rs | 7 + .../{libc-0.2.82 => libc-0.2.92}/rustfmt.toml | 0 .../src/fixed_width_ints.rs | 0 .../src/fuchsia/aarch64.rs | 0 .../src/fuchsia/align.rs | 0 .../src/fuchsia/mod.rs | 9 +- .../src/fuchsia/no_align.rs | 0 .../src/fuchsia/x86_64.rs | 0 .../src/hermit/aarch64.rs | 0 .../src/hermit/mod.rs | 0 .../src/hermit/x86_64.rs | 0 .../{libc-0.2.82 => libc-0.2.92}/src/lib.rs | 13 +- .../src/macros.rs | 0 .../{libc-0.2.82 => libc-0.2.92}/src/psp.rs | 32 +- .../{libc-0.2.82 => libc-0.2.92}/src/sgx.rs | 0 .../src/switch.rs | 0 .../src/unix/align.rs | 0 .../src/unix/bsd/apple/b32/align.rs | 0 .../src/unix/bsd/apple/b32/mod.rs | 0 .../src/unix/bsd/apple/b64/aarch64/align.rs | 0 .../src/unix/bsd/apple/b64/aarch64/mod.rs | 0 .../src/unix/bsd/apple/b64/align.rs | 0 .../src/unix/bsd/apple/b64/mod.rs | 0 .../src/unix/bsd/apple/b64/x86_64/align.rs | 0 .../src/unix/bsd/apple/b64/x86_64/mod.rs | 0 .../src/unix/bsd/apple/mod.rs | 209 +- .../unix/bsd/freebsdlike/dragonfly/errno.rs | 0 .../src/unix/bsd/freebsdlike/dragonfly/mod.rs | 38 +- .../unix/bsd/freebsdlike/freebsd/aarch64.rs | 0 .../src/unix/bsd/freebsdlike/freebsd/arm.rs | 0 .../bsd/freebsdlike/freebsd/freebsd11/b64.rs | 0 .../bsd/freebsdlike/freebsd/freebsd11/mod.rs | 3 +- .../bsd/freebsdlike/freebsd/freebsd12/b64.rs | 0 .../bsd/freebsdlike/freebsd/freebsd12/mod.rs | 14 +- .../bsd/freebsdlike/freebsd/freebsd13/b64.rs | 34 + .../bsd/freebsdlike/freebsd/freebsd13/mod.rs | 250 ++ .../src/unix/bsd/freebsdlike/freebsd/mod.rs | 122 +- .../unix/bsd/freebsdlike/freebsd/powerpc64.rs | 0 .../src/unix/bsd/freebsdlike/freebsd/x86.rs | 0 .../bsd/freebsdlike/freebsd/x86_64/align.rs | 0 .../bsd/freebsdlike/freebsd/x86_64/mod.rs | 0 .../src/unix/bsd/freebsdlike/mod.rs | 67 +- .../src/unix/bsd/mod.rs | 9 +- .../src/unix/bsd/netbsdlike/mod.rs | 0 .../src/unix/bsd/netbsdlike/netbsd/aarch64.rs | 0 .../src/unix/bsd/netbsdlike/netbsd/arm.rs | 0 .../src/unix/bsd/netbsdlike/netbsd/mod.rs | 35 +- .../src/unix/bsd/netbsdlike/netbsd/powerpc.rs | 0 .../src/unix/bsd/netbsdlike/netbsd/sparc64.rs | 0 .../src/unix/bsd/netbsdlike/netbsd/x86.rs | 0 .../src/unix/bsd/netbsdlike/netbsd/x86_64.rs | 0 .../unix/bsd/netbsdlike/openbsd/aarch64.rs | 0 .../src/unix/bsd/netbsdlike/openbsd/mod.rs | 18 +- .../unix/bsd/netbsdlike/openbsd/sparc64.rs | 0 .../src/unix/bsd/netbsdlike/openbsd/x86.rs | 0 .../src/unix/bsd/netbsdlike/openbsd/x86_64.rs | 0 .../src/unix/haiku/b32.rs | 0 .../src/unix/haiku/b64.rs | 0 .../src/unix/haiku/mod.rs | 215 +- .../libc-0.2.92/src/unix/haiku/native.rs | 1146 ++++++++ .../src/unix/hermit/aarch64.rs | 0 .../src/unix/hermit/mod.rs | 0 .../src/unix/hermit/x86_64.rs | 0 .../src/unix/linux_like/android/b32/arm.rs | 16 + .../src/unix/linux_like/android/b32/mod.rs | 0 .../unix/linux_like/android/b32/x86/align.rs | 0 .../unix/linux_like/android/b32/x86/mod.rs | 29 + .../linux_like/android/b64/aarch64/align.rs | 0 .../linux_like/android/b64/aarch64/mod.rs | 0 .../src/unix/linux_like/android/b64/mod.rs | 16 + .../linux_like/android/b64/x86_64/align.rs | 0 .../unix/linux_like/android/b64/x86_64/mod.rs | 0 .../src/unix/linux_like/android/mod.rs | 93 +- .../src/unix/linux_like/emscripten/align.rs | 0 .../src/unix/linux_like/emscripten/mod.rs | 0 .../unix/linux_like/emscripten/no_align.rs | 0 .../src/unix/linux_like/linux/align.rs | 0 .../src/unix/linux_like/linux/gnu/align.rs | 0 .../linux_like/linux/gnu/b32/arm/align.rs | 0 .../unix/linux_like/linux/gnu/b32/arm/mod.rs | 22 +- .../linux_like/linux/gnu/b32/mips/align.rs | 0 .../unix/linux_like/linux/gnu/b32/mips/mod.rs | 17 + .../src/unix/linux_like/linux/gnu/b32/mod.rs | 1 - .../unix/linux_like/linux/gnu/b32/powerpc.rs | 21 +- .../linux_like/linux/gnu/b32/riscv32/mod.rs | 21 +- .../linux_like/linux/gnu/b32/sparc/align.rs | 0 .../linux_like/linux/gnu/b32/sparc/mod.rs | 21 +- .../linux_like/linux/gnu/b32/x86/align.rs | 0 .../unix/linux_like/linux/gnu/b32/x86/mod.rs | 22 +- .../linux_like/linux/gnu/b64/aarch64/align.rs | 0 .../linux_like/linux/gnu/b64/aarch64/ilp32.rs | 62 + .../linux_like/linux/gnu/b64/aarch64/lp64.rs | 71 + .../linux_like/linux/gnu/b64/aarch64/mod.rs | 74 +- .../linux_like/linux/gnu/b64/mips64/align.rs | 0 .../linux_like/linux/gnu/b64/mips64/mod.rs | 18 +- .../src/unix/linux_like/linux/gnu/b64/mod.rs | 14 +- .../linux/gnu/b64/powerpc64/align.rs | 0 .../linux_like/linux/gnu/b64/powerpc64/mod.rs | 20 +- .../linux_like/linux/gnu/b64/riscv64/mod.rs | 19 +- .../unix/linux_like/linux/gnu/b64/s390x.rs | 20 +- .../linux_like/linux/gnu/b64/sparc64/align.rs | 0 .../linux_like/linux/gnu/b64/sparc64/mod.rs | 22 +- .../linux_like/linux/gnu/b64/x86_64/align.rs | 0 .../linux_like/linux/gnu/b64/x86_64/mod.rs | 2 +- .../linux/gnu/b64/x86_64/not_x32.rs | 17 + .../linux_like/linux/gnu/b64/x86_64/x32.rs | 17 + .../src/unix/linux_like/linux/gnu/mod.rs | 141 +- .../src/unix/linux_like/linux/gnu/no_align.rs | 0 .../src/unix/linux_like/linux/mod.rs | 521 ++-- .../linux_like/linux/musl/b32/arm/align.rs | 0 .../unix/linux_like/linux/musl/b32/arm/mod.rs | 24 +- .../unix/linux_like/linux/musl/b32/hexagon.rs | 0 .../linux_like/linux/musl/b32/mips/align.rs | 0 .../linux_like/linux/musl/b32/mips/mod.rs | 21 + .../src/unix/linux_like/linux/musl/b32/mod.rs | 0 .../unix/linux_like/linux/musl/b32/powerpc.rs | 21 + .../linux_like/linux/musl/b32/x86/align.rs | 0 .../unix/linux_like/linux/musl/b32/x86/mod.rs | 24 +- .../linux/musl/b64/aarch64/align.rs | 0 .../linux_like/linux/musl/b64/aarch64/mod.rs | 22 + .../unix/linux_like/linux/musl/b64/mips64.rs | 81 +- .../src/unix/linux_like/linux/musl/b64/mod.rs | 3 + .../linux_like/linux/musl/b64/powerpc64.rs | 23 +- .../unix/linux_like/linux/musl/b64/s390x.rs | 780 ++++++ .../linux_like/linux/musl/b64/x86_64/align.rs | 0 .../linux_like/linux/musl/b64/x86_64/mod.rs | 24 +- .../src/unix/linux_like/linux/musl/mod.rs | 80 +- .../src/unix/linux_like/linux/no_align.rs | 0 .../src/unix/linux_like/linux/uclibc/align.rs | 28 + .../linux_like/linux}/uclibc/arm/align.rs | 0 .../unix/linux_like/linux}/uclibc/arm/mod.rs | 313 +-- .../linux_like/linux}/uclibc/arm/no_align.rs | 0 .../linux}/uclibc/mips/mips32/align.rs | 0 .../linux}/uclibc/mips/mips32/mod.rs | 46 +- .../linux}/uclibc/mips/mips32/no_align.rs | 0 .../linux}/uclibc/mips/mips64/align.rs | 0 .../linux}/uclibc/mips/mips64/mod.rs | 0 .../linux}/uclibc/mips/mips64/no_align.rs | 0 .../unix/linux_like/linux}/uclibc/mips/mod.rs | 82 - .../src/unix/linux_like/linux/uclibc/mod.rs | 304 +++ .../unix/linux_like/linux}/uclibc/no_align.rs | 0 .../linux_like/linux}/uclibc/x86_64/l4re.rs | 0 .../linux_like/linux}/uclibc/x86_64/mod.rs | 83 +- .../linux_like/linux}/uclibc/x86_64/other.rs | 0 .../src/unix/linux_like/mod.rs | 112 +- .../src/unix/mod.rs | 143 +- .../src/unix/newlib/aarch64/mod.rs | 0 .../src/unix/newlib/align.rs | 0 .../src/unix/newlib/arm/mod.rs | 0 .../src/unix/newlib/mod.rs | 21 +- .../src/unix/newlib/no_align.rs | 0 .../src/unix/newlib/powerpc/mod.rs | 0 .../src/unix/newlib/xtensa/mod.rs | 0 .../src/unix/no_align.rs | 0 .../src/unix/redox/mod.rs | 0 .../src/unix/solarish/compat.rs | 0 .../src/unix/solarish/illumos.rs | 6 + .../src/unix/solarish/mod.rs | 60 +- .../src/unix/solarish/solaris.rs | 0 .../src/vxworks/aarch64.rs | 0 .../src/vxworks/arm.rs | 0 .../src/vxworks/mod.rs | 4 +- .../src/vxworks/powerpc.rs | 0 .../src/vxworks/powerpc64.rs | 0 .../src/vxworks/x86.rs | 0 .../src/vxworks/x86_64.rs | 0 .../{libc-0.2.82 => libc-0.2.92}/src/wasi.rs | 111 +- .../src/windows/gnu/align.rs | 0 .../src/windows/gnu/mod.rs | 0 .../src/windows/mod.rs | 0 .../src/windows/msvc.rs | 0 .../tests/const_fn.rs | 0 .../.cargo-checksum.json | 2 +- .../cargo/vendor/libloading-0.6.7/BUILD.bazel | 81 + .../Cargo.toml | 2 +- .../LICENSE | 0 .../README.mkd | 0 .../src/changelog.rs | 11 + .../src/error.rs | 2 +- .../src/lib.rs | 0 .../src/os/mod.rs | 0 .../src/os/unix/consts.rs | 0 .../src/os/unix/mod.rs | 0 .../src/os/windows/mod.rs | 39 + .../src/test_helpers.rs | 0 .../src/util.rs | 0 .../tests/constants.rs | 0 .../tests/functions.rs | 20 + .../tests/library_filename.rs | 0 .../tests/markers.rs | 0 .../tests/nagisa32.dll | Bin .../tests/nagisa64.dll | Bin .../tests/windows.rs | 0 .../libloading-0.7.0/.cargo-checksum.json | 1 + .../BUILD.bazel | 2 +- .../cargo/vendor/libloading-0.7.0/Cargo.toml | 36 + .../cargo/vendor/libloading-0.7.0/LICENSE | 12 + .../cargo/vendor/libloading-0.7.0/README.mkd | 16 + .../vendor/libloading-0.7.0/src/changelog.rs | 291 ++ .../vendor/libloading-0.7.0/src/error.rs | 130 + .../cargo/vendor/libloading-0.7.0/src/lib.rs | 368 +++ .../vendor/libloading-0.7.0/src/os/mod.rs | 27 + .../libloading-0.7.0/src/os/unix/consts.rs | 230 ++ .../libloading-0.7.0/src/os/unix/mod.rs | 448 ++++ .../libloading-0.7.0/src/os/windows/mod.rs | 536 ++++ .../libloading-0.7.0/src/test_helpers.rs | 37 + .../cargo/vendor/libloading-0.7.0/src/util.rs | 31 + .../libloading-0.7.0/tests/constants.rs | 13 + .../libloading-0.7.0/tests/functions.rs | 256 ++ .../tests/library_filename.rs | 17 + .../vendor/libloading-0.7.0/tests/markers.rs | 96 + .../libloading-0.7.0/tests/nagisa32.dll | Bin 0 -> 3072 bytes .../libloading-0.7.0/tests/nagisa64.dll | Bin 0 -> 2560 bytes .../vendor/libloading-0.7.0/tests/windows.rs | 64 + .../lock_api-0.4.2/.cargo-checksum.json | 1 - .../lock_api-0.4.3/.cargo-checksum.json | 1 + .../BUILD.bazel | 2 +- .../Cargo.toml | 2 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../src/lib.rs | 0 .../src/mutex.rs | 0 .../src/remutex.rs | 13 + .../src/rwlock.rs | 0 .../vendor/log-0.4.11/.cargo-checksum.json | 1 - third_party/cargo/vendor/log-0.4.11/build.rs | 14 - .../cargo/vendor/log-0.4.11/src/kv/source.rs | 393 --- .../vendor/log-0.4.11/src/kv/value/fill.rs | 164 -- .../vendor/log-0.4.11/src/kv/value/impls.rs | 159 -- .../log-0.4.11/src/kv/value/internal/cast.rs | 475 ---- .../log-0.4.11/src/kv/value/internal/fmt.rs | 249 -- .../log-0.4.11/src/kv/value/internal/mod.rs | 181 -- .../log-0.4.11/src/kv/value/internal/sval.rs | 210 -- .../vendor/log-0.4.11/src/kv/value/mod.rs | 56 - .../vendor/log-0.4.11/src/kv/value/test.rs | 81 - .../cargo/vendor/log-0.4.11/tests/filters.rs | 72 - .../cargo/vendor/log-0.4.11/tests/macros.rs | 36 - .../vendor/log-0.4.14/.cargo-checksum.json | 1 + .../{log-0.4.11 => log-0.4.14}/BUILD.bazel | 6 +- .../{log-0.4.11 => log-0.4.14}/CHANGELOG.md | 31 +- .../{log-0.4.11 => log-0.4.14}/Cargo.toml | 31 +- .../{log-0.4.11 => log-0.4.14}/LICENSE-APACHE | 0 .../{log-0.4.11 => log-0.4.14}/LICENSE-MIT | 0 .../{log-0.4.11 => log-0.4.14}/README.md | 0 .../cargo/vendor/log-0.4.14/benches/value.rs | 30 + third_party/cargo/vendor/log-0.4.14/build.rs | 43 + .../src/kv/error.rs | 0 .../{log-0.4.11 => log-0.4.14}/src/kv/key.rs | 33 + .../{log-0.4.11 => log-0.4.14}/src/kv/mod.rs | 2 +- .../cargo/vendor/log-0.4.14/src/kv/source.rs | 754 ++++++ .../cargo/vendor/log-0.4.14/src/kv/value.rs | 655 +++++ .../{log-0.4.11 => log-0.4.14}/src/lib.rs | 144 +- .../{log-0.4.11 => log-0.4.14}/src/macros.rs | 32 +- .../{log-0.4.11 => log-0.4.14}/src/serde.rs | 71 + .../{log-0.4.11 => log-0.4.14}/triagebot.toml | 0 .../cargo/vendor/malloc_buf-0.0.6/BUILD.bazel | 2 +- .../cargo/vendor/memmap2-0.1.0/BUILD.bazel | 2 +- .../memoffset-0.6.1/.cargo-checksum.json | 1 - .../memoffset-0.6.3/.cargo-checksum.json | 1 + .../BUILD.bazel | 2 +- .../Cargo.toml | 3 +- .../LICENSE | 0 .../README.md | 5 - .../build.rs | 3 + .../ci/miri.sh | 0 .../src/lib.rs | 19 +- .../src/offset_of.rs | 20 +- .../src/raw_field.rs | 20 +- .../src/span_of.rs | 42 +- .../cargo/vendor/metal-0.18.0/BUILD.bazel | 2 +- .../.cargo-checksum.json | 2 +- .../BUILD.bazel | 4 +- .../Cargo.toml | 4 +- .../LICENSE | 0 .../LICENSE-APACHE.md | 0 .../LICENSE-MIT.md | 0 .../LICENSE-ZLIB.md | 0 .../Readme.md | 0 .../build.rs | 0 .../src/deflate/buffer.rs | 0 .../src/deflate/core.rs | 8 +- .../src/deflate/mod.rs | 0 .../src/deflate/stream.rs | 0 .../src/inflate/core.rs | 2 +- .../src/inflate/mod.rs | 0 .../src/inflate/output_buffer.rs | 4 +- .../src/inflate/stream.rs | 2 +- .../src/lib.rs | 0 .../src/shared.rs | 0 .../cargo/vendor/mio-0.6.23/BUILD.bazel | 4 +- .../cargo/vendor/mio-extras-2.0.6/BUILD.bazel | 2 +- .../cargo/vendor/ndk-0.2.1/BUILD.bazel | 2 +- .../cargo/vendor/ndk-glue-0.2.1/BUILD.bazel | 4 +- .../cargo/vendor/ndk-macro-0.2.0/BUILD.bazel | 6 +- .../cargo/vendor/net2-0.2.37/BUILD.bazel | 2 +- .../cargo/vendor/nix-0.18.0/BUILD.bazel | 2 +- .../vendor/nix-0.19.1/.cargo-checksum.json | 1 - .../cargo/vendor/nix-0.19.1/test/test.rs | 203 -- .../vendor/nix-0.20.0/.cargo-checksum.json | 1 + .../{nix-0.19.1 => nix-0.20.0}/BUILD.bazel | 4 +- .../{nix-0.19.1 => nix-0.20.0}/CHANGELOG.md | 37 +- .../CONTRIBUTING.md | 10 +- .../{nix-0.19.1 => nix-0.20.0}/CONVENTIONS.md | 0 .../{nix-0.19.1 => nix-0.20.0}/Cargo.toml | 10 +- .../vendor/{nix-0.19.1 => nix-0.20.0}/LICENSE | 0 .../{nix-0.19.1 => nix-0.20.0}/README.md | 10 +- .../{nix-0.19.1 => nix-0.20.0}/src/dir.rs | 86 +- .../{nix-0.19.1 => nix-0.20.0}/src/env.rs | 0 .../{nix-0.19.1 => nix-0.20.0}/src/errno.rs | 192 +- .../{nix-0.19.1 => nix-0.20.0}/src/fcntl.rs | 4 +- .../src/features.rs | 2 +- .../{nix-0.19.1 => nix-0.20.0}/src/ifaddrs.rs | 0 .../{nix-0.19.1 => nix-0.20.0}/src/kmod.rs | 0 .../{nix-0.19.1 => nix-0.20.0}/src/lib.rs | 2 +- .../{nix-0.19.1 => nix-0.20.0}/src/macros.rs | 0 .../{nix-0.19.1 => nix-0.20.0}/src/mount.rs | 0 .../{nix-0.19.1 => nix-0.20.0}/src/mqueue.rs | 21 +- .../{nix-0.19.1 => nix-0.20.0}/src/net/if_.rs | 0 .../{nix-0.19.1 => nix-0.20.0}/src/net/mod.rs | 0 .../{nix-0.19.1 => nix-0.20.0}/src/poll.rs | 0 .../{nix-0.19.1 => nix-0.20.0}/src/pty.rs | 2 +- .../{nix-0.19.1 => nix-0.20.0}/src/sched.rs | 0 .../{nix-0.19.1 => nix-0.20.0}/src/sys/aio.rs | 0 .../src/sys/epoll.rs | 0 .../src/sys/event.rs | 0 .../src/sys/eventfd.rs | 0 .../src/sys/inotify.rs | 0 .../src/sys/ioctl/bsd.rs | 0 .../src/sys/ioctl/linux.rs | 0 .../src/sys/ioctl/mod.rs | 0 .../src/sys/memfd.rs | 0 .../src/sys/mman.rs | 35 + .../{nix-0.19.1 => nix-0.20.0}/src/sys/mod.rs | 3 + .../vendor/nix-0.20.0/src/sys/personality.rs | 70 + .../src/sys/pthread.rs | 0 .../src/sys/ptrace/bsd.rs | 0 .../src/sys/ptrace/linux.rs | 0 .../src/sys/ptrace/mod.rs | 0 .../src/sys/quota.rs | 0 .../src/sys/reboot.rs | 0 .../src/sys/select.rs | 0 .../src/sys/sendfile.rs | 0 .../src/sys/signal.rs | 61 +- .../src/sys/signalfd.rs | 7 +- .../src/sys/socket/addr.rs | 8 +- .../src/sys/socket/mod.rs | 27 +- .../src/sys/socket/sockopt.rs | 0 .../src/sys/stat.rs | 0 .../src/sys/statfs.rs | 175 +- .../src/sys/statvfs.rs | 0 .../src/sys/sysinfo.rs | 8 +- .../src/sys/termios.rs | 0 .../src/sys/time.rs | 19 +- .../src/sys/timerfd.rs | 17 +- .../{nix-0.19.1 => nix-0.20.0}/src/sys/uio.rs | 0 .../src/sys/utsname.rs | 0 .../src/sys/wait.rs | 38 +- .../{nix-0.19.1 => nix-0.20.0}/src/time.rs | 2 + .../src/ucontext.rs | 0 .../{nix-0.19.1 => nix-0.20.0}/src/unistd.rs | 66 +- .../vendor/nix-0.20.0/test/common/mod.rs | 127 + .../test/sys/mod.rs | 4 +- .../test/sys/test_aio.rs | 10 +- .../test/sys/test_aio_drop.rs | 1 + .../test/sys/test_epoll.rs | 0 .../test/sys/test_inotify.rs | 0 .../test/sys/test_ioctl.rs | 0 .../test/sys/test_lio_listio_resubmit.rs | 0 .../vendor/nix-0.20.0/test/sys/test_mman.rs | 80 + .../test/sys/test_pthread.rs | 0 .../test/sys/test_ptrace.rs | 12 +- .../test/sys/test_select.rs | 0 .../test/sys/test_signal.rs | 1 + .../test/sys/test_signalfd.rs | 0 .../test/sys/test_socket.rs | 17 +- .../test/sys/test_sockopt.rs | 2 + .../test/sys/test_sysinfo.rs | 0 .../test/sys/test_termios.rs | 0 .../test/sys/test_timerfd.rs | 0 .../test/sys/test_uio.rs | 1 + .../test/sys/test_wait.rs | 1 + .../cargo/vendor/nix-0.20.0/test/test.rs | 100 + .../test/test_clearenv.rs | 0 .../test/test_dir.rs | 2 + .../test/test_fcntl.rs | 6 +- .../test/test_kmod/hello_mod/Makefile | 0 .../test/test_kmod/hello_mod/hello.c | 0 .../test/test_kmod/mod.rs | 1 + .../test/test_mount.rs | 3 + .../test/test_mq.rs | 18 +- .../test/test_net.rs | 0 .../test/test_nix_path.rs | 0 .../test/test_poll.rs | 25 +- .../test/test_pty.rs | 0 .../test/test_ptymaster_drop.rs | 2 +- .../test/test_sched.rs | 0 .../test/test_sendfile.rs | 0 .../test/test_stat.rs | 0 .../test/test_time.rs | 0 .../test/test_unistd.rs | 132 +- .../.cargo-checksum.json | 2 +- .../{nom-6.0.1 => nom-6.1.2}/.travis.yml | 0 .../{nom-6.0.1 => nom-6.1.2}/BUILD.bazel | 2 +- .../{nom-6.0.1 => nom-6.1.2}/CHANGELOG.md | 0 .../{nom-6.0.1 => nom-6.1.2}/Cargo.lock | 205 +- .../{nom-6.0.1 => nom-6.1.2}/Cargo.toml | 9 +- .../vendor/{nom-6.0.1 => nom-6.1.2}/LICENSE | 0 .../vendor/{nom-6.0.1 => nom-6.1.2}/README.md | 3 +- .../vendor/{nom-6.0.1 => nom-6.1.2}/build.rs | 0 .../doc/nom_recipes.md | 6 +- .../src/bits/complete.rs | 0 .../src/bits/macros.rs | 0 .../{nom-6.0.1 => nom-6.1.2}/src/bits/mod.rs | 0 .../src/bits/streaming.rs | 0 .../src/branch/macros.rs | 0 .../src/branch/mod.rs | 0 .../src/bytes/complete.rs | 0 .../src/bytes/macros.rs | 0 .../{nom-6.0.1 => nom-6.1.2}/src/bytes/mod.rs | 0 .../src/bytes/streaming.rs | 0 .../src/character/complete.rs | 0 .../src/character/macros.rs | 0 .../src/character/mod.rs | 0 .../src/character/streaming.rs | 0 .../src/combinator/macros.rs | 3 +- .../src/combinator/mod.rs | 5 +- .../{nom-6.0.1 => nom-6.1.2}/src/error.rs | 3 + .../{nom-6.0.1 => nom-6.1.2}/src/internal.rs | 10 + .../{nom-6.0.1 => nom-6.1.2}/src/lib.rs | 2 +- .../src/multi/macros.rs | 10 +- .../{nom-6.0.1 => nom-6.1.2}/src/multi/mod.rs | 84 +- .../src/number/complete.rs | 0 .../src/number/macros.rs | 0 .../src/number/mod.rs | 0 .../src/number/streaming.rs | 0 .../src/regexp/macros.rs | 0 .../src/regexp/mod.rs | 0 .../src/sequence/macros.rs | 4 +- .../src/sequence/mod.rs | 30 +- .../{nom-6.0.1 => nom-6.1.2}/src/str.rs | 0 .../{nom-6.0.1 => nom-6.1.2}/src/traits.rs | 0 .../{nom-6.0.1 => nom-6.1.2}/src/util.rs | 0 .../tests/arithmetic.rs | 0 .../tests/arithmetic_ast.rs | 0 .../tests/bitstream.rs | 0 .../tests/blockbuf-arithmetic.rs | 0 .../{nom-6.0.1 => nom-6.1.2}/tests/css.rs | 0 .../tests/custom_errors.rs | 0 .../{nom-6.0.1 => nom-6.1.2}/tests/escaped.rs | 0 .../{nom-6.0.1 => nom-6.1.2}/tests/float.rs | 0 .../{nom-6.0.1 => nom-6.1.2}/tests/fnmut.rs | 0 .../tests/inference.rs | 0 .../{nom-6.0.1 => nom-6.1.2}/tests/ini.rs | 0 .../{nom-6.0.1 => nom-6.1.2}/tests/ini_str.rs | 0 .../{nom-6.0.1 => nom-6.1.2}/tests/issues.rs | 0 .../{nom-6.0.1 => nom-6.1.2}/tests/json.rs | 0 .../{nom-6.0.1 => nom-6.1.2}/tests/mp4.rs | 0 .../tests/multiline.rs | 0 .../tests/named_args.rs | 0 .../tests/overflow.rs | 0 .../tests/reborrow_fold.rs | 0 .../{nom-6.0.1 => nom-6.1.2}/tests/test1.rs | 0 .../cargo/vendor/num_cpus-1.13.0/BUILD.bazel | 2 +- .../cargo/vendor/num_enum-0.4.3/BUILD.bazel | 2 +- .../vendor/num_enum_derive-0.4.3/BUILD.bazel | 6 +- .../once_cell-1.5.2/.cargo-checksum.json | 1 - .../once_cell-1.7.2/.cargo-checksum.json | 1 + .../BUILD.bazel | 3 +- .../CHANGELOG.md | 22 + .../Cargo.lock | 67 +- .../Cargo.toml | 5 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../README.md | 2 +- .../bors.toml | 0 .../examples/bench.rs | 0 .../examples/bench_acquire.rs | 0 .../examples/bench_vs_lazy_static.rs | 0 .../examples/lazy_static.rs | 0 .../examples/reentrant_init_deadlocks.rs | 0 .../examples/regex.rs | 0 .../examples/test_synchronization.rs | 0 .../src/imp_pl.rs | 45 +- .../src/imp_std.rs | 20 +- .../src/lib.rs | 45 +- .../src/race.rs | 61 +- .../tests/it.rs | 30 +- .../vendor/parking_lot-0.11.1/BUILD.bazel | 4 +- .../.cargo-checksum.json | 2 +- .../BUILD.bazel | 6 +- .../Cargo.toml | 6 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../src/lib.rs | 0 .../src/parking_lot.rs | 0 .../src/spinwait.rs | 0 .../src/thread_parker/generic.rs | 0 .../src/thread_parker/linux.rs | 0 .../src/thread_parker/mod.rs | 0 .../src/thread_parker/redox.rs | 0 .../src/thread_parker/sgx.rs | 0 .../src/thread_parker/unix.rs | 0 .../src/thread_parker/wasm.rs | 0 .../src/thread_parker/wasm_atomic.rs | 0 .../src/thread_parker/windows/keyed_event.rs | 0 .../src/thread_parker/windows/mod.rs | 0 .../src/thread_parker/windows/waitaddress.rs | 0 .../src/util.rs | 0 .../src/word_lock.rs | 0 .../proc-macro2-1.0.24/.cargo-checksum.json | 1 - .../proc-macro2-1.0.26/.cargo-checksum.json | 1 + .../BUILD.bazel | 4 +- .../Cargo.toml | 4 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../README.md | 0 .../build.rs | 0 .../src/detection.rs | 0 .../src/fallback.rs | 19 +- .../src/lib.rs | 39 +- .../src/marker.rs | 0 .../src/parse.rs | 191 +- .../src/wrapper.rs | 24 +- .../tests/comments.rs | 0 .../tests/features.rs | 0 .../tests/marker.rs | 0 .../tests/test.rs | 20 +- .../tests/test_fmt.rs | 0 .../.cargo-checksum.json | 2 +- .../{quote-1.0.8 => quote-1.0.9}/BUILD.bazel | 4 +- .../{quote-1.0.8 => quote-1.0.9}/Cargo.toml | 2 +- .../LICENSE-APACHE | 0 .../{quote-1.0.8 => quote-1.0.9}/LICENSE-MIT | 0 .../{quote-1.0.8 => quote-1.0.9}/README.md | 0 .../{quote-1.0.8 => quote-1.0.9}/src/ext.rs | 0 .../src/format.rs | 0 .../src/ident_fragment.rs | 0 .../{quote-1.0.8 => quote-1.0.9}/src/lib.rs | 9 +- .../src/runtime.rs | 0 .../src/spanned.rs | 0 .../src/to_tokens.rs | 0 .../tests/compiletest.rs | 0 .../tests/test.rs | 0 .../ui/does-not-have-iter-interpolated-dup.rs | 0 .../ui/does-not-have-iter-interpolated.rs | 0 .../tests/ui/does-not-have-iter-separated.rs | 0 .../tests/ui/does-not-have-iter.rs | 0 .../tests/ui/not-quotable.rs | 0 .../tests/ui/not-repeatable.rs | 0 .../tests/ui/wrong-type-span.rs | 0 .../raw-window-handle-0.3.3/BUILD.bazel | 2 +- .../cargo/vendor/rayon-core-1.9.0/BUILD.bazel | 2 +- .../redox_syscall-0.1.57/.cargo-checksum.json | 1 - .../redox_syscall-0.1.57/src/arch/x86_64.rs | 74 - .../vendor/redox_syscall-0.1.57/src/flag.rs | 169 -- .../vendor/redox_syscall-0.1.57/src/io/dma.rs | 76 - .../redox_syscall-0.1.57/src/io/mmio.rs | 31 - .../vendor/redox_syscall-0.1.57/src/tests.rs | 129 - .../redox_syscall-0.2.5/.cargo-checksum.json | 1 + .../BUILD.bazel | 5 +- .../Cargo.toml | 5 +- .../LICENSE | 0 .../README.md | 0 .../src/arch/aarch64.rs | 15 - .../src/arch/arm.rs | 11 - .../src/arch/nonredox.rs | 5 - .../src/arch/x86.rs | 11 - .../redox_syscall-0.2.5/src/arch/x86_64.rs | 130 + .../src/call.rs | 93 +- .../src/data.rs | 188 +- .../src/error.rs | 2 +- .../vendor/redox_syscall-0.2.5/src/flag.rs | 345 +++ .../vendor/redox_syscall-0.2.5/src/io/dma.rs | 200 ++ .../src/io/io.rs | 0 .../vendor/redox_syscall-0.2.5/src/io/mmio.rs | 45 + .../src/io/mod.rs | 0 .../src/io/pio.rs | 0 .../src/lib.rs | 13 +- .../src/number.rs | 44 +- .../src/scheme/generate.sh | 5 +- .../src/scheme/mod.rs | 9 + .../src/scheme/scheme.rs | 86 +- .../src/scheme/scheme_block.rs | 86 +- .../src/scheme/scheme_block_mut.rs | 86 +- .../src/scheme/scheme_mut.rs | 86 +- .../redox_syscall-0.2.5/src/scheme/seek.rs | 33 + .../vendor/redox_syscall-0.2.5/src/tests.rs | 467 ++++ .../vendor/regex-1.4.2/.cargo-checksum.json | 1 - .../cargo/vendor/regex-1.4.2/src/cache.rs | 100 - .../vendor/regex-1.4.5/.cargo-checksum.json | 1 + .../{regex-1.4.2 => regex-1.4.5}/BUILD.bazel | 6 +- .../{regex-1.4.2 => regex-1.4.5}/CHANGELOG.md | 42 + .../cargo/vendor/regex-1.4.5/Cargo.lock | 98 + .../{regex-1.4.2 => regex-1.4.5}/Cargo.toml | 16 +- .../{regex-1.4.2 => regex-1.4.5}/HACKING.md | 0 .../LICENSE-APACHE | 0 .../{regex-1.4.2 => regex-1.4.5}/LICENSE-MIT | 0 .../PERFORMANCE.md | 0 .../{regex-1.4.2 => regex-1.4.5}/README.md | 6 +- .../{regex-1.4.2 => regex-1.4.5}/UNICODE.md | 34 +- .../examples/regexdna-input.txt | 0 .../examples/regexdna-output.txt | 0 .../examples/shootout-regex-dna-bytes.rs | 2 +- .../examples/shootout-regex-dna-cheat.rs | 2 +- .../examples/shootout-regex-dna-replace.rs | 0 .../shootout-regex-dna-single-cheat.rs | 2 +- .../examples/shootout-regex-dna-single.rs | 2 +- .../examples/shootout-regex-dna.rs | 2 +- .../rustfmt.toml | 0 .../src/backtrack.rs | 4 +- .../src/compile.rs | 11 + .../{regex-1.4.2 => regex-1.4.5}/src/dfa.rs | 20 +- .../{regex-1.4.2 => regex-1.4.5}/src/error.rs | 0 .../{regex-1.4.2 => regex-1.4.5}/src/exec.rs | 46 +- .../src/expand.rs | 3 +- .../src/find_byte.rs | 0 .../{regex-1.4.2 => regex-1.4.5}/src/freqs.rs | 0 .../{regex-1.4.2 => regex-1.4.5}/src/input.rs | 0 .../{regex-1.4.2 => regex-1.4.5}/src/lib.rs | 19 +- .../src/literal/imp.rs | 3 +- .../src/literal/mod.rs | 0 .../src/pattern.rs | 0 .../src/pikevm.rs | 0 .../cargo/vendor/regex-1.4.5/src/pool.rs | 333 +++ .../{regex-1.4.2 => regex-1.4.5}/src/prog.rs | 0 .../src/re_builder.rs | 2 + .../src/re_bytes.rs | 90 +- .../src/re_set.rs | 9 +- .../src/re_trait.rs | 27 +- .../src/re_unicode.rs | 90 +- .../src/sparse.rs | 2 +- .../src/testdata/LICENSE | 0 .../src/testdata/README | 0 .../src/testdata/basic.dat | 0 .../src/testdata/nullsubexpr.dat | 0 .../src/testdata/repetition.dat | 0 .../{regex-1.4.2 => regex-1.4.5}/src/utf8.rs | 0 .../vendor/{regex-1.4.2 => regex-1.4.5}/test | 0 .../{regex-1.4.2 => regex-1.4.5}/tests/api.rs | 0 .../tests/api_str.rs | 0 .../tests/bytes.rs | 0 .../tests/consistent.rs | 5 +- .../tests/crates_regex.rs | 0 .../tests/crazy.rs | 5 +- .../tests/flags.rs | 0 .../tests/fowler.rs | 0 .../tests/macros.rs | 0 .../tests/macros_bytes.rs | 1 - .../tests/macros_str.rs | 1 + .../tests/misc.rs | 0 .../tests/multiline.rs | 0 .../tests/noparse.rs | 0 .../tests/regression.rs | 0 .../tests/regression_fuzz.rs | 0 .../tests/replace.rs | 98 + .../tests/searcher.rs | 0 .../{regex-1.4.2 => regex-1.4.5}/tests/set.rs | 0 .../tests/shortest_match.rs | 0 .../tests/suffix_reverse.rs | 0 .../tests/test_backtrack.rs | 0 .../tests/test_backtrack_bytes.rs | 0 .../tests/test_backtrack_utf8bytes.rs | 0 .../tests/test_crates_regex.rs | 0 .../tests/test_default.rs | 42 +- .../tests/test_default_bytes.rs | 0 .../tests/test_nfa.rs | 0 .../tests/test_nfa_bytes.rs | 0 .../tests/test_nfa_utf8bytes.rs | 0 .../tests/unicode.rs | 0 .../tests/word_boundary.rs | 0 .../tests/word_boundary_ascii.rs | 0 .../tests/word_boundary_unicode.rs | 0 .../.cargo-checksum.json | 2 +- .../BUILD.bazel | 2 +- .../Cargo.toml | 2 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../README.md | 0 .../benches/bench.rs | 0 .../src/ast/mod.rs | 0 .../src/ast/parse.rs | 0 .../src/ast/print.rs | 0 .../src/ast/visitor.rs | 0 .../src/either.rs | 0 .../src/error.rs | 0 .../src/hir/interval.rs | 0 .../src/hir/literal/mod.rs | 0 .../src/hir/mod.rs | 0 .../src/hir/print.rs | 0 .../src/hir/translate.rs | 0 .../src/hir/visitor.rs | 0 .../src/lib.rs | 5 +- .../src/parser.rs | 0 .../src/unicode.rs | 2 +- .../src/unicode_tables/LICENSE-UNICODE | 0 .../src/unicode_tables/age.rs | 0 .../src/unicode_tables/case_folding_simple.rs | 0 .../src/unicode_tables/general_category.rs | 0 .../unicode_tables/grapheme_cluster_break.rs | 0 .../src/unicode_tables/mod.rs | 0 .../src/unicode_tables/perl_decimal.rs | 0 .../src/unicode_tables/perl_space.rs | 0 .../src/unicode_tables/perl_word.rs | 0 .../src/unicode_tables/property_bool.rs | 0 .../src/unicode_tables/property_names.rs | 0 .../src/unicode_tables/property_values.rs | 0 .../src/unicode_tables/script.rs | 0 .../src/unicode_tables/script_extension.rs | 0 .../src/unicode_tables/sentence_break.rs | 0 .../src/unicode_tables/word_break.rs | 0 .../src/utf8.rs | 16 +- .../test | 0 .../vendor/serde-1.0.118/.cargo-checksum.json | 1 - .../serde-1.0.118/src/de/from_primitive.rs | 260 -- .../vendor/serde-1.0.118/src/private/mod.rs | 4 - .../vendor/serde-1.0.125/.cargo-checksum.json | 1 + .../BUILD.bazel | 2 +- .../Cargo.toml | 4 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../README.md | 0 .../{serde-1.0.118 => serde-1.0.125}/build.rs | 9 +- .../crates-io.md | 0 .../src/de/ignored_any.rs | 16 + .../src/de/impls.rs | 483 ++-- .../src/de/mod.rs | 3 +- .../cargo/vendor/serde-1.0.125/src/de/seed.rs | 19 + .../src/de/utf8.rs | 0 .../src/de/value.rs | 202 +- .../src/integer128.rs | 2 +- .../src/lib.rs | 29 +- .../src/macros.rs | 2 +- .../src/private/de.rs | 209 +- .../src/private/doc.rs} | 47 +- .../src/private/mod.rs} | 12 +- .../src/private/ser.rs | 28 - .../serde-1.0.125/src/private/size_hint.rs | 21 + .../src/ser/fmt.rs | 0 .../src/ser/impls.rs | 55 +- .../src/ser/impossible.rs | 2 +- .../src/ser/mod.rs | 2 +- .../src/std_error.rs | 0 .../vendor/shared_library-0.1.9/BUILD.bazel | 2 +- .../smallvec-1.6.0/.cargo-checksum.json | 1 - .../smallvec-1.6.1/.cargo-checksum.json | 1 + .../BUILD.bazel | 2 +- .../Cargo.toml | 2 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../README.md | 0 .../benches/bench.rs | 0 .../scripts/run_miri.sh | 0 .../src/lib.rs | 48 +- .../src/specialization.rs | 0 .../src/tests.rs | 13 + .../tests/macro.rs | 0 .../.cargo-checksum.json | 2 +- .../BUILD.bazel | 10 +- .../CHANGELOG.md | 6 + .../CONTRIBUTING.md | 0 .../Cargo.lock | 2 +- .../Cargo.toml | 2 +- .../LICENSE.txt | 0 .../README.md | 0 .../doc_index.html | 0 .../examples/compositor_info.rs | 0 .../examples/image_viewer.rs | 0 .../examples/kbd_input.rs | 0 .../examples/layer_shell.rs | 0 .../examples/pointer_input.rs | 0 .../examples/selection.rs | 0 .../examples/themed_frame.rs | 0 .../rustfmt.toml | 0 .../src/data_device/device.rs | 0 .../src/data_device/mod.rs | 0 .../src/data_device/offer.rs | 0 .../src/data_device/source.rs | 0 .../src/environment.rs | 0 .../src/event_loop.rs | 0 .../src/lazy_global.rs | 0 .../src/lib.rs | 0 .../src/output.rs | 0 .../src/primary_selection/device.rs | 0 .../src/primary_selection/mod.rs | 0 .../src/primary_selection/offer.rs | 0 .../src/primary_selection/source.rs | 0 .../src/seat/keyboard/ffi.rs | 0 .../src/seat/keyboard/keysyms.rs | 0 .../src/seat/keyboard/mod.rs | 0 .../src/seat/keyboard/state.rs | 0 .../src/seat/mod.rs | 0 .../src/seat/pointer/mod.rs | 0 .../src/seat/pointer/theme.rs | 0 .../src/shell/mod.rs | 0 .../src/shell/wl.rs | 0 .../src/shell/xdg.rs | 0 .../src/shell/zxdg.rs | 0 .../src/shm/mempool.rs | 0 .../src/shm/mod.rs | 0 .../src/surface.rs | 0 .../src/window/concept_frame.rs | 0 .../src/window/mod.rs | 14 + .../travis_install_wayland.sh | 0 .../update_keysyms.sh | 0 .../.cargo-checksum.json | 2 +- .../{syn-1.0.58 => syn-1.0.68}/BUILD.bazel | 6 +- .../{syn-1.0.58 => syn-1.0.68}/Cargo.toml | 4 +- .../{syn-1.0.58 => syn-1.0.68}/LICENSE-APACHE | 0 .../{serde-1.0.118 => syn-1.0.68}/LICENSE-MIT | 0 .../{syn-1.0.58 => syn-1.0.68}/README.md | 0 .../benches/file.rs | 0 .../benches/rust.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/build.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/attr.rs | 2 +- .../{syn-1.0.58 => syn-1.0.68}/src/await.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/bigint.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/buffer.rs | 0 .../src/custom_keyword.rs | 1 + .../src/custom_punctuation.rs | 1 + .../{syn-1.0.58 => syn-1.0.68}/src/data.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/derive.rs | 0 .../src/discouraged.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/error.rs | 2 +- .../{syn-1.0.58 => syn-1.0.68}/src/export.rs | 2 + .../{syn-1.0.58 => syn-1.0.68}/src/expr.rs | 236 +- .../{syn-1.0.58 => syn-1.0.68}/src/ext.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/file.rs | 0 .../src/gen/clone.rs | 0 .../src/gen/debug.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/gen/eq.rs | 0 .../src/gen/fold.rs | 0 .../src/gen/hash.rs | 0 .../src/gen/visit.rs | 0 .../src/gen/visit_mut.rs | 0 .../src/gen_helper.rs | 0 .../src/generics.rs | 12 +- .../{syn-1.0.58 => syn-1.0.68}/src/group.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/ident.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/item.rs | 184 +- .../{syn-1.0.58 => syn-1.0.68}/src/lib.rs | 16 +- .../src/lifetime.rs | 11 + .../{syn-1.0.58 => syn-1.0.68}/src/lit.rs | 18 + .../src/lookahead.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/mac.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/macros.rs | 16 +- .../{syn-1.0.58 => syn-1.0.68}/src/op.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/parse.rs | 0 .../src/parse_macro_input.rs | 0 .../src/parse_quote.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/pat.rs | 31 +- .../{syn-1.0.58 => syn-1.0.68}/src/path.rs | 108 +- .../{syn-1.0.58 => syn-1.0.68}/src/print.rs | 0 .../src/punctuated.rs | 23 +- .../src/reserved.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/sealed.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/span.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/spanned.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/stmt.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/thread.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/token.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/tt.rs | 0 .../{syn-1.0.58 => syn-1.0.68}/src/ty.rs | 45 +- .../src/verbatim.rs | 0 .../src/whitespace.rs | 0 .../tests/.gitignore | 0 .../tests/common/eq.rs | 145 +- .../tests/common/mod.rs | 0 .../tests/common/parse.rs | 0 .../tests/debug/gen.rs | 0 .../tests/debug/mod.rs | 0 .../tests/macros/mod.rs | 0 .../tests/repo/mod.rs | 4 +- .../tests/repo/progress.rs | 0 .../tests/test_asyncness.rs | 0 .../tests/test_attribute.rs | 0 .../tests/test_derive_input.rs | 0 .../tests/test_expr.rs | 0 .../tests/test_generics.rs | 0 .../tests/test_grouping.rs | 0 .../tests/test_ident.rs | 0 .../tests/test_item.rs | 109 +- .../tests/test_iterators.rs | 0 .../tests/test_lit.rs | 0 .../tests/test_meta.rs | 0 .../tests/test_parse_buffer.rs | 0 .../tests/test_parse_stream.rs | 0 .../tests/test_pat.rs | 10 +- .../tests/test_path.rs | 0 .../tests/test_precedence.rs | 13 +- .../tests/test_receiver.rs | 0 .../tests/test_round_trip.rs | 0 .../tests/test_shebang.rs | 0 .../tests/test_should_parse.rs | 0 .../tests/test_size.rs | 0 .../tests/test_stmt.rs | 0 .../tests/test_token_trees.rs | 0 .../tests/test_ty.rs | 0 .../tests/test_visibility.rs | 0 .../tests/zzz_stable.rs | 0 .../tests/ui/no-display.stderr | 12 - .../.cargo-checksum.json | 2 +- .../BUILD.bazel | 4 +- .../Cargo.toml | 4 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../README.md | 0 .../src/aserror.rs | 0 .../src/display.rs | 0 .../src/lib.rs | 2 + .../tests/compiletest.rs | 0 .../tests/test_backtrace.rs | 0 .../tests/test_deprecated.rs | 0 .../tests/test_display.rs | 0 .../tests/test_error.rs | 0 .../tests/test_expr.rs | 0 .../tests/test_from.rs | 0 .../tests/test_lints.rs | 0 .../tests/test_option.rs | 0 .../tests/test_path.rs | 0 .../tests/test_source.rs | 13 + .../tests/test_transparent.rs | 0 .../tests/ui/bad-field-attr.rs | 0 .../tests/ui/bad-field-attr.stderr | 0 .../tests/ui/concat-display.rs | 0 .../tests/ui/concat-display.stderr | 0 .../tests/ui/duplicate-enum-source.rs | 0 .../tests/ui/duplicate-enum-source.stderr | 0 .../tests/ui/duplicate-fmt.rs | 0 .../tests/ui/duplicate-fmt.stderr | 0 .../tests/ui/duplicate-struct-source.rs | 0 .../tests/ui/duplicate-struct-source.stderr | 0 .../tests/ui/duplicate-transparent.rs | 0 .../tests/ui/duplicate-transparent.stderr | 0 .../tests/ui/from-not-source.rs | 0 .../tests/ui/from-not-source.stderr | 0 .../tests/ui/lifetime.rs | 0 .../tests/ui/lifetime.stderr | 0 .../tests/ui/missing-fmt.rs | 0 .../tests/ui/missing-fmt.stderr | 0 .../tests/ui/no-display.rs | 0 .../tests/ui/no-display.stderr | 12 + .../tests/ui/source-enum-not-error.rs | 0 .../tests/ui/source-enum-not-error.stderr | 6 +- .../tests/ui/source-struct-not-error.rs | 0 .../tests/ui/source-struct-not-error.stderr | 6 +- .../tests/ui/transparent-display.rs | 0 .../tests/ui/transparent-display.stderr | 0 .../tests/ui/transparent-enum-many.rs | 0 .../tests/ui/transparent-enum-many.stderr | 0 .../tests/ui/transparent-enum-source.rs | 0 .../tests/ui/transparent-enum-source.stderr | 0 .../tests/ui/transparent-struct-many.rs | 0 .../tests/ui/transparent-struct-many.stderr | 0 .../tests/ui/transparent-struct-source.rs | 0 .../tests/ui/transparent-struct-source.stderr | 0 .../tests/ui/unexpected-field-fmt.rs | 0 .../tests/ui/unexpected-field-fmt.stderr | 0 .../tests/ui/unexpected-struct-source.rs | 0 .../tests/ui/unexpected-struct-source.stderr | 0 .../tests/ui/union.rs | 0 .../tests/ui/union.stderr | 0 .../.cargo-checksum.json | 1 - .../vendor/thiserror-impl-1.0.23/LICENSE-MIT | 23 - .../.cargo-checksum.json | 1 + .../BUILD.bazel | 8 +- .../Cargo.toml | 2 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../src/ast.rs | 0 .../src/attr.rs | 0 .../src/expand.rs | 12 +- .../src/fmt.rs | 0 .../src/lib.rs | 11 +- .../src/prop.rs | 0 .../src/valid.rs | 4 +- .../thread_local-1.1.0/.cargo-checksum.json | 1 - .../vendor/thread_local-1.1.0/BUILD.bazel | 56 - .../vendor/thread_local-1.1.0/Cargo.toml | 37 - .../vendor/thread_local-1.1.0/LICENSE-MIT | 25 - .../cargo/vendor/thread_local-1.1.0/README.md | 45 - .../benches/thread_local.rs | 28 - .../vendor/thread_local-1.1.0/src/cached.rs | 161 -- .../vendor/thread_local-1.1.0/src/lib.rs | 508 ---- .../thread_local-1.1.0/src/thread_id.rs | 127 - .../thread_local-1.1.0/src/unreachable.rs | 57 - .../cargo/vendor/tiff-0.6.1/BUILD.bazel | 8 +- .../cargo/vendor/toml-0.5.8/BUILD.bazel | 2 +- .../vendor/version_check-0.9.2/LICENSE-APACHE | 201 -- .../.cargo-checksum.json | 2 +- .../BUILD.bazel | 2 +- .../Cargo.toml | 2 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../README.md | 0 .../src/channel.rs | 0 .../src/date.rs | 0 .../src/lib.rs | 146 +- .../src/version.rs | 0 .../cargo/vendor/vulkano-0.20.0/BUILD.bazel | 4 +- .../vendor/walkdir-2.3.1/.cargo-checksum.json | 1 - .../vendor/walkdir-2.3.2/.cargo-checksum.json | 1 + .../BUILD.bazel | 2 +- .../{walkdir-2.3.1 => walkdir-2.3.2}/COPYING | 0 .../Cargo.toml | 2 +- .../LICENSE-MIT | 0 .../README.md | 4 +- .../UNLICENSE | 0 .../compare/nftw.c | 0 .../compare/walk.py | 0 .../cargo/vendor/walkdir-2.3.2/rustfmt.toml | 2 + .../src/dent.rs | 0 .../src/error.rs | 2 +- .../src/lib.rs | 42 +- .../src/tests/mod.rs | 0 .../src/tests/recursive.rs | 45 +- .../src/tests/util.rs | 0 .../src/util.rs | 0 .../.cargo-checksum.json | 2 +- .../BUILD.bazel | 16 +- .../Cargo.lock | 96 +- .../Cargo.toml | 10 +- .../LICENSE.txt | 0 .../README.md | 0 .../build.rs | 0 .../examples/dynamic_globals.rs | 0 .../examples/list_globals.rs | 0 .../examples/simple_window.rs | 58 +- .../src/display.rs | 2 + .../src/event_queue.rs | 0 .../src/globals.rs | 0 .../src/lib.rs | 0 .../src/native_lib/display.rs | 0 .../src/native_lib/event_queue.rs | 0 .../src/native_lib/mod.rs | 0 .../src/native_lib/proxy.rs | 45 +- .../src/proxy.rs | 0 .../src/rust_imp/connection.rs | 0 .../src/rust_imp/display.rs | 0 .../src/rust_imp/mod.rs | 0 .../src/rust_imp/proxy.rs | 0 .../src/rust_imp/queues.rs | 0 .../wayland.xml | 0 .../.cargo-checksum.json | 1 - .../.cargo-checksum.json | 1 + .../BUILD.bazel | 10 +- .../Cargo.lock | 30 +- .../Cargo.toml | 8 +- .../LICENSE.txt | 0 .../README.md | 0 .../examples/manual_global_list.rs | 0 .../src/debug.rs | 0 .../src/filter.rs | 0 .../src/lib.rs | 6 + .../src/map.rs | 4 + .../src/socket.rs | 3 + .../src/user_data.rs | 0 .../src/wire.rs | 6 +- .../.cargo-checksum.json | 1 - .../.cargo-checksum.json | 1 + .../BUILD.bazel | 6 +- .../Cargo.toml | 8 +- .../LICENSE.txt | 0 .../README.md | 0 .../src/lib.rs | 18 +- .../.cargo-checksum.json | 2 +- .../BUILD.bazel | 10 +- .../Cargo.toml | 10 +- .../LICENSE.txt | 0 .../README.md | 0 .../build.rs | 0 .../misc/gtk-primary-selection.xml | 0 .../protocols/COPYING | 0 .../protocols/GOVERNANCE.md | 0 .../protocols/MEMBERS.md | 0 .../protocols/Makefile.am | 0 .../protocols/README.md | 0 .../protocols/autogen.sh | 0 .../protocols/configure.ac | 0 .../protocols/m4/compat.m4 | 0 .../protocols/stable/presentation-time/README | 0 .../presentation-time/presentation-time.xml | 0 .../protocols/stable/viewporter/README | 0 .../stable/viewporter/viewporter.xml | 0 .../protocols/stable/xdg-shell/README | 0 .../protocols/stable/xdg-shell/xdg-shell.xml | 0 .../protocols/tests/scan.sh | 0 .../unstable/fullscreen-shell/README | 0 .../fullscreen-shell-unstable-v1.xml | 0 .../protocols/unstable/idle-inhibit/README | 0 .../idle-inhibit/idle-inhibit-unstable-v1.xml | 0 .../protocols/unstable/input-method/README | 0 .../input-method/input-method-unstable-v1.xml | 0 .../unstable/input-timestamps/README | 0 .../input-timestamps-unstable-v1.xml | 0 .../keyboard-shortcuts-inhibit/README | 0 ...keyboard-shortcuts-inhibit-unstable-v1.xml | 0 .../protocols/unstable/linux-dmabuf/README | 0 .../linux-dmabuf/linux-dmabuf-unstable-v1.xml | 0 .../linux-explicit-synchronization/README | 0 ...x-explicit-synchronization-unstable-v1.xml | 0 .../unstable/pointer-constraints/README | 0 .../pointer-constraints-unstable-v1.xml | 0 .../unstable/pointer-gestures/README | 0 .../pointer-gestures-unstable-v1.xml | 0 .../unstable/primary-selection/README | 0 .../primary-selection-unstable-v1.xml | 0 .../unstable/relative-pointer/README | 0 .../relative-pointer-unstable-v1.xml | 0 .../protocols/unstable/tablet/README | 0 .../unstable/tablet/tablet-unstable-v1.xml | 0 .../unstable/tablet/tablet-unstable-v2.xml | 0 .../protocols/unstable/text-input/README | 0 .../text-input/text-input-unstable-v1.xml | 0 .../text-input/text-input-unstable-v3.xml | 0 .../protocols/unstable/xdg-decoration/README | 0 .../xdg-decoration-unstable-v1.xml | 0 .../protocols/unstable/xdg-foreign/README | 0 .../xdg-foreign/xdg-foreign-unstable-v1.xml | 0 .../xdg-foreign/xdg-foreign-unstable-v2.xml | 0 .../protocols/unstable/xdg-output/README | 0 .../xdg-output/xdg-output-unstable-v1.xml | 0 .../protocols/unstable/xdg-shell/README | 0 .../xdg-shell/xdg-shell-unstable-v5.xml | 0 .../xdg-shell/xdg-shell-unstable-v6.xml | 0 .../unstable/xwayland-keyboard-grab/README | 0 .../xwayland-keyboard-grab-unstable-v1.xml | 0 .../wayland-protocols-uninstalled.pc.in | 0 .../protocols/wayland-protocols.pc.in | 0 .../src/lib.rs | 0 .../src/misc.rs | 0 .../src/protocol_macro.rs | 0 .../src/stable.rs | 0 .../src/unstable.rs | 0 .../src/wlr.rs | 0 .../wlr-protocols/Makefile | 0 .../wlr-protocols/README.md | 0 .../wlr-protocols/check.sh | 0 .../unstable/wlr-data-control-unstable-v1.xml | 0 .../wlr-export-dmabuf-unstable-v1.xml | 0 ...oreign-toplevel-management-unstable-v1.xml | 0 .../wlr-gamma-control-unstable-v1.xml | 0 .../wlr-input-inhibitor-unstable-v1.xml | 0 .../unstable/wlr-layer-shell-unstable-v1.xml | 0 .../wlr-output-management-unstable-v1.xml | 0 ...lr-output-power-management-unstable-v1.xml | 0 .../unstable/wlr-screencopy-unstable-v1.xml | 0 .../wlr-virtual-pointer-unstable-v1.xml | 0 .../wlr-protocols/wlr-protocols.pc.in | 0 .../.cargo-checksum.json | 2 +- .../BUILD.bazel | 6 +- .../Cargo.toml | 4 +- .../LICENSE.txt | 0 .../README.md | 0 .../src/c_code_gen.rs | 0 .../src/c_interface_gen.rs | 0 .../src/common_gen.rs | 2 +- .../src/lib.rs | 0 .../src/parse.rs | 0 .../src/protocol.rs | 0 .../src/side.rs | 0 .../src/util.rs | 0 .../wayland-sys-0.28.3/.cargo-checksum.json | 1 - .../wayland-sys-0.28.5/.cargo-checksum.json | 1 + .../BUILD.bazel | 4 +- .../Cargo.toml | 10 +- .../vendor/wayland-sys-0.28.5/LICENSE.txt | 19 + .../README.md | 0 .../build.rs | 0 .../src/client.rs | 4 +- .../src/common.rs | 0 .../src/cursor.rs | 4 +- .../src/egl.rs | 4 +- .../src/lib.rs | 0 .../src/server.rs | 4 +- .../vendor/weezl-0.1.3/.cargo-checksum.json | 1 - .../cargo/vendor/weezl-0.1.3/Cargo.lock | 616 ----- .../vendor/weezl-0.1.4/.cargo-checksum.json | 1 + .../{weezl-0.1.3 => weezl-0.1.4}/BUILD.bazel | 6 +- .../cargo/vendor/weezl-0.1.4/Cargo.lock | 854 ++++++ .../{weezl-0.1.3 => weezl-0.1.4}/Cargo.toml | 22 +- .../{weezl-0.1.3 => weezl-0.1.4}/Changes.md | 8 + .../LICENSE-APACHE | 0 .../{weezl-0.1.3 => weezl-0.1.4}/LICENSE-MIT | 0 .../{weezl-0.1.3 => weezl-0.1.4}/README.md | 0 .../benches/msb8.rs | 0 .../{weezl-0.1.3 => weezl-0.1.4}/bin/lzw.rs | 0 .../examples/lzw-compress.rs | 0 .../examples/lzw-decompress.rs | 0 .../src/decode.rs | 41 +- .../weezl-0.1.4/src/decode_into_async.rs | 143 + .../src/encode.rs | 35 +- .../weezl-0.1.4/src/encode_into_async.rs | 142 + .../{weezl-0.1.3 => weezl-0.1.4}/src/error.rs | 0 .../{weezl-0.1.3 => weezl-0.1.4}/src/lib.rs | 11 +- .../cargo/vendor/weezl-0.1.4/tests/async.rs | 48 + .../tests/roundtrip.rs | 11 +- .../cargo/vendor/winapi-0.3.9/BUILD.bazel | 62 +- .../cargo/vendor/winit-0.24.0/BUILD.bazel | 12 +- .../cargo/vendor/x11-dl-2.18.5/BUILD.bazel | 2 +- .../cargo/vendor/xcursor-0.3.3/BUILD.bazel | 2 +- 1666 files changed, 28052 insertions(+), 17945 deletions(-) delete mode 100644 third_party/cargo/vendor/adler-0.2.3/.cargo-checksum.json create mode 100644 third_party/cargo/vendor/adler-1.0.2/.cargo-checksum.json rename third_party/cargo/vendor/{adler-0.2.3 => adler-1.0.2}/BUILD.bazel (97%) rename third_party/cargo/vendor/{adler-0.2.3 => adler-1.0.2}/CHANGELOG.md (52%) rename third_party/cargo/vendor/{adler-0.2.3 => adler-1.0.2}/Cargo.toml (90%) rename third_party/cargo/vendor/{adler-0.2.3 => adler-1.0.2}/LICENSE-0BSD (100%) rename third_party/cargo/vendor/{adler-0.2.3 => adler-1.0.2}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{adler-0.2.3 => adler-1.0.2}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{adler-0.2.3 => adler-1.0.2}/README.md (94%) rename third_party/cargo/vendor/{adler-0.2.3 => adler-1.0.2}/RELEASE_PROCESS.md (100%) rename third_party/cargo/vendor/{adler-0.2.3 => adler-1.0.2}/benches/bench.rs (100%) rename third_party/cargo/vendor/{adler-0.2.3 => adler-1.0.2}/src/algo.rs (100%) rename third_party/cargo/vendor/{adler-0.2.3 => adler-1.0.2}/src/lib.rs (75%) delete mode 100644 third_party/cargo/vendor/bytemuck-1.4.1/.cargo-checksum.json create mode 100644 third_party/cargo/vendor/bytemuck-1.5.1/.cargo-checksum.json rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/BUILD.bazel (98%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/Cargo.toml (98%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/LICENSE-APACHE (99%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/LICENSE-MIT (99%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/LICENSE-ZLIB (98%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/README.md (97%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/changelog.md (78%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/rustfmt.toml (95%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/src/allocation.rs (73%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/src/contiguous.rs (97%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/src/lib.rs (94%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/src/offset_of.rs (97%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/src/pod.rs (97%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/src/transparent.rs (97%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/src/zeroable.rs (96%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/tests/cast_slice_tests.rs (97%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/tests/derive.rs (94%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/tests/doc_tests.rs (96%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/tests/offset_of_tests.rs (96%) rename third_party/cargo/vendor/{bytemuck-1.4.1 => bytemuck-1.5.1}/tests/std_tests.rs (62%) delete mode 100644 third_party/cargo/vendor/byteorder-1.3.4/.cargo-checksum.json delete mode 100644 third_party/cargo/vendor/byteorder-1.3.4/build.rs create mode 100644 third_party/cargo/vendor/byteorder-1.4.3/.cargo-checksum.json rename third_party/cargo/vendor/{byteorder-1.3.4 => byteorder-1.4.3}/BUILD.bazel (90%) rename third_party/cargo/vendor/{byteorder-1.3.4 => byteorder-1.4.3}/CHANGELOG.md (87%) rename third_party/cargo/vendor/{byteorder-1.3.4 => byteorder-1.4.3}/COPYING (100%) rename third_party/cargo/vendor/{byteorder-1.3.4 => byteorder-1.4.3}/Cargo.toml (84%) rename third_party/cargo/vendor/{byteorder-1.3.4 => byteorder-1.4.3}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{byteorder-1.3.4 => byteorder-1.4.3}/README.md (81%) rename third_party/cargo/vendor/{byteorder-1.3.4 => byteorder-1.4.3}/UNLICENSE (100%) rename third_party/cargo/vendor/{byteorder-1.3.4 => byteorder-1.4.3}/benches/bench.rs (62%) rename third_party/cargo/vendor/{regex-1.4.2 => byteorder-1.4.3}/rustfmt.toml (100%) rename third_party/cargo/vendor/{byteorder-1.3.4 => byteorder-1.4.3}/src/io.rs (96%) rename third_party/cargo/vendor/{byteorder-1.3.4 => byteorder-1.4.3}/src/lib.rs (74%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/.cargo-checksum.json (63%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/BUILD.bazel (97%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/Cargo.lock (99%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/Cargo.toml (98%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/README.md (92%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/src/bin/gcc-shim.rs (100%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/src/com.rs (100%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/src/lib.rs (98%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/src/registry.rs (100%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/src/setup_config.rs (100%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/src/winapi.rs (100%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/src/windows_registry.rs (100%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/tests/cc_env.rs (100%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/tests/cflags.rs (100%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/tests/cxxflags.rs (100%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/tests/support/mod.rs (100%) rename third_party/cargo/vendor/{cc-1.0.66 => cc-1.0.67}/tests/test.rs (100%) delete mode 100644 third_party/cargo/vendor/const_fn-0.4.5/.cargo-checksum.json delete mode 100644 third_party/cargo/vendor/const_fn-0.4.5/BUILD.bazel delete mode 100644 third_party/cargo/vendor/const_fn-0.4.5/CHANGELOG.md delete mode 100644 third_party/cargo/vendor/const_fn-0.4.5/Cargo.toml delete mode 100644 third_party/cargo/vendor/const_fn-0.4.5/LICENSE-APACHE delete mode 100644 third_party/cargo/vendor/const_fn-0.4.5/README.md delete mode 100644 third_party/cargo/vendor/const_fn-0.4.5/build.rs delete mode 100644 third_party/cargo/vendor/const_fn-0.4.5/src/ast.rs delete mode 100644 third_party/cargo/vendor/const_fn-0.4.5/src/error.rs delete mode 100644 third_party/cargo/vendor/const_fn-0.4.5/src/iter.rs delete mode 100644 third_party/cargo/vendor/const_fn-0.4.5/src/lib.rs delete mode 100644 third_party/cargo/vendor/const_fn-0.4.5/src/to_tokens.rs delete mode 100644 third_party/cargo/vendor/const_fn-0.4.5/src/utils.rs delete mode 100644 third_party/cargo/vendor/crossbeam-epoch-0.9.1/.cargo-checksum.json delete mode 100644 third_party/cargo/vendor/crossbeam-epoch-0.9.1/Cargo.lock delete mode 100644 third_party/cargo/vendor/crossbeam-epoch-0.9.1/examples/treiber_stack.rs delete mode 100644 third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/lib.rs delete mode 100644 third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/sync/mod.rs create mode 100644 third_party/cargo/vendor/crossbeam-epoch-0.9.3/.cargo-checksum.json rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/BUILD.bazel (82%) rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/CHANGELOG.md (86%) rename third_party/cargo/vendor/{regex-1.4.2 => crossbeam-epoch-0.9.3}/Cargo.lock (50%) rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/Cargo.toml (85%) rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/README.md (93%) rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/benches/defer.rs (100%) rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/benches/flush.rs (100%) rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/benches/pin.rs (100%) rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/examples/sanitize.rs (96%) rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/src/atomic.rs (84%) rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/src/collector.rs (96%) rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/src/default.rs (95%) rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/src/deferred.rs (96%) rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/src/epoch.rs (61%) rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/src/guard.rs (100%) rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/src/internal.rs (90%) create mode 100644 third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/lib.rs rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/src/sync/list.rs (95%) create mode 100644 third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/sync/mod.rs rename third_party/cargo/vendor/{crossbeam-epoch-0.9.1 => crossbeam-epoch-0.9.3}/src/sync/queue.rs (90%) create mode 100644 third_party/cargo/vendor/crossbeam-epoch-0.9.3/tests/loom.rs delete mode 100644 third_party/cargo/vendor/crossbeam-utils-0.8.1/.cargo-checksum.json delete mode 100644 third_party/cargo/vendor/crossbeam-utils-0.8.1/src/lib.rs create mode 100644 third_party/cargo/vendor/crossbeam-utils-0.8.3/.cargo-checksum.json rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/BUILD.bazel (98%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/CHANGELOG.md (91%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/Cargo.toml (91%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/README.md (97%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/benches/atomic_cell.rs (93%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/build.rs (100%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/src/atomic/atomic_cell.rs (97%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/src/atomic/consume.rs (86%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/src/atomic/mod.rs (80%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/src/atomic/seq_lock.rs (89%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/src/atomic/seq_lock_wide.rs (93%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/src/backoff.rs (91%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/src/cache_padded.rs (65%) create mode 100644 third_party/cargo/vendor/crossbeam-utils-0.8.3/src/lib.rs rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/src/sync/mod.rs (89%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/src/sync/parker.rs (78%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/src/sync/sharded_lock.rs (100%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/src/sync/wait_group.rs (98%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/src/thread.rs (99%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/tests/atomic_cell.rs (100%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/tests/cache_padded.rs (94%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/tests/parker.rs (93%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/tests/sharded_lock.rs (97%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/tests/thread.rs (100%) rename third_party/cargo/vendor/{crossbeam-utils-0.8.1 => crossbeam-utils-0.8.3}/tests/wait_group.rs (100%) delete mode 100644 third_party/cargo/vendor/derivative-2.1.3/.cargo-checksum.json delete mode 100644 third_party/cargo/vendor/derivative-2.1.3/Makefile delete mode 100644 third_party/cargo/vendor/derivative-2.1.3/book.json delete mode 100644 third_party/cargo/vendor/derivative-2.1.3/doc/SUMMARY.md delete mode 100644 third_party/cargo/vendor/derivative-2.1.3/doc/debug-transparent.rs delete mode 100644 third_party/cargo/vendor/derivative-2.1.3/src/cmp.rs create mode 100644 third_party/cargo/vendor/derivative-2.2.0/.cargo-checksum.json rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/BUILD.bazel (91%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/CHANGELOG.md (88%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/CONTRIBUTING.md (83%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/Cargo.toml (98%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/README.md (95%) create mode 100644 third_party/cargo/vendor/derivative-2.2.0/book.toml rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/doc/Clone.md (97%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/doc/Debug.md (64%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/doc/Default.md (82%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/doc/Hash.md (69%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/doc/README.md (51%) create mode 100644 third_party/cargo/vendor/derivative-2.2.0/doc/SUMMARY.md rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/doc/cmp.md (66%) create mode 100644 third_party/cargo/vendor/derivative-2.2.0/doc/custom.css rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/doc/debug-transparent-orig.rs (90%) create mode 100644 third_party/cargo/vendor/derivative-2.2.0/doc/debug-transparent.rs rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/doc/default-enum-orig.rs (67%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/doc/default-enum.rs (74%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/doc/default-value-orig.rs (82%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/doc/default-value.rs (65%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/doc/eq-ignore-orig.rs (93%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/doc/eq-ignore.rs (86%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/doc/styles/website.css (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/src/ast.rs (94%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/src/attr.rs (97%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/src/bound.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/src/clone.rs (95%) create mode 100644 third_party/cargo/vendor/derivative-2.2.0/src/cmp.rs rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/src/debug.rs (77%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/src/default.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/src/hash.rs (90%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/src/lib.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/src/matcher.rs (68%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/src/paths.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/src/utils.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/clippy-warning-clone-from.rs (100%) create mode 100644 third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-debug-unused.rs create mode 100644 third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-debug-unused.stderr rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/compile-fail/derive-debug.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/compile-fail/derive-debug.stderr (84%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/compile-fail/derive-partial-ord.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/compile-fail/derive-partial-ord.stderr (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/compile-fail/invalid-attribute.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/compile-fail/invalid-attribute.stderr (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/compile-fail/unknown-attribute.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/compile-fail/unknown-attribute.stderr (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/compile-fail/unknown-derive.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/compile-fail/unknown-derive.stderr (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/compile-test.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/derive-clone-generics.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/derive-clone.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/derive-debug-bounds.rs (94%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/derive-debug-generics.rs (98%) create mode 100644 third_party/cargo/vendor/derivative-2.2.0/tests/derive-debug-packed.rs rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/derive-debug-transparent.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/derive-debug.rs (98%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/derive-default-bounds.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/derive-default.rs (100%) create mode 100644 third_party/cargo/vendor/derivative-2.2.0/tests/derive-eq-packed.rs rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/derive-eq.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/derive-hash.rs (100%) create mode 100644 third_party/cargo/vendor/derivative-2.2.0/tests/derive-ord-packed.rs rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/derive-ord.rs (100%) create mode 100644 third_party/cargo/vendor/derivative-2.2.0/tests/derive-partial-eq-packed.rs rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/derive-partial-eq.rs (97%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/issue-37-turbofish.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/issue-55.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/issue-57.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/issue-58.rs (91%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/issue-67.rs (100%) create mode 100644 third_party/cargo/vendor/derivative-2.2.0/tests/issue-82.rs rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-class-implement-traits.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-bounds.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-clone-array.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-clone-enum.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-clone-generic-enum.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-clone-generic-tuple-struct.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-clone-struct.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-clone-tuple-struct.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-cmp-generic-enum.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-cmp-generic-struct-enum.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-cmp-generic-struct.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-cmp-generic-tuple-struct.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-copyclone.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-default-box.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-enum-single-variant.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-hash.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-in-fn.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-meta-multiple.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-meta.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-show-2.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-show.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-via-extension-hash-enum.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-via-extension-hash-struct.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-deriving-via-extension-type-params.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-expr-copy.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-exterior.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-12860.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-13434.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-16530.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-19037.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-19102.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-19135.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-19358.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-21402.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-23649-3.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-24085.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-25394.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-28561.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-29030.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-29540.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-29710.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-32292.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-3935.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-42453.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-58319.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-issue-6341.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-typeclasses-eq-example.rs (100%) rename third_party/cargo/vendor/{derivative-2.1.3 => derivative-2.2.0}/tests/rustc-zero-sized-btreemap-insert.rs (100%) create mode 100644 third_party/cargo/vendor/dlib-0.5.0/.cargo-checksum.json create mode 100644 third_party/cargo/vendor/dlib-0.5.0/BUILD.bazel create mode 100644 third_party/cargo/vendor/dlib-0.5.0/Cargo.toml rename third_party/cargo/vendor/{wayland-client-0.28.3 => dlib-0.5.0}/LICENSE.txt (100%) create mode 100644 third_party/cargo/vendor/dlib-0.5.0/README.md create mode 100644 third_party/cargo/vendor/dlib-0.5.0/src/lib.rs delete mode 100644 third_party/cargo/vendor/gif-0.11.1/.cargo-checksum.json create mode 100644 third_party/cargo/vendor/gif-0.11.2/.cargo-checksum.json rename third_party/cargo/vendor/{gif-0.11.1 => gif-0.11.2}/BUILD.bazel (75%) create mode 100644 third_party/cargo/vendor/gif-0.11.2/Cargo.lock rename third_party/cargo/vendor/{gif-0.11.1 => gif-0.11.2}/Cargo.toml (74%) rename third_party/cargo/vendor/{gif-0.11.1 => gif-0.11.2}/Changes.md (86%) rename third_party/cargo/vendor/{gif-0.11.1 => gif-0.11.2}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{gif-0.11.1 => gif-0.11.2}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{gif-0.11.1 => gif-0.11.2}/README.md (84%) rename third_party/cargo/vendor/{gif-0.11.1 => gif-0.11.2}/benches/decode.rs (100%) create mode 100644 third_party/cargo/vendor/gif-0.11.2/examples/explode.rs rename third_party/cargo/vendor/{gif-0.11.1 => gif-0.11.2}/src/common.rs (88%) rename third_party/cargo/vendor/{gif-0.11.1 => gif-0.11.2}/src/encoder.rs (99%) rename third_party/cargo/vendor/{gif-0.11.1 => gif-0.11.2}/src/lib.rs (95%) rename third_party/cargo/vendor/{gif-0.11.1 => gif-0.11.2}/src/reader/decoder.rs (98%) rename third_party/cargo/vendor/{gif-0.11.1 => gif-0.11.2}/src/reader/mod.rs (95%) rename third_party/cargo/vendor/{gif-0.11.1 => gif-0.11.2}/src/traits.rs (100%) create mode 100644 third_party/cargo/vendor/gif-0.11.2/tests/check_testimages.rs create mode 100644 third_party/cargo/vendor/gif-0.11.2/tests/crashtest.rs create mode 100644 third_party/cargo/vendor/gif-0.11.2/tests/decode.rs create mode 100644 third_party/cargo/vendor/gif-0.11.2/tests/results.txt create mode 100644 third_party/cargo/vendor/gif-0.11.2/tests/roundtrip.rs delete mode 100644 third_party/cargo/vendor/half-1.6.0/.cargo-checksum.json delete mode 100644 third_party/cargo/vendor/half-1.6.0/appveyor.yml create mode 100644 third_party/cargo/vendor/half-1.7.1/.cargo-checksum.json rename third_party/cargo/vendor/{half-1.6.0 => half-1.7.1}/BUILD.bazel (98%) rename third_party/cargo/vendor/{half-1.6.0 => half-1.7.1}/CHANGELOG.md (87%) rename third_party/cargo/vendor/{half-1.6.0 => half-1.7.1}/Cargo.toml (84%) rename third_party/cargo/vendor/{half-1.6.0 => half-1.7.1}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{half-1.6.0 => half-1.7.1}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{half-1.6.0 => half-1.7.1}/README.md (92%) rename third_party/cargo/vendor/{half-1.6.0 => half-1.7.1}/benches/convert.rs (100%) rename third_party/cargo/vendor/{half-1.6.0 => half-1.7.1}/src/bfloat.rs (92%) rename third_party/cargo/vendor/{half-1.6.0 => half-1.7.1}/src/bfloat/convert.rs (100%) rename third_party/cargo/vendor/{half-1.6.0 => half-1.7.1}/src/binary16.rs (94%) rename third_party/cargo/vendor/{half-1.6.0 => half-1.7.1}/src/binary16/convert.rs (100%) rename third_party/cargo/vendor/{half-1.6.0 => half-1.7.1}/src/lib.rs (91%) rename third_party/cargo/vendor/{half-1.6.0 => half-1.7.1}/src/slice.rs (100%) rename third_party/cargo/vendor/{half-1.6.0 => half-1.7.1}/src/vec.rs (100%) rename third_party/cargo/vendor/{half-1.6.0 => half-1.7.1}/tests/version-numbers.rs (100%) rename third_party/cargo/vendor/{hermit-abi-0.1.17 => hermit-abi-0.1.18}/.cargo-checksum.json (51%) rename third_party/cargo/vendor/{hermit-abi-0.1.17 => hermit-abi-0.1.18}/BUILD.bazel (92%) rename third_party/cargo/vendor/{hermit-abi-0.1.17 => hermit-abi-0.1.18}/Cargo.toml (98%) rename third_party/cargo/vendor/{hermit-abi-0.1.17 => hermit-abi-0.1.18}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{const_fn-0.4.5 => hermit-abi-0.1.18}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{hermit-abi-0.1.17 => hermit-abi-0.1.18}/README.md (100%) rename third_party/cargo/vendor/{hermit-abi-0.1.17 => hermit-abi-0.1.18}/rust-toolchain (100%) rename third_party/cargo/vendor/{hermit-abi-0.1.17 => hermit-abi-0.1.18}/src/lib.rs (99%) rename third_party/cargo/vendor/{hermit-abi-0.1.17 => hermit-abi-0.1.18}/src/tcplistener.rs (100%) rename third_party/cargo/vendor/{hermit-abi-0.1.17 => hermit-abi-0.1.18}/src/tcpstream.rs (100%) delete mode 100644 third_party/cargo/vendor/image-0.23.12/.cargo-checksum.json create mode 100644 third_party/cargo/vendor/image-0.23.14/.cargo-checksum.json rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/BUILD.bazel (82%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/CHANGES.md (91%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/Cargo.toml (86%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/Cargo.toml.public-private-dependencies (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/LICENSE (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/README.md (92%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/benches/README.md (100%) create mode 100644 third_party/cargo/vendor/image-0.23.14/benches/copy_from.rs rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/benches/decode.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/benches/encode.rs (100%) create mode 100644 third_party/cargo/vendor/image-0.23.14/clippy.toml rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/docs/2019-04-23-memory-unsafety.md (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/release.sh (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/animation.rs (98%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/buffer.rs (98%) create mode 100644 third_party/cargo/vendor/image-0.23.14/src/codecs/avif/decoder.rs rename third_party/cargo/vendor/{image-0.23.12/src/codecs/avif/mod.rs => image-0.23.14/src/codecs/avif/encoder.rs} (80%) create mode 100644 third_party/cargo/vendor/image-0.23.14/src/codecs/avif/mod.rs rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/bmp/decoder.rs (99%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/bmp/encoder.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/bmp/mod.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/dds.rs (80%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/dxt.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/farbfeld.rs (93%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/gif.rs (65%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/hdr/decoder.rs (97%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/hdr/encoder.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/hdr/mod.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/ico/decoder.rs (88%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/ico/encoder.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/ico/mod.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/jpeg/decoder.rs (99%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/jpeg/encoder.rs (96%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/jpeg/entropy.rs (82%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/jpeg/mod.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/jpeg/transform.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/png.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/pnm/autobreak.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/pnm/decoder.rs (97%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/pnm/encoder.rs (99%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/pnm/header.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/pnm/mod.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/tga/decoder.rs (81%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/tga/encoder.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/tga/header.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/tga/mod.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/tiff.rs (99%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/webp/decoder.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/webp/mod.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/webp/transform.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/codecs/webp/vp8.rs (99%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/color.rs (99%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/dynimage.rs (97%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/error.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/flat.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/image.rs (89%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/imageops/affine.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/imageops/colorops.rs (74%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/imageops/mod.rs (92%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/imageops/sample.rs (92%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/io/free_functions.rs (80%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/io/mod.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/io/reader.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/lib.rs (97%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/math/mod.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/math/nq.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/math/rect.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/math/utils.rs (93%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/traits.rs (100%) rename third_party/cargo/vendor/{image-0.23.12 => image-0.23.14}/src/utils/mod.rs (94%) delete mode 100644 third_party/cargo/vendor/jpeg-decoder-0.1.20/.cargo-checksum.json delete mode 100644 third_party/cargo/vendor/jpeg-decoder-0.1.20/Cargo.lock delete mode 100644 third_party/cargo/vendor/jpeg-decoder-0.1.20/src/worker/threaded.rs create mode 100644 third_party/cargo/vendor/jpeg-decoder-0.1.22/.cargo-checksum.json rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/BUILD.bazel (93%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/CHANGELOG.md (89%) create mode 100644 third_party/cargo/vendor/jpeg-decoder-0.1.22/Cargo.lock rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/Cargo.toml (94%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/README.md (100%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/appveyor.yml (100%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/benches/decoding_benchmark.rs (100%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/benches/tower.jpg (100%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/benches/tower_grayscale.jpg (100%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/benches/tower_progressive.jpg (100%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/examples/decode.rs (100%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/src/decoder.rs (79%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/src/error.rs (100%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/src/huffman.rs (97%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/src/idct.rs (99%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/src/lib.rs (78%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/src/marker.rs (100%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/src/parser.rs (88%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/src/upsampler.rs (99%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/src/worker/immediate.rs (100%) rename third_party/cargo/vendor/{jpeg-decoder-0.1.20 => jpeg-decoder-0.1.22}/src/worker/mod.rs (87%) create mode 100644 third_party/cargo/vendor/jpeg-decoder-0.1.22/src/worker/multithreaded.rs delete mode 100644 third_party/cargo/vendor/libc-0.2.82/.cargo-checksum.json delete mode 100644 third_party/cargo/vendor/libc-0.2.82/src/cloudabi/aarch64.rs delete mode 100644 third_party/cargo/vendor/libc-0.2.82/src/cloudabi/arm.rs delete mode 100644 third_party/cargo/vendor/libc-0.2.82/src/cloudabi/mod.rs delete mode 100644 third_party/cargo/vendor/libc-0.2.82/src/cloudabi/x86.rs delete mode 100644 third_party/cargo/vendor/libc-0.2.82/src/cloudabi/x86_64.rs delete mode 100644 third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/align.rs delete mode 100644 third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mod.rs delete mode 100644 third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/x86_64/align.rs delete mode 100644 third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/x86_64/no_align.rs create mode 100644 third_party/cargo/vendor/libc-0.2.92/.cargo-checksum.json rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/BUILD.bazel (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/CONTRIBUTING.md (95%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/Cargo.toml (98%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/README.md (98%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/build.rs (94%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/rustfmt.toml (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/fixed_width_ints.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/fuchsia/aarch64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/fuchsia/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/fuchsia/mod.rs (99%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/fuchsia/no_align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/fuchsia/x86_64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/hermit/aarch64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/hermit/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/hermit/x86_64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/lib.rs (93%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/macros.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/psp.rs (99%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/sgx.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/switch.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/apple/b32/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/apple/b32/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/apple/b64/aarch64/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/apple/b64/aarch64/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/apple/b64/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/apple/b64/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/apple/b64/x86_64/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/apple/b64/x86_64/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/apple/mod.rs (94%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/freebsdlike/dragonfly/errno.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/freebsdlike/dragonfly/mod.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/freebsdlike/freebsd/aarch64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/freebsdlike/freebsd/arm.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs (98%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs (96%) create mode 100644 third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs create mode 100644 third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/freebsdlike/freebsd/mod.rs (94%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/freebsdlike/freebsd/x86.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/freebsdlike/mod.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/mod.rs (99%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/netbsdlike/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/netbsdlike/netbsd/aarch64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/netbsdlike/netbsd/arm.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/netbsdlike/netbsd/mod.rs (98%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/netbsdlike/netbsd/powerpc.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/netbsdlike/netbsd/sparc64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/netbsdlike/netbsd/x86.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/netbsdlike/netbsd/x86_64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/netbsdlike/openbsd/aarch64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/netbsdlike/openbsd/mod.rs (99%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/netbsdlike/openbsd/sparc64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/netbsdlike/openbsd/x86.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/bsd/netbsdlike/openbsd/x86_64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/haiku/b32.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/haiku/b64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/haiku/mod.rs (90%) create mode 100644 third_party/cargo/vendor/libc-0.2.92/src/unix/haiku/native.rs rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/hermit/aarch64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/hermit/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/hermit/x86_64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/android/b32/arm.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/android/b32/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/android/b32/x86/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/android/b32/x86/mod.rs (95%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/android/b64/aarch64/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/android/b64/aarch64/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/android/b64/mod.rs (94%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/android/b64/x86_64/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/android/b64/x86_64/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/android/mod.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/emscripten/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/emscripten/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/emscripten/no_align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b32/arm/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b32/arm/mod.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b32/mips/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b32/mips/mod.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b32/mod.rs (99%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b32/powerpc.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b32/sparc/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b32/x86/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b32/x86/mod.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs (100%) create mode 100644 third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs create mode 100644 third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs (95%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b64/mips64/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b64/mod.rs (87%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b64/s390x.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs (99%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs (95%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs (95%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/mod.rs (93%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/gnu/no_align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/mod.rs (89%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/b32/arm/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/b32/arm/mod.rs (96%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/b32/hexagon.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/b32/mips/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/b32/mips/mod.rs (96%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/b32/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/b32/powerpc.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/b32/x86/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/b32/x86/mod.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/b64/aarch64/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs (96%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/b64/mips64.rs (92%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/b64/mod.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/b64/powerpc64.rs (96%) create mode 100644 third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/s390x.rs rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/b64/x86_64/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs (97%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/musl/mod.rs (90%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/linux/no_align.rs (100%) create mode 100644 third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/align.rs rename third_party/cargo/vendor/{libc-0.2.82/src/unix => libc-0.2.92/src/unix/linux_like/linux}/uclibc/arm/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82/src/unix => libc-0.2.92/src/unix/linux_like/linux}/uclibc/arm/mod.rs (78%) rename third_party/cargo/vendor/{libc-0.2.82/src/unix => libc-0.2.92/src/unix/linux_like/linux}/uclibc/arm/no_align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82/src/unix => libc-0.2.92/src/unix/linux_like/linux}/uclibc/mips/mips32/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82/src/unix => libc-0.2.92/src/unix/linux_like/linux}/uclibc/mips/mips32/mod.rs (95%) rename third_party/cargo/vendor/{libc-0.2.82/src/unix => libc-0.2.92/src/unix/linux_like/linux}/uclibc/mips/mips32/no_align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82/src/unix => libc-0.2.92/src/unix/linux_like/linux}/uclibc/mips/mips64/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82/src/unix => libc-0.2.92/src/unix/linux_like/linux}/uclibc/mips/mips64/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82/src/unix => libc-0.2.92/src/unix/linux_like/linux}/uclibc/mips/mips64/no_align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82/src/unix => libc-0.2.92/src/unix/linux_like/linux}/uclibc/mips/mod.rs (78%) create mode 100644 third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mod.rs rename third_party/cargo/vendor/{libc-0.2.82/src/unix => libc-0.2.92/src/unix/linux_like/linux}/uclibc/no_align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82/src/unix => libc-0.2.92/src/unix/linux_like/linux}/uclibc/x86_64/l4re.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82/src/unix => libc-0.2.92/src/unix/linux_like/linux}/uclibc/x86_64/mod.rs (84%) rename third_party/cargo/vendor/{libc-0.2.82/src/unix => libc-0.2.92/src/unix/linux_like/linux}/uclibc/x86_64/other.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/linux_like/mod.rs (95%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/mod.rs (94%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/newlib/aarch64/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/newlib/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/newlib/arm/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/newlib/mod.rs (98%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/newlib/no_align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/newlib/powerpc/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/newlib/xtensa/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/no_align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/redox/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/solarish/compat.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/solarish/illumos.rs (84%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/solarish/mod.rs (98%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/unix/solarish/solaris.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/vxworks/aarch64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/vxworks/arm.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/vxworks/mod.rs (99%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/vxworks/powerpc.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/vxworks/powerpc64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/vxworks/x86.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/vxworks/x86_64.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/wasi.rs (89%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/windows/gnu/align.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/windows/gnu/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/windows/mod.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/src/windows/msvc.rs (100%) rename third_party/cargo/vendor/{libc-0.2.82 => libc-0.2.92}/tests/const_fn.rs (100%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/.cargo-checksum.json (59%) create mode 100644 third_party/cargo/vendor/libloading-0.6.7/BUILD.bazel rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/Cargo.toml (98%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/LICENSE (100%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/README.mkd (100%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/src/changelog.rs (92%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/src/error.rs (98%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/src/lib.rs (100%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/src/os/mod.rs (100%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/src/os/unix/consts.rs (100%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/src/os/unix/mod.rs (100%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/src/os/windows/mod.rs (91%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/src/test_helpers.rs (100%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/src/util.rs (100%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/tests/constants.rs (100%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/tests/functions.rs (92%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/tests/library_filename.rs (100%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/tests/markers.rs (100%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/tests/nagisa32.dll (100%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/tests/nagisa64.dll (100%) rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.6.7}/tests/windows.rs (100%) create mode 100644 third_party/cargo/vendor/libloading-0.7.0/.cargo-checksum.json rename third_party/cargo/vendor/{libloading-0.6.6 => libloading-0.7.0}/BUILD.bazel (98%) create mode 100644 third_party/cargo/vendor/libloading-0.7.0/Cargo.toml create mode 100644 third_party/cargo/vendor/libloading-0.7.0/LICENSE create mode 100644 third_party/cargo/vendor/libloading-0.7.0/README.mkd create mode 100644 third_party/cargo/vendor/libloading-0.7.0/src/changelog.rs create mode 100644 third_party/cargo/vendor/libloading-0.7.0/src/error.rs create mode 100644 third_party/cargo/vendor/libloading-0.7.0/src/lib.rs create mode 100644 third_party/cargo/vendor/libloading-0.7.0/src/os/mod.rs create mode 100644 third_party/cargo/vendor/libloading-0.7.0/src/os/unix/consts.rs create mode 100644 third_party/cargo/vendor/libloading-0.7.0/src/os/unix/mod.rs create mode 100644 third_party/cargo/vendor/libloading-0.7.0/src/os/windows/mod.rs create mode 100644 third_party/cargo/vendor/libloading-0.7.0/src/test_helpers.rs create mode 100644 third_party/cargo/vendor/libloading-0.7.0/src/util.rs create mode 100644 third_party/cargo/vendor/libloading-0.7.0/tests/constants.rs create mode 100644 third_party/cargo/vendor/libloading-0.7.0/tests/functions.rs create mode 100644 third_party/cargo/vendor/libloading-0.7.0/tests/library_filename.rs create mode 100644 third_party/cargo/vendor/libloading-0.7.0/tests/markers.rs create mode 100644 third_party/cargo/vendor/libloading-0.7.0/tests/nagisa32.dll create mode 100644 third_party/cargo/vendor/libloading-0.7.0/tests/nagisa64.dll create mode 100644 third_party/cargo/vendor/libloading-0.7.0/tests/windows.rs delete mode 100644 third_party/cargo/vendor/lock_api-0.4.2/.cargo-checksum.json create mode 100644 third_party/cargo/vendor/lock_api-0.4.3/.cargo-checksum.json rename third_party/cargo/vendor/{lock_api-0.4.2 => lock_api-0.4.3}/BUILD.bazel (97%) rename third_party/cargo/vendor/{lock_api-0.4.2 => lock_api-0.4.3}/Cargo.toml (98%) rename third_party/cargo/vendor/{lock_api-0.4.2 => lock_api-0.4.3}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{lock_api-0.4.2 => lock_api-0.4.3}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{lock_api-0.4.2 => lock_api-0.4.3}/src/lib.rs (100%) rename third_party/cargo/vendor/{lock_api-0.4.2 => lock_api-0.4.3}/src/mutex.rs (100%) rename third_party/cargo/vendor/{lock_api-0.4.2 => lock_api-0.4.3}/src/remutex.rs (98%) rename third_party/cargo/vendor/{lock_api-0.4.2 => lock_api-0.4.3}/src/rwlock.rs (100%) delete mode 100644 third_party/cargo/vendor/log-0.4.11/.cargo-checksum.json delete mode 100644 third_party/cargo/vendor/log-0.4.11/build.rs delete mode 100644 third_party/cargo/vendor/log-0.4.11/src/kv/source.rs delete mode 100644 third_party/cargo/vendor/log-0.4.11/src/kv/value/fill.rs delete mode 100644 third_party/cargo/vendor/log-0.4.11/src/kv/value/impls.rs delete mode 100644 third_party/cargo/vendor/log-0.4.11/src/kv/value/internal/cast.rs delete mode 100644 third_party/cargo/vendor/log-0.4.11/src/kv/value/internal/fmt.rs delete mode 100644 third_party/cargo/vendor/log-0.4.11/src/kv/value/internal/mod.rs delete mode 100644 third_party/cargo/vendor/log-0.4.11/src/kv/value/internal/sval.rs delete mode 100644 third_party/cargo/vendor/log-0.4.11/src/kv/value/mod.rs delete mode 100644 third_party/cargo/vendor/log-0.4.11/src/kv/value/test.rs delete mode 100644 third_party/cargo/vendor/log-0.4.11/tests/filters.rs delete mode 100644 third_party/cargo/vendor/log-0.4.11/tests/macros.rs create mode 100644 third_party/cargo/vendor/log-0.4.14/.cargo-checksum.json rename third_party/cargo/vendor/{log-0.4.11 => log-0.4.14}/BUILD.bazel (89%) rename third_party/cargo/vendor/{log-0.4.11 => log-0.4.14}/CHANGELOG.md (82%) rename third_party/cargo/vendor/{log-0.4.11 => log-0.4.14}/Cargo.toml (70%) rename third_party/cargo/vendor/{log-0.4.11 => log-0.4.14}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{log-0.4.11 => log-0.4.14}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{log-0.4.11 => log-0.4.14}/README.md (100%) create mode 100644 third_party/cargo/vendor/log-0.4.14/benches/value.rs create mode 100644 third_party/cargo/vendor/log-0.4.14/build.rs rename third_party/cargo/vendor/{log-0.4.11 => log-0.4.14}/src/kv/error.rs (100%) rename third_party/cargo/vendor/{log-0.4.11 => log-0.4.14}/src/kv/key.rs (75%) rename third_party/cargo/vendor/{log-0.4.11 => log-0.4.14}/src/kv/mod.rs (93%) create mode 100644 third_party/cargo/vendor/log-0.4.14/src/kv/source.rs create mode 100644 third_party/cargo/vendor/log-0.4.14/src/kv/value.rs rename third_party/cargo/vendor/{log-0.4.11 => log-0.4.14}/src/lib.rs (91%) rename third_party/cargo/vendor/{log-0.4.11 => log-0.4.14}/src/macros.rs (83%) rename third_party/cargo/vendor/{log-0.4.11 => log-0.4.14}/src/serde.rs (80%) rename third_party/cargo/vendor/{log-0.4.11 => log-0.4.14}/triagebot.toml (100%) delete mode 100644 third_party/cargo/vendor/memoffset-0.6.1/.cargo-checksum.json create mode 100644 third_party/cargo/vendor/memoffset-0.6.3/.cargo-checksum.json rename third_party/cargo/vendor/{memoffset-0.6.1 => memoffset-0.6.3}/BUILD.bazel (97%) rename third_party/cargo/vendor/{memoffset-0.6.1 => memoffset-0.6.3}/Cargo.toml (96%) rename third_party/cargo/vendor/{memoffset-0.6.1 => memoffset-0.6.3}/LICENSE (100%) rename third_party/cargo/vendor/{memoffset-0.6.1 => memoffset-0.6.3}/README.md (85%) rename third_party/cargo/vendor/{memoffset-0.6.1 => memoffset-0.6.3}/build.rs (83%) rename third_party/cargo/vendor/{memoffset-0.6.1 => memoffset-0.6.3}/ci/miri.sh (100%) rename third_party/cargo/vendor/{memoffset-0.6.1 => memoffset-0.6.3}/src/lib.rs (87%) rename third_party/cargo/vendor/{memoffset-0.6.1 => memoffset-0.6.3}/src/offset_of.rs (92%) rename third_party/cargo/vendor/{memoffset-0.6.1 => memoffset-0.6.3}/src/raw_field.rs (86%) rename third_party/cargo/vendor/{memoffset-0.6.1 => memoffset-0.6.3}/src/span_of.rs (83%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/.cargo-checksum.json (53%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/BUILD.bazel (93%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/Cargo.toml (97%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/LICENSE (100%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/LICENSE-APACHE.md (100%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/LICENSE-MIT.md (100%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/LICENSE-ZLIB.md (100%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/Readme.md (100%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/build.rs (100%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/src/deflate/buffer.rs (100%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/src/deflate/core.rs (99%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/src/deflate/mod.rs (100%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/src/deflate/stream.rs (100%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/src/inflate/core.rs (99%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/src/inflate/mod.rs (100%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/src/inflate/output_buffer.rs (94%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/src/inflate/stream.rs (99%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/src/lib.rs (100%) rename third_party/cargo/vendor/{miniz_oxide-0.4.3 => miniz_oxide-0.4.4}/src/shared.rs (100%) delete mode 100644 third_party/cargo/vendor/nix-0.19.1/.cargo-checksum.json delete mode 100644 third_party/cargo/vendor/nix-0.19.1/test/test.rs create mode 100644 third_party/cargo/vendor/nix-0.20.0/.cargo-checksum.json rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/BUILD.bazel (95%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/CHANGELOG.md (96%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/CONTRIBUTING.md (92%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/CONVENTIONS.md (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/Cargo.toml (91%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/LICENSE (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/README.md (93%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/dir.rs (72%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/env.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/errno.rs (92%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/fcntl.rs (99%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/features.rs (97%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/ifaddrs.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/kmod.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/lib.rs (99%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/macros.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/mount.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/mqueue.rs (89%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/net/if_.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/net/mod.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/poll.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/pty.rs (99%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sched.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/aio.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/epoll.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/event.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/eventfd.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/inotify.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/ioctl/bsd.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/ioctl/linux.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/ioctl/mod.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/memfd.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/mman.rs (93%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/mod.rs (97%) create mode 100644 third_party/cargo/vendor/nix-0.20.0/src/sys/personality.rs rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/pthread.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/ptrace/bsd.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/ptrace/linux.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/ptrace/mod.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/quota.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/reboot.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/select.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/sendfile.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/signal.rs (94%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/signalfd.rs (96%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/socket/addr.rs (99%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/socket/mod.rs (99%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/socket/sockopt.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/stat.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/statfs.rs (77%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/statvfs.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/sysinfo.rs (86%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/termios.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/time.rs (96%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/timerfd.rs (95%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/uio.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/utsname.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/sys/wait.rs (91%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/time.rs (99%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/ucontext.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/src/unistd.rs (98%) create mode 100644 third_party/cargo/vendor/nix-0.20.0/test/common/mod.rs rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/mod.rs (91%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_aio.rs (98%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_aio_drop.rs (91%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_epoll.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_inotify.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_ioctl.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_lio_listio_resubmit.rs (100%) create mode 100644 third_party/cargo/vendor/nix-0.20.0/test/sys/test_mman.rs rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_pthread.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_ptrace.rs (97%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_select.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_signal.rs (99%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_signalfd.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_socket.rs (98%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_sockopt.rs (98%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_sysinfo.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_termios.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_timerfd.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_uio.rs (99%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/sys/test_wait.rs (99%) create mode 100644 third_party/cargo/vendor/nix-0.20.0/test/test.rs rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_clearenv.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_dir.rs (93%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_fcntl.rs (99%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_kmod/hello_mod/Makefile (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_kmod/hello_mod/hello.c (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_kmod/mod.rs (99%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_mount.rs (98%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_mq.rs (93%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_net.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_nix_path.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_poll.rs (72%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_pty.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_ptymaster_drop.rs (93%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_sched.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_sendfile.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_stat.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_time.rs (100%) rename third_party/cargo/vendor/{nix-0.19.1 => nix-0.20.0}/test/test_unistd.rs (89%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/.cargo-checksum.json (72%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/.travis.yml (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/BUILD.bazel (99%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/CHANGELOG.md (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/Cargo.lock (78%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/Cargo.toml (96%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/LICENSE (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/README.md (99%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/build.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/doc/nom_recipes.md (97%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/bits/complete.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/bits/macros.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/bits/mod.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/bits/streaming.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/branch/macros.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/branch/mod.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/bytes/complete.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/bytes/macros.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/bytes/mod.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/bytes/streaming.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/character/complete.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/character/macros.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/character/mod.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/character/streaming.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/combinator/macros.rs (99%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/combinator/mod.rs (99%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/error.rs (99%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/internal.rs (98%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/lib.rs (99%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/multi/macros.rs (99%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/multi/mod.rs (96%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/number/complete.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/number/macros.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/number/mod.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/number/streaming.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/regexp/macros.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/regexp/mod.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/sequence/macros.rs (99%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/sequence/mod.rs (93%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/str.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/traits.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/src/util.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/arithmetic.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/arithmetic_ast.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/bitstream.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/blockbuf-arithmetic.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/css.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/custom_errors.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/escaped.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/float.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/fnmut.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/inference.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/ini.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/ini_str.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/issues.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/json.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/mp4.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/multiline.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/named_args.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/overflow.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/reborrow_fold.rs (100%) rename third_party/cargo/vendor/{nom-6.0.1 => nom-6.1.2}/tests/test1.rs (100%) delete mode 100644 third_party/cargo/vendor/once_cell-1.5.2/.cargo-checksum.json create mode 100644 third_party/cargo/vendor/once_cell-1.7.2/.cargo-checksum.json rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/BUILD.bazel (97%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/CHANGELOG.md (81%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/Cargo.lock (74%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/Cargo.toml (97%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{hermit-abi-0.1.17 => once_cell-1.7.2}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/README.md (96%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/bors.toml (100%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/examples/bench.rs (100%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/examples/bench_acquire.rs (100%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/examples/bench_vs_lazy_static.rs (100%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/examples/lazy_static.rs (100%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/examples/reentrant_init_deadlocks.rs (100%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/examples/regex.rs (100%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/examples/test_synchronization.rs (100%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/src/imp_pl.rs (75%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/src/imp_std.rs (95%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/src/lib.rs (95%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/src/race.rs (86%) rename third_party/cargo/vendor/{once_cell-1.5.2 => once_cell-1.7.2}/tests/it.rs (96%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/.cargo-checksum.json (86%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/BUILD.bazel (91%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/Cargo.toml (96%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/src/lib.rs (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/src/parking_lot.rs (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/src/spinwait.rs (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/src/thread_parker/generic.rs (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/src/thread_parker/linux.rs (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/src/thread_parker/mod.rs (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/src/thread_parker/redox.rs (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/src/thread_parker/sgx.rs (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/src/thread_parker/unix.rs (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/src/thread_parker/wasm.rs (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/src/thread_parker/wasm_atomic.rs (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/src/thread_parker/windows/keyed_event.rs (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/src/thread_parker/windows/mod.rs (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/src/thread_parker/windows/waitaddress.rs (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/src/util.rs (100%) rename third_party/cargo/vendor/{parking_lot_core-0.8.2 => parking_lot_core-0.8.3}/src/word_lock.rs (100%) delete mode 100644 third_party/cargo/vendor/proc-macro2-1.0.24/.cargo-checksum.json create mode 100644 third_party/cargo/vendor/proc-macro2-1.0.26/.cargo-checksum.json rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/BUILD.bazel (97%) rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/Cargo.toml (93%) rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/README.md (100%) rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/build.rs (100%) rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/src/detection.rs (100%) rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/src/fallback.rs (99%) rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/src/lib.rs (95%) rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/src/marker.rs (100%) rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/src/parse.rs (84%) rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/src/wrapper.rs (97%) rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/tests/comments.rs (100%) rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/tests/features.rs (100%) rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/tests/marker.rs (100%) rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/tests/test.rs (95%) rename third_party/cargo/vendor/{proc-macro2-1.0.24 => proc-macro2-1.0.26}/tests/test_fmt.rs (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/.cargo-checksum.json (80%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/BUILD.bazel (93%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/Cargo.toml (98%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/README.md (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/src/ext.rs (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/src/format.rs (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/src/ident_fragment.rs (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/src/lib.rs (99%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/src/runtime.rs (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/src/spanned.rs (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/src/to_tokens.rs (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/tests/compiletest.rs (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/tests/test.rs (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/tests/ui/does-not-have-iter-interpolated-dup.rs (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/tests/ui/does-not-have-iter-interpolated.rs (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/tests/ui/does-not-have-iter-separated.rs (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/tests/ui/does-not-have-iter.rs (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/tests/ui/not-quotable.rs (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/tests/ui/not-repeatable.rs (100%) rename third_party/cargo/vendor/{quote-1.0.8 => quote-1.0.9}/tests/ui/wrong-type-span.rs (100%) delete mode 100644 third_party/cargo/vendor/redox_syscall-0.1.57/.cargo-checksum.json delete mode 100644 third_party/cargo/vendor/redox_syscall-0.1.57/src/arch/x86_64.rs delete mode 100644 third_party/cargo/vendor/redox_syscall-0.1.57/src/flag.rs delete mode 100644 third_party/cargo/vendor/redox_syscall-0.1.57/src/io/dma.rs delete mode 100644 third_party/cargo/vendor/redox_syscall-0.1.57/src/io/mmio.rs delete mode 100644 third_party/cargo/vendor/redox_syscall-0.1.57/src/tests.rs create mode 100644 third_party/cargo/vendor/redox_syscall-0.2.5/.cargo-checksum.json rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/BUILD.bazel (91%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/Cargo.toml (91%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/LICENSE (100%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/README.md (100%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/arch/aarch64.rs (75%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/arch/arm.rs (83%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/arch/nonredox.rs (83%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/arch/x86.rs (83%) create mode 100644 third_party/cargo/vendor/redox_syscall-0.2.5/src/arch/x86_64.rs rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/call.rs (79%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/data.rs (62%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/error.rs (99%) create mode 100644 third_party/cargo/vendor/redox_syscall-0.2.5/src/flag.rs create mode 100644 third_party/cargo/vendor/redox_syscall-0.2.5/src/io/dma.rs rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/io/io.rs (100%) create mode 100644 third_party/cargo/vendor/redox_syscall-0.2.5/src/io/mmio.rs rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/io/mod.rs (100%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/io/pio.rs (100%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/lib.rs (65%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/number.rs (58%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/scheme/generate.sh (74%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/scheme/mod.rs (50%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/scheme/scheme.rs (59%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/scheme/scheme_block.rs (59%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/scheme/scheme_block_mut.rs (59%) rename third_party/cargo/vendor/{redox_syscall-0.1.57 => redox_syscall-0.2.5}/src/scheme/scheme_mut.rs (59%) create mode 100644 third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/seek.rs create mode 100644 third_party/cargo/vendor/redox_syscall-0.2.5/src/tests.rs delete mode 100644 third_party/cargo/vendor/regex-1.4.2/.cargo-checksum.json delete mode 100644 third_party/cargo/vendor/regex-1.4.2/src/cache.rs create mode 100644 third_party/cargo/vendor/regex-1.4.5/.cargo-checksum.json rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/BUILD.bazel (93%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/CHANGELOG.md (95%) create mode 100644 third_party/cargo/vendor/regex-1.4.5/Cargo.lock rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/Cargo.toml (94%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/HACKING.md (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/PERFORMANCE.md (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/README.md (98%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/UNICODE.md (87%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/examples/regexdna-input.txt (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/examples/regexdna-output.txt (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/examples/shootout-regex-dna-bytes.rs (96%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/examples/shootout-regex-dna-cheat.rs (97%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/examples/shootout-regex-dna-replace.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/examples/shootout-regex-dna-single-cheat.rs (97%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/examples/shootout-regex-dna-single.rs (96%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/examples/shootout-regex-dna.rs (96%) rename third_party/cargo/vendor/{walkdir-2.3.1 => regex-1.4.5}/rustfmt.toml (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/backtrack.rs (98%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/compile.rs (99%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/dfa.rs (99%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/error.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/exec.rs (97%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/expand.rs (98%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/find_byte.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/freqs.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/input.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/lib.rs (98%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/literal/imp.rs (99%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/literal/mod.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/pattern.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/pikevm.rs (100%) create mode 100644 third_party/cargo/vendor/regex-1.4.5/src/pool.rs rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/prog.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/re_builder.rs (99%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/re_bytes.rs (95%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/re_set.rs (98%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/re_trait.rs (94%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/re_unicode.rs (95%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/sparse.rs (96%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/testdata/LICENSE (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/testdata/README (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/testdata/basic.dat (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/testdata/nullsubexpr.dat (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/testdata/repetition.dat (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/src/utf8.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/test (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/api.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/api_str.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/bytes.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/consistent.rs (98%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/crates_regex.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/crazy.rs (98%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/flags.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/fowler.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/macros.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/macros_bytes.rs (99%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/macros_str.rs (93%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/misc.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/multiline.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/noparse.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/regression.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/regression_fuzz.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/replace.rs (60%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/searcher.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/set.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/shortest_match.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/suffix_reverse.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/test_backtrack.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/test_backtrack_bytes.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/test_backtrack_utf8bytes.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/test_crates_regex.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/test_default.rs (64%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/test_default_bytes.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/test_nfa.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/test_nfa_bytes.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/test_nfa_utf8bytes.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/unicode.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/word_boundary.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/word_boundary_ascii.rs (100%) rename third_party/cargo/vendor/{regex-1.4.2 => regex-1.4.5}/tests/word_boundary_unicode.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/.cargo-checksum.json (85%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/BUILD.bazel (98%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/Cargo.toml (98%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/README.md (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/benches/bench.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/ast/mod.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/ast/parse.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/ast/print.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/ast/visitor.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/either.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/error.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/hir/interval.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/hir/literal/mod.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/hir/mod.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/hir/print.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/hir/translate.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/hir/visitor.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/lib.rs (98%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/parser.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode.rs (99%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode_tables/LICENSE-UNICODE (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode_tables/age.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode_tables/case_folding_simple.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode_tables/general_category.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode_tables/grapheme_cluster_break.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode_tables/mod.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode_tables/perl_decimal.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode_tables/perl_space.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode_tables/perl_word.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode_tables/property_bool.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode_tables/property_names.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode_tables/property_values.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode_tables/script.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode_tables/script_extension.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode_tables/sentence_break.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/unicode_tables/word_break.rs (100%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/src/utf8.rs (99%) rename third_party/cargo/vendor/{regex-syntax-0.6.21 => regex-syntax-0.6.23}/test (100%) delete mode 100644 third_party/cargo/vendor/serde-1.0.118/.cargo-checksum.json delete mode 100644 third_party/cargo/vendor/serde-1.0.118/src/de/from_primitive.rs delete mode 100644 third_party/cargo/vendor/serde-1.0.118/src/private/mod.rs create mode 100644 third_party/cargo/vendor/serde-1.0.125/.cargo-checksum.json rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/BUILD.bazel (97%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/Cargo.toml (97%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{once_cell-1.5.2 => serde-1.0.125}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/README.md (100%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/build.rs (93%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/crates-io.md (100%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/src/de/ignored_any.rs (94%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/src/de/impls.rs (89%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/src/de/mod.rs (99%) create mode 100644 third_party/cargo/vendor/serde-1.0.125/src/de/seed.rs rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/src/de/utf8.rs (100%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/src/de/value.rs (88%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/src/integer128.rs (98%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/src/lib.rs (93%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/src/macros.rs (99%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/src/private/de.rs (97%) rename third_party/cargo/vendor/{serde-1.0.118/src/private/macros.rs => serde-1.0.125/src/private/doc.rs} (88%) rename third_party/cargo/vendor/{serde-1.0.118/src/export.rs => serde-1.0.125/src/private/mod.rs} (82%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/src/private/ser.rs (98%) create mode 100644 third_party/cargo/vendor/serde-1.0.125/src/private/size_hint.rs rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/src/ser/fmt.rs (100%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/src/ser/impls.rs (93%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/src/ser/impossible.rs (99%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/src/ser/mod.rs (99%) rename third_party/cargo/vendor/{serde-1.0.118 => serde-1.0.125}/src/std_error.rs (100%) delete mode 100644 third_party/cargo/vendor/smallvec-1.6.0/.cargo-checksum.json create mode 100644 third_party/cargo/vendor/smallvec-1.6.1/.cargo-checksum.json rename third_party/cargo/vendor/{smallvec-1.6.0 => smallvec-1.6.1}/BUILD.bazel (97%) rename third_party/cargo/vendor/{smallvec-1.6.0 => smallvec-1.6.1}/Cargo.toml (98%) rename third_party/cargo/vendor/{smallvec-1.6.0 => smallvec-1.6.1}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{smallvec-1.6.0 => smallvec-1.6.1}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{smallvec-1.6.0 => smallvec-1.6.1}/README.md (100%) rename third_party/cargo/vendor/{smallvec-1.6.0 => smallvec-1.6.1}/benches/bench.rs (100%) rename third_party/cargo/vendor/{smallvec-1.6.0 => smallvec-1.6.1}/scripts/run_miri.sh (100%) rename third_party/cargo/vendor/{smallvec-1.6.0 => smallvec-1.6.1}/src/lib.rs (98%) rename third_party/cargo/vendor/{smallvec-1.6.0 => smallvec-1.6.1}/src/specialization.rs (100%) rename third_party/cargo/vendor/{smallvec-1.6.0 => smallvec-1.6.1}/src/tests.rs (98%) rename third_party/cargo/vendor/{smallvec-1.6.0 => smallvec-1.6.1}/tests/macro.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/.cargo-checksum.json (84%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/BUILD.bazel (88%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/CHANGELOG.md (98%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/CONTRIBUTING.md (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/Cargo.lock (99%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/Cargo.toml (98%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/LICENSE.txt (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/README.md (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/doc_index.html (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/examples/compositor_info.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/examples/image_viewer.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/examples/kbd_input.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/examples/layer_shell.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/examples/pointer_input.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/examples/selection.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/examples/themed_frame.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/rustfmt.toml (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/data_device/device.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/data_device/mod.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/data_device/offer.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/data_device/source.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/environment.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/event_loop.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/lazy_global.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/lib.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/output.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/primary_selection/device.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/primary_selection/mod.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/primary_selection/offer.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/primary_selection/source.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/seat/keyboard/ffi.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/seat/keyboard/keysyms.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/seat/keyboard/mod.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/seat/keyboard/state.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/seat/mod.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/seat/pointer/mod.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/seat/pointer/theme.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/shell/mod.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/shell/wl.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/shell/xdg.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/shell/zxdg.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/shm/mempool.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/shm/mod.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/surface.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/window/concept_frame.rs (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/src/window/mod.rs (98%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/travis_install_wayland.sh (100%) rename third_party/cargo/vendor/{smithay-client-toolkit-0.12.2 => smithay-client-toolkit-0.12.3}/update_keysyms.sh (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/.cargo-checksum.json (68%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/BUILD.bazel (95%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/Cargo.toml (98%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{serde-1.0.118 => syn-1.0.68}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/README.md (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/benches/file.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/benches/rust.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/build.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/attr.rs (99%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/await.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/bigint.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/buffer.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/custom_keyword.rs (99%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/custom_punctuation.rs (99%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/data.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/derive.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/discouraged.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/error.rs (99%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/export.rs (96%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/expr.rs (94%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/ext.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/file.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/gen/clone.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/gen/debug.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/gen/eq.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/gen/fold.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/gen/hash.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/gen/visit.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/gen/visit_mut.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/gen_helper.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/generics.rs (98%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/group.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/ident.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/item.rs (94%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/lib.rs (98%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/lifetime.rs (93%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/lit.rs (99%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/lookahead.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/mac.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/macros.rs (87%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/op.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/parse.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/parse_macro_input.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/parse_quote.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/pat.rs (95%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/path.rs (89%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/print.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/punctuated.rs (97%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/reserved.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/sealed.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/span.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/spanned.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/stmt.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/thread.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/token.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/tt.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/ty.rs (95%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/verbatim.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/src/whitespace.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/.gitignore (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/common/eq.rs (82%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/common/mod.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/common/parse.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/debug/gen.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/debug/mod.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/macros/mod.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/repo/mod.rs (96%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/repo/progress.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_asyncness.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_attribute.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_derive_input.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_expr.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_generics.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_grouping.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_ident.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_item.rs (61%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_iterators.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_lit.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_meta.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_parse_buffer.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_parse_stream.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_pat.rs (84%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_path.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_precedence.rs (96%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_receiver.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_round_trip.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_shebang.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_should_parse.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_size.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_stmt.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_token_trees.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_ty.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/test_visibility.rs (100%) rename third_party/cargo/vendor/{syn-1.0.58 => syn-1.0.68}/tests/zzz_stable.rs (100%) delete mode 100644 third_party/cargo/vendor/thiserror-1.0.23/tests/ui/no-display.stderr rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/.cargo-checksum.json (84%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/BUILD.bazel (95%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/Cargo.toml (96%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{syn-1.0.58 => thiserror-1.0.24}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/README.md (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/src/aserror.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/src/display.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/src/lib.rs (99%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/compiletest.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/test_backtrace.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/test_deprecated.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/test_display.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/test_error.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/test_expr.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/test_from.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/test_lints.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/test_option.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/test_path.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/test_source.rs (79%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/test_transparent.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/bad-field-attr.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/bad-field-attr.stderr (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/concat-display.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/concat-display.stderr (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/duplicate-enum-source.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/duplicate-enum-source.stderr (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/duplicate-fmt.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/duplicate-fmt.stderr (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/duplicate-struct-source.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/duplicate-struct-source.stderr (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/duplicate-transparent.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/duplicate-transparent.stderr (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/from-not-source.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/from-not-source.stderr (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/lifetime.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/lifetime.stderr (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/missing-fmt.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/missing-fmt.stderr (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/no-display.rs (100%) create mode 100644 third_party/cargo/vendor/thiserror-1.0.24/tests/ui/no-display.stderr rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/source-enum-not-error.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/source-enum-not-error.stderr (62%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/source-struct-not-error.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/source-struct-not-error.stderr (58%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/transparent-display.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/transparent-display.stderr (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/transparent-enum-many.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/transparent-enum-many.stderr (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/transparent-enum-source.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/transparent-enum-source.stderr (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/transparent-struct-many.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/transparent-struct-many.stderr (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/transparent-struct-source.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/transparent-struct-source.stderr (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/unexpected-field-fmt.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/unexpected-field-fmt.stderr (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/unexpected-struct-source.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/unexpected-struct-source.stderr (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/union.rs (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-1.0.24}/tests/ui/union.stderr (100%) delete mode 100644 third_party/cargo/vendor/thiserror-impl-1.0.23/.cargo-checksum.json delete mode 100644 third_party/cargo/vendor/thiserror-impl-1.0.23/LICENSE-MIT create mode 100644 third_party/cargo/vendor/thiserror-impl-1.0.24/.cargo-checksum.json rename third_party/cargo/vendor/{thiserror-impl-1.0.23 => thiserror-impl-1.0.24}/BUILD.bazel (83%) rename third_party/cargo/vendor/{thiserror-impl-1.0.23 => thiserror-impl-1.0.24}/Cargo.toml (98%) rename third_party/cargo/vendor/{thiserror-impl-1.0.23 => thiserror-impl-1.0.24}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{thiserror-1.0.23 => thiserror-impl-1.0.24}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{thiserror-impl-1.0.23 => thiserror-impl-1.0.24}/src/ast.rs (100%) rename third_party/cargo/vendor/{thiserror-impl-1.0.23 => thiserror-impl-1.0.24}/src/attr.rs (100%) rename third_party/cargo/vendor/{thiserror-impl-1.0.23 => thiserror-impl-1.0.24}/src/expand.rs (96%) rename third_party/cargo/vendor/{thiserror-impl-1.0.23 => thiserror-impl-1.0.24}/src/fmt.rs (100%) rename third_party/cargo/vendor/{thiserror-impl-1.0.23 => thiserror-impl-1.0.24}/src/lib.rs (62%) rename third_party/cargo/vendor/{thiserror-impl-1.0.23 => thiserror-impl-1.0.24}/src/prop.rs (100%) rename third_party/cargo/vendor/{thiserror-impl-1.0.23 => thiserror-impl-1.0.24}/src/valid.rs (97%) delete mode 100644 third_party/cargo/vendor/thread_local-1.1.0/.cargo-checksum.json delete mode 100644 third_party/cargo/vendor/thread_local-1.1.0/BUILD.bazel delete mode 100644 third_party/cargo/vendor/thread_local-1.1.0/Cargo.toml delete mode 100644 third_party/cargo/vendor/thread_local-1.1.0/LICENSE-MIT delete mode 100644 third_party/cargo/vendor/thread_local-1.1.0/README.md delete mode 100644 third_party/cargo/vendor/thread_local-1.1.0/benches/thread_local.rs delete mode 100644 third_party/cargo/vendor/thread_local-1.1.0/src/cached.rs delete mode 100644 third_party/cargo/vendor/thread_local-1.1.0/src/lib.rs delete mode 100644 third_party/cargo/vendor/thread_local-1.1.0/src/thread_id.rs delete mode 100644 third_party/cargo/vendor/thread_local-1.1.0/src/unreachable.rs delete mode 100644 third_party/cargo/vendor/version_check-0.9.2/LICENSE-APACHE rename third_party/cargo/vendor/{version_check-0.9.2 => version_check-0.9.3}/.cargo-checksum.json (51%) rename third_party/cargo/vendor/{version_check-0.9.2 => version_check-0.9.3}/BUILD.bazel (97%) rename third_party/cargo/vendor/{version_check-0.9.2 => version_check-0.9.3}/Cargo.toml (98%) rename third_party/cargo/vendor/{thread_local-1.1.0 => version_check-0.9.3}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{version_check-0.9.2 => version_check-0.9.3}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{version_check-0.9.2 => version_check-0.9.3}/README.md (100%) rename third_party/cargo/vendor/{version_check-0.9.2 => version_check-0.9.3}/src/channel.rs (100%) rename third_party/cargo/vendor/{version_check-0.9.2 => version_check-0.9.3}/src/date.rs (100%) rename third_party/cargo/vendor/{version_check-0.9.2 => version_check-0.9.3}/src/lib.rs (62%) rename third_party/cargo/vendor/{version_check-0.9.2 => version_check-0.9.3}/src/version.rs (100%) delete mode 100644 third_party/cargo/vendor/walkdir-2.3.1/.cargo-checksum.json create mode 100644 third_party/cargo/vendor/walkdir-2.3.2/.cargo-checksum.json rename third_party/cargo/vendor/{walkdir-2.3.1 => walkdir-2.3.2}/BUILD.bazel (98%) rename third_party/cargo/vendor/{walkdir-2.3.1 => walkdir-2.3.2}/COPYING (100%) rename third_party/cargo/vendor/{walkdir-2.3.1 => walkdir-2.3.2}/Cargo.toml (98%) rename third_party/cargo/vendor/{walkdir-2.3.1 => walkdir-2.3.2}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{walkdir-2.3.1 => walkdir-2.3.2}/README.md (96%) rename third_party/cargo/vendor/{walkdir-2.3.1 => walkdir-2.3.2}/UNLICENSE (100%) rename third_party/cargo/vendor/{walkdir-2.3.1 => walkdir-2.3.2}/compare/nftw.c (100%) rename third_party/cargo/vendor/{walkdir-2.3.1 => walkdir-2.3.2}/compare/walk.py (100%) create mode 100644 third_party/cargo/vendor/walkdir-2.3.2/rustfmt.toml rename third_party/cargo/vendor/{walkdir-2.3.1 => walkdir-2.3.2}/src/dent.rs (100%) rename third_party/cargo/vendor/{walkdir-2.3.1 => walkdir-2.3.2}/src/error.rs (99%) rename third_party/cargo/vendor/{walkdir-2.3.1 => walkdir-2.3.2}/src/lib.rs (96%) rename third_party/cargo/vendor/{walkdir-2.3.1 => walkdir-2.3.2}/src/tests/mod.rs (100%) rename third_party/cargo/vendor/{walkdir-2.3.1 => walkdir-2.3.2}/src/tests/recursive.rs (95%) rename third_party/cargo/vendor/{walkdir-2.3.1 => walkdir-2.3.2}/src/tests/util.rs (100%) rename third_party/cargo/vendor/{walkdir-2.3.1 => walkdir-2.3.2}/src/util.rs (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/.cargo-checksum.json (66%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/BUILD.bazel (83%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/Cargo.lock (72%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/Cargo.toml (93%) rename third_party/cargo/vendor/{wayland-commons-0.28.3 => wayland-client-0.28.5}/LICENSE.txt (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/README.md (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/build.rs (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/examples/dynamic_globals.rs (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/examples/list_globals.rs (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/examples/simple_window.rs (82%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/src/display.rs (98%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/src/event_queue.rs (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/src/globals.rs (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/src/lib.rs (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/src/native_lib/display.rs (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/src/native_lib/event_queue.rs (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/src/native_lib/mod.rs (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/src/native_lib/proxy.rs (90%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/src/proxy.rs (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/src/rust_imp/connection.rs (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/src/rust_imp/display.rs (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/src/rust_imp/mod.rs (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/src/rust_imp/proxy.rs (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/src/rust_imp/queues.rs (100%) rename third_party/cargo/vendor/{wayland-client-0.28.3 => wayland-client-0.28.5}/wayland.xml (100%) delete mode 100644 third_party/cargo/vendor/wayland-commons-0.28.3/.cargo-checksum.json create mode 100644 third_party/cargo/vendor/wayland-commons-0.28.5/.cargo-checksum.json rename third_party/cargo/vendor/{wayland-commons-0.28.3 => wayland-commons-0.28.5}/BUILD.bazel (80%) rename third_party/cargo/vendor/{wayland-commons-0.28.3 => wayland-commons-0.28.5}/Cargo.lock (65%) rename third_party/cargo/vendor/{wayland-commons-0.28.3 => wayland-commons-0.28.5}/Cargo.toml (93%) rename third_party/cargo/vendor/{wayland-cursor-0.28.3 => wayland-commons-0.28.5}/LICENSE.txt (100%) rename third_party/cargo/vendor/{wayland-commons-0.28.3 => wayland-commons-0.28.5}/README.md (100%) rename third_party/cargo/vendor/{wayland-commons-0.28.3 => wayland-commons-0.28.5}/examples/manual_global_list.rs (100%) rename third_party/cargo/vendor/{wayland-commons-0.28.3 => wayland-commons-0.28.5}/src/debug.rs (100%) rename third_party/cargo/vendor/{wayland-commons-0.28.3 => wayland-commons-0.28.5}/src/filter.rs (100%) rename third_party/cargo/vendor/{wayland-commons-0.28.3 => wayland-commons-0.28.5}/src/lib.rs (95%) rename third_party/cargo/vendor/{wayland-commons-0.28.3 => wayland-commons-0.28.5}/src/map.rs (97%) rename third_party/cargo/vendor/{wayland-commons-0.28.3 => wayland-commons-0.28.5}/src/socket.rs (99%) rename third_party/cargo/vendor/{wayland-commons-0.28.3 => wayland-commons-0.28.5}/src/user_data.rs (100%) rename third_party/cargo/vendor/{wayland-commons-0.28.3 => wayland-commons-0.28.5}/src/wire.rs (99%) delete mode 100644 third_party/cargo/vendor/wayland-cursor-0.28.3/.cargo-checksum.json create mode 100644 third_party/cargo/vendor/wayland-cursor-0.28.5/.cargo-checksum.json rename third_party/cargo/vendor/{wayland-cursor-0.28.3 => wayland-cursor-0.28.5}/BUILD.bazel (88%) rename third_party/cargo/vendor/{wayland-cursor-0.28.3 => wayland-cursor-0.28.5}/Cargo.toml (93%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-cursor-0.28.5}/LICENSE.txt (100%) rename third_party/cargo/vendor/{wayland-cursor-0.28.3 => wayland-cursor-0.28.5}/README.md (100%) rename third_party/cargo/vendor/{wayland-cursor-0.28.3 => wayland-cursor-0.28.5}/src/lib.rs (96%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/.cargo-checksum.json (97%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/BUILD.bazel (88%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/Cargo.toml (93%) rename third_party/cargo/vendor/{wayland-scanner-0.28.3 => wayland-protocols-0.28.5}/LICENSE.txt (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/README.md (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/build.rs (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/misc/gtk-primary-selection.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/COPYING (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/GOVERNANCE.md (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/MEMBERS.md (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/Makefile.am (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/README.md (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/autogen.sh (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/configure.ac (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/m4/compat.m4 (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/stable/presentation-time/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/stable/presentation-time/presentation-time.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/stable/viewporter/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/stable/viewporter/viewporter.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/stable/xdg-shell/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/stable/xdg-shell/xdg-shell.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/tests/scan.sh (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/fullscreen-shell/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/fullscreen-shell/fullscreen-shell-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/idle-inhibit/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/input-method/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/input-method/input-method-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/input-timestamps/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/input-timestamps/input-timestamps-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/keyboard-shortcuts-inhibit/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/linux-dmabuf/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/linux-explicit-synchronization/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/linux-explicit-synchronization/linux-explicit-synchronization-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/pointer-constraints/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/pointer-gestures/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/primary-selection/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/primary-selection/primary-selection-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/relative-pointer/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/relative-pointer/relative-pointer-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/tablet/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/tablet/tablet-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/tablet/tablet-unstable-v2.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/text-input/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/text-input/text-input-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/text-input/text-input-unstable-v3.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/xdg-decoration/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/xdg-foreign/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/xdg-foreign/xdg-foreign-unstable-v2.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/xdg-output/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/xdg-output/xdg-output-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/xdg-shell/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/xdg-shell/xdg-shell-unstable-v5.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/xdg-shell/xdg-shell-unstable-v6.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/xwayland-keyboard-grab/README (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/unstable/xwayland-keyboard-grab/xwayland-keyboard-grab-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/wayland-protocols-uninstalled.pc.in (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/protocols/wayland-protocols.pc.in (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/src/lib.rs (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/src/misc.rs (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/src/protocol_macro.rs (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/src/stable.rs (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/src/unstable.rs (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/src/wlr.rs (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/wlr-protocols/Makefile (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/wlr-protocols/README.md (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/wlr-protocols/check.sh (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/wlr-protocols/unstable/wlr-data-control-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/wlr-protocols/unstable/wlr-export-dmabuf-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/wlr-protocols/unstable/wlr-foreign-toplevel-management-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/wlr-protocols/unstable/wlr-gamma-control-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/wlr-protocols/unstable/wlr-input-inhibitor-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/wlr-protocols/unstable/wlr-layer-shell-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/wlr-protocols/unstable/wlr-output-management-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/wlr-protocols/unstable/wlr-output-power-management-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/wlr-protocols/unstable/wlr-screencopy-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/wlr-protocols/unstable/wlr-virtual-pointer-unstable-v1.xml (100%) rename third_party/cargo/vendor/{wayland-protocols-0.28.3 => wayland-protocols-0.28.5}/wlr-protocols/wlr-protocols.pc.in (100%) rename third_party/cargo/vendor/{wayland-scanner-0.28.3 => wayland-scanner-0.28.5}/.cargo-checksum.json (63%) rename third_party/cargo/vendor/{wayland-scanner-0.28.3 => wayland-scanner-0.28.5}/BUILD.bazel (88%) rename third_party/cargo/vendor/{wayland-scanner-0.28.3 => wayland-scanner-0.28.5}/Cargo.toml (97%) rename third_party/cargo/vendor/{wayland-sys-0.28.3 => wayland-scanner-0.28.5}/LICENSE.txt (100%) rename third_party/cargo/vendor/{wayland-scanner-0.28.3 => wayland-scanner-0.28.5}/README.md (100%) rename third_party/cargo/vendor/{wayland-scanner-0.28.3 => wayland-scanner-0.28.5}/src/c_code_gen.rs (100%) rename third_party/cargo/vendor/{wayland-scanner-0.28.3 => wayland-scanner-0.28.5}/src/c_interface_gen.rs (100%) rename third_party/cargo/vendor/{wayland-scanner-0.28.3 => wayland-scanner-0.28.5}/src/common_gen.rs (99%) rename third_party/cargo/vendor/{wayland-scanner-0.28.3 => wayland-scanner-0.28.5}/src/lib.rs (100%) rename third_party/cargo/vendor/{wayland-scanner-0.28.3 => wayland-scanner-0.28.5}/src/parse.rs (100%) rename third_party/cargo/vendor/{wayland-scanner-0.28.3 => wayland-scanner-0.28.5}/src/protocol.rs (100%) rename third_party/cargo/vendor/{wayland-scanner-0.28.3 => wayland-scanner-0.28.5}/src/side.rs (100%) rename third_party/cargo/vendor/{wayland-scanner-0.28.3 => wayland-scanner-0.28.5}/src/util.rs (100%) delete mode 100644 third_party/cargo/vendor/wayland-sys-0.28.3/.cargo-checksum.json create mode 100644 third_party/cargo/vendor/wayland-sys-0.28.5/.cargo-checksum.json rename third_party/cargo/vendor/{wayland-sys-0.28.3 => wayland-sys-0.28.5}/BUILD.bazel (93%) rename third_party/cargo/vendor/{wayland-sys-0.28.3 => wayland-sys-0.28.5}/Cargo.toml (92%) create mode 100644 third_party/cargo/vendor/wayland-sys-0.28.5/LICENSE.txt rename third_party/cargo/vendor/{wayland-sys-0.28.3 => wayland-sys-0.28.5}/README.md (100%) rename third_party/cargo/vendor/{wayland-sys-0.28.3 => wayland-sys-0.28.5}/build.rs (100%) rename third_party/cargo/vendor/{wayland-sys-0.28.3 => wayland-sys-0.28.5}/src/client.rs (97%) rename third_party/cargo/vendor/{wayland-sys-0.28.3 => wayland-sys-0.28.5}/src/common.rs (100%) rename third_party/cargo/vendor/{wayland-sys-0.28.3 => wayland-sys-0.28.5}/src/cursor.rs (95%) rename third_party/cargo/vendor/{wayland-sys-0.28.3 => wayland-sys-0.28.5}/src/egl.rs (94%) rename third_party/cargo/vendor/{wayland-sys-0.28.3 => wayland-sys-0.28.5}/src/lib.rs (100%) rename third_party/cargo/vendor/{wayland-sys-0.28.3 => wayland-sys-0.28.5}/src/server.rs (99%) delete mode 100644 third_party/cargo/vendor/weezl-0.1.3/.cargo-checksum.json delete mode 100644 third_party/cargo/vendor/weezl-0.1.3/Cargo.lock create mode 100644 third_party/cargo/vendor/weezl-0.1.4/.cargo-checksum.json rename third_party/cargo/vendor/{weezl-0.1.3 => weezl-0.1.4}/BUILD.bazel (94%) create mode 100644 third_party/cargo/vendor/weezl-0.1.4/Cargo.lock rename third_party/cargo/vendor/{weezl-0.1.3 => weezl-0.1.4}/Cargo.toml (75%) rename third_party/cargo/vendor/{weezl-0.1.3 => weezl-0.1.4}/Changes.md (66%) rename third_party/cargo/vendor/{weezl-0.1.3 => weezl-0.1.4}/LICENSE-APACHE (100%) rename third_party/cargo/vendor/{weezl-0.1.3 => weezl-0.1.4}/LICENSE-MIT (100%) rename third_party/cargo/vendor/{weezl-0.1.3 => weezl-0.1.4}/README.md (100%) rename third_party/cargo/vendor/{weezl-0.1.3 => weezl-0.1.4}/benches/msb8.rs (100%) rename third_party/cargo/vendor/{weezl-0.1.3 => weezl-0.1.4}/bin/lzw.rs (100%) rename third_party/cargo/vendor/{weezl-0.1.3 => weezl-0.1.4}/examples/lzw-compress.rs (100%) rename third_party/cargo/vendor/{weezl-0.1.3 => weezl-0.1.4}/examples/lzw-decompress.rs (100%) rename third_party/cargo/vendor/{weezl-0.1.3 => weezl-0.1.4}/src/decode.rs (97%) create mode 100644 third_party/cargo/vendor/weezl-0.1.4/src/decode_into_async.rs rename third_party/cargo/vendor/{weezl-0.1.3 => weezl-0.1.4}/src/encode.rs (96%) create mode 100644 third_party/cargo/vendor/weezl-0.1.4/src/encode_into_async.rs rename third_party/cargo/vendor/{weezl-0.1.3 => weezl-0.1.4}/src/error.rs (100%) rename third_party/cargo/vendor/{weezl-0.1.3 => weezl-0.1.4}/src/lib.rs (95%) create mode 100644 third_party/cargo/vendor/weezl-0.1.4/tests/async.rs rename third_party/cargo/vendor/{weezl-0.1.3 => weezl-0.1.4}/tests/roundtrip.rs (90%) diff --git a/third_party/cargo/BUILD.bazel b/third_party/cargo/BUILD.bazel index de384c6..ce75c69 100644 --- a/third_party/cargo/BUILD.bazel +++ b/third_party/cargo/BUILD.bazel @@ -41,7 +41,7 @@ alias( alias( name = "image", - actual = "//third_party/cargo/vendor/image-0.23.12:image", + actual = "//third_party/cargo/vendor/image-0.23.14:image", tags = [ "cargo-raze", "manual", @@ -50,7 +50,7 @@ alias( alias( name = "log", - actual = "//third_party/cargo/vendor/log-0.4.11:log", + actual = "//third_party/cargo/vendor/log-0.4.14:log", tags = [ "cargo-raze", "manual", @@ -59,7 +59,7 @@ alias( alias( name = "proc_macro2", - actual = "//third_party/cargo/vendor/proc-macro2-1.0.24:proc_macro2", + actual = "//third_party/cargo/vendor/proc-macro2-1.0.26:proc_macro2", tags = [ "cargo-raze", "manual", @@ -68,7 +68,7 @@ alias( alias( name = "quote", - actual = "//third_party/cargo/vendor/quote-1.0.8:quote", + actual = "//third_party/cargo/vendor/quote-1.0.9:quote", tags = [ "cargo-raze", "manual", @@ -77,7 +77,7 @@ alias( alias( name = "syn", - actual = "//third_party/cargo/vendor/syn-1.0.58:syn", + actual = "//third_party/cargo/vendor/syn-1.0.68:syn", tags = [ "cargo-raze", "manual", diff --git a/third_party/cargo/Cargo.lock b/third_party/cargo/Cargo.lock index 847312f..009cb0a 100644 --- a/third_party/cargo/Cargo.lock +++ b/third_party/cargo/Cargo.lock @@ -8,9 +8,9 @@ checksum = "d9fe5e32de01730eb1f6b7f5b51c17e03e2325bf40a74f754f04f130043affff" [[package]] name = "adler" -version = "0.2.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "adler32" @@ -80,15 +80,15 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "bytemuck" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41aa2ec95ca3b5c54cf73c91acf06d24f4495d5f1b1c12506ae3483d646177ac" +checksum = "bed57e2090563b83ba8f83366628ce535a7584c9afa4c9fc0612a03925c6df58" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "calloop" @@ -102,9 +102,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" +checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" [[package]] name = "cfg-if" @@ -189,18 +189,14 @@ dependencies = [ "flatbuffers", "image", "log", - "nix 0.19.1", + "proc-macro2", + "quote", + "syn", "vulkano", "vulkano-win", "winit", ] -[[package]] -name = "const_fn" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6" - [[package]] name = "core-foundation" version = "0.7.0" @@ -323,7 +319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.1", + "crossbeam-utils 0.8.3", ] [[package]] @@ -344,8 +340,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" dependencies = [ "cfg-if 1.0.0", - "crossbeam-epoch 0.9.1", - "crossbeam-utils 0.8.1", + "crossbeam-epoch 0.9.3", + "crossbeam-utils 0.8.3", ] [[package]] @@ -365,15 +361,14 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1aaa739f95311c2c7887a76863f500026092fb1dce0161dab577e559ef3569d" +checksum = "2584f639eb95fea8c798496315b297cf81b9b58b6d30ab066a75455333cf4b12" dependencies = [ "cfg-if 1.0.0", - "const_fn", - "crossbeam-utils 0.8.1", + "crossbeam-utils 0.8.3", "lazy_static", - "memoffset 0.6.1", + "memoffset 0.6.3", "scopeguard", ] @@ -401,9 +396,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d" +checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" dependencies = [ "autocfg", "cfg-if 1.0.0", @@ -457,9 +452,9 @@ dependencies = [ [[package]] name = "derivative" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaed5874effa6cde088c644ddcdcb4ffd1511391c5be4fdd7a5ccd02c7e4a183" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", @@ -478,7 +473,16 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" dependencies = [ - "libloading", + "libloading 0.6.7", +] + +[[package]] +name = "dlib" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" +dependencies = [ + "libloading 0.7.0", ] [[package]] @@ -554,9 +558,9 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "gif" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02efba560f227847cb41463a7395c514d127d4f74fff12ef0137fff1b84b96c4" +checksum = "5a668f699973d0f573d15749b7002a9ac9e1f9c6b220e7b165601334c173d8de" dependencies = [ "color_quant", "weezl", @@ -564,15 +568,15 @@ dependencies = [ [[package]] name = "half" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36fab90f82edc3c747f9d438e06cf0a491055896f2a279638bb5beed6c40177" +checksum = "62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3" [[package]] name = "hermit-abi" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" +checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" dependencies = [ "libc", ] @@ -594,9 +598,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "image" -version = "0.23.12" +version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ce04077ead78e39ae8610ad26216aed811996b043d47beed5090db674f9e9b5" +checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1" dependencies = [ "bytemuck", "byteorder", @@ -637,11 +641,10 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jpeg-decoder" -version = "0.1.20" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc797adac5f083b8ff0ca6f6294a999393d76e197c36488e2ef732c4715f6fa3" +checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2" dependencies = [ - "byteorder", "rayon", ] @@ -669,15 +672,25 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.82" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89203f3fba0a3795506acaad8ebce3c80c0af93f994d5a1d7a0b1eeb23271929" +checksum = "56d855069fafbb9b344c0f962150cd2c1187975cb1c22c1522c240d8c4986714" [[package]] name = "libloading" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9367bdfa836b7e3cf895867f7a570283444da90562980ec2263d6e1569b16bc" +checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" +dependencies = [ + "cfg-if 1.0.0", + "winapi 0.3.9", +] + +[[package]] +name = "libloading" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" dependencies = [ "cfg-if 1.0.0", "winapi 0.3.9", @@ -685,20 +698,20 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" +checksum = "5a3c91c24eae6777794bb1997ad98bbb87daf92890acab859f7eaa4320333176" dependencies = [ "scopeguard", ] [[package]] name = "log" -version = "0.4.11" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", ] [[package]] @@ -742,9 +755,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.6.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" +checksum = "f83fb6581e8ed1f85fd45c116db8405483899489e38406156c25eb743554361d" dependencies = [ "autocfg", ] @@ -775,9 +788,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" dependencies = [ "adler", "autocfg", @@ -896,9 +909,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.19.1" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ccba0cfe4fdf15982d1674c69b1fd80bad427d293849982668dfe454bd61f2" +checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a" dependencies = [ "bitflags", "cc", @@ -908,9 +921,9 @@ dependencies = [ [[package]] name = "nom" -version = "6.0.1" +version = "6.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88034cfd6b4a0d54dd14f4a507eceee36c0b70e5a02236c4e4df571102be17f0" +checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2" dependencies = [ "memchr", "version_check", @@ -1010,9 +1023,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.5.2" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" +checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" [[package]] name = "owned_ttf_parser" @@ -1036,9 +1049,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccb628cad4f84851442432c60ad8e1f607e29752d0bf072cbd0baf28aa34272" +checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" dependencies = [ "cfg-if 1.0.0", "instant", @@ -1083,9 +1096,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" dependencies = [ "unicode-xid", ] @@ -1098,9 +1111,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" +checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" dependencies = [ "proc-macro2", ] @@ -1134,34 +1147,36 @@ checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" dependencies = [ "crossbeam-channel 0.5.0", "crossbeam-deque 0.8.0", - "crossbeam-utils 0.8.1", + "crossbeam-utils 0.8.3", "lazy_static", "num_cpus", ] [[package]] name = "redox_syscall" -version = "0.1.57" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" +checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" +dependencies = [ + "bitflags", +] [[package]] name = "regex" -version = "1.4.2" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" +checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" dependencies = [ "aho-corasick", "memchr", "regex-syntax", - "thread_local", ] [[package]] name = "regex-syntax" -version = "0.6.21" +version = "0.6.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" +checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" [[package]] name = "rusttype" @@ -1202,9 +1217,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.118" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" +checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171" [[package]] name = "shared_library" @@ -1224,20 +1239,20 @@ checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] name = "smallvec" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a55ca5f3b68e41c979bf8c46a6f1da892ca4db8f94023ce0bd32407573b1ac0" +checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] name = "smithay-client-toolkit" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "316e13a3eb853ce7bf72ad3530dc186cb2005c57c521ef5f4ada5ee4eed74de6" +checksum = "4750c76fd5d3ac95fa3ed80fe667d6a3d8590a960e5b575b98eea93339a80b80" dependencies = [ "andrew", "bitflags", "calloop", - "dlib", + "dlib 0.4.2", "lazy_static", "log", "memmap2", @@ -1255,9 +1270,9 @@ checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" [[package]] name = "syn" -version = "1.0.58" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc60a3d73ea6594cd712d830cc1f0390fd71542d8c8cd24e70cc54cdfd5e05d5" +checksum = "3ce15dd3ed8aa2f8eeac4716d6ef5ab58b6b9256db41d7e1a0224c2788e8fd87" dependencies = [ "proc-macro2", "quote", @@ -1275,33 +1290,24 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76cc616c6abf8c8928e2fdcc0dbfab37175edd8fb49a4641066ad1364fdab146" +checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be73a2caec27583d0046ef3796c3794f868a5bc813db689eed00c7631275cd1" +checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" dependencies = [ "proc-macro2", "quote", "syn", ] -[[package]] -name = "thread_local" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb9bc092d0d51e76b2b19d9d85534ffc9ec2db959a2523cdae0697e2972cd447" -dependencies = [ - "lazy_static", -] - [[package]] name = "tiff" version = "0.6.1" @@ -1309,7 +1315,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a53f4706d65497df0c4349241deddf35f84cee19c87ed86ea8ca590f4464437" dependencies = [ "jpeg-decoder", - "miniz_oxide 0.4.3", + "miniz_oxide 0.4.4", "weezl", ] @@ -1336,9 +1342,9 @@ checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" [[package]] name = "version_check" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" [[package]] name = "vk-sys" @@ -1378,9 +1384,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ "same-file", "winapi 0.3.9", @@ -1389,14 +1395,14 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.28.3" +version = "0.28.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbdbe01d03b2267809f3ed99495b37395387fde789e0f2ebb78e8b43f75b6d7" +checksum = "06ca44d86554b85cf449f1557edc6cc7da935cc748c8e4bf1c507cbd43bae02c" dependencies = [ "bitflags", "downcast-rs", "libc", - "nix 0.18.0", + "nix 0.20.0", "scoped-tls", "wayland-commons", "wayland-scanner", @@ -1405,11 +1411,11 @@ dependencies = [ [[package]] name = "wayland-commons" -version = "0.28.3" +version = "0.28.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "480450f76717edd64ad04a4426280d737fc3d10a236b982df7b1aee19f0e2d56" +checksum = "8bd75ae380325dbcff2707f0cd9869827ea1d2d6d534cff076858d3f0460fd5a" dependencies = [ - "nix 0.18.0", + "nix 0.20.0", "once_cell", "smallvec", "wayland-sys", @@ -1417,20 +1423,20 @@ dependencies = [ [[package]] name = "wayland-cursor" -version = "0.28.3" +version = "0.28.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6eb122c160223a7660feeaf949d0100281d1279acaaed3720eb3c9894496e5f" +checksum = "b37e5455ec72f5de555ec39b5c3704036ac07c2ecd50d0bffe02d5fe2d4e65ab" dependencies = [ - "nix 0.18.0", + "nix 0.20.0", "wayland-client", "xcursor", ] [[package]] name = "wayland-protocols" -version = "0.28.3" +version = "0.28.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "319a82b4d3054dd25acc32d9aee0f84fa95b63bc983fffe4703b6b8d47e01a30" +checksum = "95df3317872bcf9eec096c864b69aa4769a1d5d6291a5b513f8ba0af0efbd52c" dependencies = [ "bitflags", "wayland-client", @@ -1440,9 +1446,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.28.3" +version = "0.28.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7010ba5767b3fcd350decc59055390b4ebe6bd1b9279a9feb1f1888987f1133d" +checksum = "389d680d7bd67512dc9c37f39560224327038deb0f0e8d33f870900441b68720" dependencies = [ "proc-macro2", "quote", @@ -1451,20 +1457,20 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.28.3" +version = "0.28.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6793834e0c35d11fd96a97297abe03d37be627e1847da52e17d7e0e3b51cc099" +checksum = "2907bd297eef464a95ba9349ea771611771aa285b932526c633dc94d5400a8e2" dependencies = [ - "dlib", + "dlib 0.5.0", "lazy_static", "pkg-config", ] [[package]] name = "weezl" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2bb9fc8309084dd7cd651336673844c1d47f8ef6d2091ec160b27f5c4aa277" +checksum = "4a32b378380f4e9869b22f0b5177c68a5519f03b3454fde0b291455ddbae266c" [[package]] name = "winapi" diff --git a/third_party/cargo/Cargo.toml b/third_party/cargo/Cargo.toml index 1d35802..7d9ce8d 100644 --- a/third_party/cargo/Cargo.toml +++ b/third_party/cargo/Cargo.toml @@ -18,6 +18,7 @@ cgmath = "0.18.0" flatbuffers = "0.6.1" quote = "1.0.8" syn = "1.0.58" +proc-macro2 = "1" [workspace.metadata.raze] workspace_path = "//third_party/cargo" @@ -30,50 +31,44 @@ rust_rules_workspace_name = "rules_rust" package_aliases_dir = "." default_gen_buildrs = false -[workspace.metadata.raze.crates.andrew.'0.2.1'] -skipped_deps = ['rusttype-0.7.9'] -additional_deps = ['//third_party/cargo/vendor/rusttype-0.8.3:rusttype'] +[workspace.metadata.raze.crates.andrew.'0.3.1'] +skipped_deps = ['rusttype-0.9.2'] +additional_deps = ['//third_party/cargo/vendor/rusttype-0.9.2:rusttype'] [workspace.metadata.raze.crates.x11-dl.'2.18.5'] gen_buildrs = true -[workspace.metadata.raze.crates.wayland-client.'0.23.6'] +[workspace.metadata.raze.crates.wayland-client.'0.28.5'] gen_buildrs = true -[workspace.metadata.raze.crates.wayland-protocols.'0.23.6'] +[workspace.metadata.raze.crates.wayland-protocols.'0.28.5'] gen_buildrs = true -[workspace.metadata.raze.crates.log.'0.4.8'] +[workspace.metadata.raze.crates.log.'0.4.14'] additional_flags = [ "--cfg=atomic_cas" ] -[workspace.metadata.raze.crates.libloading.'0.6.6'] +[workspace.metadata.raze.crates.libloading.'0.7.0'] additional_deps = ['//third_party/cargo/patches:libloading_global_static'] [workspace.metadata.raze.crates.cgmath.'0.18.0'] gen_buildrs = true -[workspace.metadata.raze.crates.image.'0.23.12'] +[workspace.metadata.raze.crates.image.'0.23.14'] gen_buildrs = true [workspace.metadata.raze.crates.num-rational.'0.3.2'] gen_buildrs = true -[workspace.metadata.raze.crates.libc.'0.2.82'] -gen_buildrs = true - -[workspace.metadata.raze.crates.wayland-client.'0.28.3'] -gen_buildrs = true - -[workspace.metadata.raze.crates.wayland-protocols.'0.28.3'] +[workspace.metadata.raze.crates.libc.'0.2.92'] gen_buildrs = true [workspace.metadata.raze.crates.maybe-uninit.'2.0.0'] gen_buildrs = true -[workspace.metadata.raze.crates.winapi.'0.3.9'] +[workspace.metadata.raze.crates.winapi.'0.4.0'] gen_buildrs = true -[workspace.metadata.raze.crates.proc-macro2.'1.0.24'] +[workspace.metadata.raze.crates.proc-macro2.'1.0.26'] gen_buildrs = true diff --git a/third_party/cargo/patches/BUILD.bazel b/third_party/cargo/patches/BUILD.bazel index e9923fc..1dd2064 100644 --- a/third_party/cargo/patches/BUILD.bazel +++ b/third_party/cargo/patches/BUILD.bazel @@ -2,5 +2,5 @@ cc_library( name = "libloading_global_static", srcs = ["libloading/global_static.c"], copts = ["-fPIC"], - visibility = ["//third_party/cargo/vendor/libloading-0.6.6:__pkg__"], + visibility = ["//third_party/cargo/vendor:__subpackages__"], ) diff --git a/third_party/cargo/vendor/adler-0.2.3/.cargo-checksum.json b/third_party/cargo/vendor/adler-0.2.3/.cargo-checksum.json deleted file mode 100644 index d06d0a5..0000000 --- a/third_party/cargo/vendor/adler-0.2.3/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"CHANGELOG.md":"042ed3158af7000c88a6617d775f11456bd30f6c7c8b5b586978faa1e11b1e24","Cargo.toml":"107d13689eecfa82a8b5ae35bf835b9d2775337226630e4bdb35f22d0dd52e18","LICENSE-0BSD":"861399f8c21c042b110517e76dc6b63a2b334276c8cf17412fc3c8908ca8dc17","LICENSE-APACHE":"8ada45cd9f843acf64e4722ae262c622a2b3b3007c7310ef36ac1061a30f6adb","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"fa83fd5ee10b61827de382e496bf66296a526e3d2c3b2aa5ad672aa15e8d2d7f","RELEASE_PROCESS.md":"a86cd10fc70f167f8d00e9e4ce0c6b4ebdfa1865058390dffd1e0ad4d3e68d9d","benches/bench.rs":"c07ce370e3680c602e415f8d1ec4e543ea2163ab22a09b6b82d93e8a30adca82","src/algo.rs":"b664b131f724a809591394a10b9023f40ab5963e32a83fa3163c2668e59c8b66","src/lib.rs":"67f3ca5b6333e22745b178b70f472514162cea2890344724f0f66995fcf19806"},"package":"ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"} \ No newline at end of file diff --git a/third_party/cargo/vendor/adler-1.0.2/.cargo-checksum.json b/third_party/cargo/vendor/adler-1.0.2/.cargo-checksum.json new file mode 100644 index 0000000..3ccbf01 --- /dev/null +++ b/third_party/cargo/vendor/adler-1.0.2/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"737088e45fdf27fe2cfedce163332d8ce08c58fd86ca287de2de34c0fbaf63e7","Cargo.toml":"f410869f0f1a5697f65a8a77be03da7aeecc0be26e7cf3a1feb1acaa4f518770","LICENSE-0BSD":"861399f8c21c042b110517e76dc6b63a2b334276c8cf17412fc3c8908ca8dc17","LICENSE-APACHE":"8ada45cd9f843acf64e4722ae262c622a2b3b3007c7310ef36ac1061a30f6adb","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"308c50cdb42b9573743068158339570b45ca3f895015ca3b87ba983edb0a21e6","RELEASE_PROCESS.md":"a86cd10fc70f167f8d00e9e4ce0c6b4ebdfa1865058390dffd1e0ad4d3e68d9d","benches/bench.rs":"c07ce370e3680c602e415f8d1ec4e543ea2163ab22a09b6b82d93e8a30adca82","src/algo.rs":"b664b131f724a809591394a10b9023f40ab5963e32a83fa3163c2668e59c8b66","src/lib.rs":"b55ba9c629b30360d08168b2ca0c96275432856a539737a105a6d6ae6bf7e88f"},"package":"f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"} \ No newline at end of file diff --git a/third_party/cargo/vendor/adler-0.2.3/BUILD.bazel b/third_party/cargo/vendor/adler-1.0.2/BUILD.bazel similarity index 97% rename from third_party/cargo/vendor/adler-0.2.3/BUILD.bazel rename to third_party/cargo/vendor/adler-1.0.2/BUILD.bazel index e3eecd8..74c41d0 100644 --- a/third_party/cargo/vendor/adler-0.2.3/BUILD.bazel +++ b/third_party/cargo/vendor/adler-1.0.2/BUILD.bazel @@ -48,7 +48,7 @@ rust_library( "cargo-raze", "manual", ], - version = "0.2.3", + version = "1.0.2", # buildifier: leave-alone deps = [ ], diff --git a/third_party/cargo/vendor/adler-0.2.3/CHANGELOG.md b/third_party/cargo/vendor/adler-1.0.2/CHANGELOG.md similarity index 52% rename from third_party/cargo/vendor/adler-0.2.3/CHANGELOG.md rename to third_party/cargo/vendor/adler-1.0.2/CHANGELOG.md index f055938..8799437 100644 --- a/third_party/cargo/vendor/adler-0.2.3/CHANGELOG.md +++ b/third_party/cargo/vendor/adler-1.0.2/CHANGELOG.md @@ -4,6 +4,35 @@ No changes. +## [1.0.2 - 2021-02-26](https://github.com/jonas-schievink/adler/releases/tag/v1.0.2) + +- Fix doctest on big-endian systems ([#9]). + +[#9]: https://github.com/jonas-schievink/adler/pull/9 + +## [1.0.1 - 2020-11-08](https://github.com/jonas-schievink/adler/releases/tag/v1.0.1) + +### Fixes + +- Fix documentation on docs.rs. + +## [1.0.0 - 2020-11-08](https://github.com/jonas-schievink/adler/releases/tag/v1.0.0) + +### Fixes + +- Fix `cargo test --no-default-features` ([#5]). + +### Improvements + +- Extended and clarified documentation. +- Added more rustdoc examples. +- Extended CI to test the crate with `--no-default-features`. + +### Breaking Changes + +- `adler32_reader` now takes its generic argument by value instead of as a `&mut`. +- Renamed `adler32_reader` to `adler32`. + ## [0.2.3 - 2020-07-11](https://github.com/jonas-schievink/adler/releases/tag/v0.2.3) - Process 4 Bytes at a time, improving performance by up to 50% ([#2]). @@ -31,3 +60,4 @@ Initial release. [#2]: https://github.com/jonas-schievink/adler/pull/2 +[#5]: https://github.com/jonas-schievink/adler/pull/5 diff --git a/third_party/cargo/vendor/adler-0.2.3/Cargo.toml b/third_party/cargo/vendor/adler-1.0.2/Cargo.toml similarity index 90% rename from third_party/cargo/vendor/adler-0.2.3/Cargo.toml rename to third_party/cargo/vendor/adler-1.0.2/Cargo.toml index dd2366c..1dacd2c 100644 --- a/third_party/cargo/vendor/adler-0.2.3/Cargo.toml +++ b/third_party/cargo/vendor/adler-1.0.2/Cargo.toml @@ -12,17 +12,17 @@ [package] name = "adler" -version = "0.2.3" +version = "1.0.2" authors = ["Jonas Schievink "] description = "A simple clean-room implementation of the Adler-32 checksum" documentation = "https://docs.rs/adler/" readme = "README.md" -keywords = ["checksum", "integrity", "hash", "adler32"] +keywords = ["checksum", "integrity", "hash", "adler32", "zlib"] categories = ["algorithms"] license = "0BSD OR MIT OR Apache-2.0" repository = "https://github.com/jonas-schievink/adler.git" [package.metadata.docs.rs] -rustdoc-args = ["--cfg docsrs"] +rustdoc-args = ["--cfg=docsrs"] [package.metadata.release] no-dev-version = true @@ -62,8 +62,3 @@ version = "0.3.2" default = ["std"] rustc-dep-of-std = ["core", "compiler_builtins"] std = [] -[badges.maintenance] -status = "actively-developed" - -[badges.travis-ci] -repository = "jonas-schievink/adler" diff --git a/third_party/cargo/vendor/adler-0.2.3/LICENSE-0BSD b/third_party/cargo/vendor/adler-1.0.2/LICENSE-0BSD similarity index 100% rename from third_party/cargo/vendor/adler-0.2.3/LICENSE-0BSD rename to third_party/cargo/vendor/adler-1.0.2/LICENSE-0BSD diff --git a/third_party/cargo/vendor/adler-0.2.3/LICENSE-APACHE b/third_party/cargo/vendor/adler-1.0.2/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/adler-0.2.3/LICENSE-APACHE rename to third_party/cargo/vendor/adler-1.0.2/LICENSE-APACHE diff --git a/third_party/cargo/vendor/adler-0.2.3/LICENSE-MIT b/third_party/cargo/vendor/adler-1.0.2/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/adler-0.2.3/LICENSE-MIT rename to third_party/cargo/vendor/adler-1.0.2/LICENSE-MIT diff --git a/third_party/cargo/vendor/adler-0.2.3/README.md b/third_party/cargo/vendor/adler-1.0.2/README.md similarity index 94% rename from third_party/cargo/vendor/adler-0.2.3/README.md rename to third_party/cargo/vendor/adler-1.0.2/README.md index 0254db7..ba140d5 100644 --- a/third_party/cargo/vendor/adler-0.2.3/README.md +++ b/third_party/cargo/vendor/adler-1.0.2/README.md @@ -5,7 +5,7 @@ ![CI](https://github.com/jonas-schievink/adler/workflows/CI/badge.svg) This crate provides a simple implementation of the Adler-32 checksum, used in -zlib, rsync, and other software. +the zlib compression format. Please refer to the [changelog](CHANGELOG.md) to see what changed in the last releases. @@ -14,6 +14,7 @@ releases. - Permissively licensed (0BSD) clean-room implementation. - Zero dependencies. +- Zero `unsafe`. - Decent performance (3-4 GB/s). - Supports `#![no_std]` (with `default-features = false`). @@ -23,7 +24,7 @@ Add an entry to your `Cargo.toml`: ```toml [dependencies] -adler = "0.2.3" +adler = "1.0.2" ``` Check the [API Documentation](https://docs.rs/adler/) for how to use the diff --git a/third_party/cargo/vendor/adler-0.2.3/RELEASE_PROCESS.md b/third_party/cargo/vendor/adler-1.0.2/RELEASE_PROCESS.md similarity index 100% rename from third_party/cargo/vendor/adler-0.2.3/RELEASE_PROCESS.md rename to third_party/cargo/vendor/adler-1.0.2/RELEASE_PROCESS.md diff --git a/third_party/cargo/vendor/adler-0.2.3/benches/bench.rs b/third_party/cargo/vendor/adler-1.0.2/benches/bench.rs similarity index 100% rename from third_party/cargo/vendor/adler-0.2.3/benches/bench.rs rename to third_party/cargo/vendor/adler-1.0.2/benches/bench.rs diff --git a/third_party/cargo/vendor/adler-0.2.3/src/algo.rs b/third_party/cargo/vendor/adler-1.0.2/src/algo.rs similarity index 100% rename from third_party/cargo/vendor/adler-0.2.3/src/algo.rs rename to third_party/cargo/vendor/adler-1.0.2/src/algo.rs diff --git a/third_party/cargo/vendor/adler-0.2.3/src/lib.rs b/third_party/cargo/vendor/adler-1.0.2/src/lib.rs similarity index 75% rename from third_party/cargo/vendor/adler-0.2.3/src/lib.rs rename to third_party/cargo/vendor/adler-1.0.2/src/lib.rs index ac29ea2..c7aa380 100644 --- a/third_party/cargo/vendor/adler-0.2.3/src/lib.rs +++ b/third_party/cargo/vendor/adler-1.0.2/src/lib.rs @@ -4,10 +4,11 @@ //! //! - Permissively licensed (0BSD) clean-room implementation. //! - Zero dependencies. +//! - Zero `unsafe`. //! - Decent performance (3-4 GB/s). //! - `#![no_std]` support (with `default-features = false`). -#![doc(html_root_url = "https://docs.rs/adler/0.2.3")] +#![doc(html_root_url = "https://docs.rs/adler/1.0.2")] // Deny a few warnings in doctests, since rustdoc `allow`s many warnings by default #![doc(test(attr(deny(unused_imports, unused_must_use))))] #![cfg_attr(docsrs, feature(doc_cfg))] @@ -33,8 +34,51 @@ use std::io::{self, BufRead}; /// /// This type also implements `Hasher`, which makes it easy to calculate Adler-32 checksums of any /// type that implements or derives `Hash`. This also allows using Adler-32 in a `HashMap`, although -/// that is not recommended (while every checksum is a hash, they are not necessarily good at being -/// one). +/// that is not recommended (while every checksum is a hash function, they are not necessarily a +/// good one). +/// +/// # Examples +/// +/// Basic, piecewise checksum calculation: +/// +/// ``` +/// use adler::Adler32; +/// +/// let mut adler = Adler32::new(); +/// +/// adler.write_slice(&[0, 1, 2]); +/// adler.write_slice(&[3, 4, 5]); +/// +/// assert_eq!(adler.checksum(), 0x00290010); +/// ``` +/// +/// Using `Hash` to process structures: +/// +/// ``` +/// use std::hash::Hash; +/// use adler::Adler32; +/// +/// #[derive(Hash)] +/// struct Data { +/// byte: u8, +/// word: u16, +/// big: u64, +/// } +/// +/// let mut adler = Adler32::new(); +/// +/// let data = Data { byte: 0x1F, word: 0xABCD, big: !0 }; +/// data.hash(&mut adler); +/// +/// // hash value depends on architecture endianness +/// if cfg!(target_endian = "little") { +/// assert_eq!(adler.checksum(), 0x33410990); +/// } +/// if cfg!(target_endian = "big") { +/// assert_eq!(adler.checksum(), 0x331F0990); +/// } +/// +/// ``` /// /// [`new`]: #method.new /// [`from_checksum`]: #method.from_checksum @@ -119,6 +163,10 @@ impl Hasher for Adler32 { } /// Calculates the Adler-32 checksum of a byte slice. +/// +/// This is a convenience function around the [`Adler32`] type. +/// +/// [`Adler32`]: struct.Adler32.html pub fn adler32_slice(data: &[u8]) -> u32 { let mut h = Adler32::new(); h.write_slice(data); @@ -127,12 +175,35 @@ pub fn adler32_slice(data: &[u8]) -> u32 { /// Calculates the Adler-32 checksum of a `BufRead`'s contents. /// -/// The passed `BufRead` implementor will be read until it reaches EOF. +/// The passed `BufRead` implementor will be read until it reaches EOF (or until it reports an +/// error). /// -/// If you only have a `Read` implementor, wrap it in `std::io::BufReader`. +/// If you only have a `Read` implementor, you can wrap it in `std::io::BufReader` before calling +/// this function. +/// +/// # Errors +/// +/// Any error returned by the reader are bubbled up by this function. +/// +/// # Examples +/// +/// ```no_run +/// # fn run() -> Result<(), Box> { +/// use adler::adler32; +/// +/// use std::fs::File; +/// use std::io::BufReader; +/// +/// let file = File::open("input.txt")?; +/// let mut file = BufReader::new(file); +/// +/// adler32(&mut file)?; +/// # Ok(()) } +/// # fn main() { run().unwrap() } +/// ``` #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] -pub fn adler32_reader(reader: &mut R) -> io::Result { +pub fn adler32(mut reader: R) -> io::Result { let mut h = Adler32::new(); loop { let len = { @@ -151,7 +222,6 @@ pub fn adler32_reader(reader: &mut R) -> io::Result { #[cfg(test)] mod tests { use super::*; - use std::io::BufReader; #[test] fn zeroes() { @@ -198,12 +268,14 @@ mod tests { assert_eq!(adler.checksum(), 0x8e88ef11); // from above } + #[cfg(feature = "std")] #[test] fn bufread() { + use std::io::BufReader; fn test(data: &[u8], checksum: u32) { // `BufReader` uses an 8 KB buffer, so this will test buffer refilling. let mut buf = BufReader::new(data); - let real_sum = adler32_reader(&mut buf).unwrap(); + let real_sum = adler32(&mut buf).unwrap(); assert_eq!(checksum, real_sum); } diff --git a/third_party/cargo/vendor/andrew-0.3.1/BUILD.bazel b/third_party/cargo/vendor/andrew-0.3.1/BUILD.bazel index a59db73..9578d25 100644 --- a/third_party/cargo/vendor/andrew-0.3.1/BUILD.bazel +++ b/third_party/cargo/vendor/andrew-0.3.1/BUILD.bazel @@ -52,9 +52,9 @@ rust_library( # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/bitflags-1.2.1:bitflags", - "//third_party/cargo/vendor/rusttype-0.9.2:rusttype", - "//third_party/cargo/vendor/walkdir-2.3.1:walkdir", + "//third_party/cargo/vendor/walkdir-2.3.2:walkdir", "//third_party/cargo/vendor/xdg-2.2.0:xdg", "//third_party/cargo/vendor/xml-rs-0.8.3:xml_rs", + "//third_party/cargo/vendor/rusttype-0.9.2:rusttype", ], ) diff --git a/third_party/cargo/vendor/atty-0.2.14/BUILD.bazel b/third_party/cargo/vendor/atty-0.2.14/BUILD.bazel index 78644ad..81cf9c9 100644 --- a/third_party/cargo/vendor/atty-0.2.14/BUILD.bazel +++ b/third_party/cargo/vendor/atty-0.2.14/BUILD.bazel @@ -58,7 +58,7 @@ rust_library( ( "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", ): [ - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ], "//conditions:default": [], }) + selects.with_or({ diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/.cargo-checksum.json b/third_party/cargo/vendor/bytemuck-1.4.1/.cargo-checksum.json deleted file mode 100644 index 7b8f59b..0000000 --- a/third_party/cargo/vendor/bytemuck-1.4.1/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"Cargo.toml":"6513cb751f90bc8cb94ecc29bcaaecbe4299e4d90f7d3ee207ff6b4504820ee5","LICENSE-APACHE":"e3ba223bb1423f0aad8c3dfce0fe3148db48926d41e6fbc3afbbf5ff9e1c89cb","LICENSE-MIT":"9df9ba60a11af705f2e451b53762686e615d86f76b169cf075c3237730dbd7e2","LICENSE-ZLIB":"84b34dd7608f7fb9b17bd588a6bf392bf7de504e2716f024a77d89f1b145a151","README.md":"d4c58e84661f23490ef8662cc6309b6eacf42ab939b19eaeae032c12febdd823","changelog.md":"b3592fcef45a96b2442ed1dfb2a00ffbf11578c9186be8177a3633d44a76fb9e","rustfmt.toml":"eeb0dc37ccf6e6a628fc0144cb8e7a9ebb197552cb739f9c75d6ab79ebee15db","src/allocation.rs":"c5f74c27d785cbf138159d80eb943fb16de4ff3ec0041da4fe23384b4578de16","src/contiguous.rs":"288aa77eca807f47d28c4372f6eb3fd87d885dcaf886fb725c10fdbaf1fd27d0","src/lib.rs":"ad43ebca9480fb8a68e8173d7d8949d2c38d95b746d0bd5e9b3c2d9208925aa1","src/offset_of.rs":"5d98aacb37ec5ce7df3809e15b2682ee1972248b1fb1c444bbb013bbd6d98bf1","src/pod.rs":"b64399dac0d0dcc6179b4da48c02a15dee881afe858d27aed58253775016f4da","src/transparent.rs":"f0475aaf00daf458ddd4f28e049ed72d46b8a86f9a9244a5aa1a0eb019657e21","src/zeroable.rs":"1fc0b80cee39b7171b8b9627c7e4fc4b369a17237910353feb6dbf9662944450","tests/cast_slice_tests.rs":"f1cacfc4ceeacafdc3acc1694c5579793c8f7c0908c5b2bde17a347453368657","tests/derive.rs":"0e5f4637fb11ab087e8b9cf76212caafa37e01cedba71cf4f51356187691b46a","tests/doc_tests.rs":"0008789fc7281f581c8c91eac13ea4683f82cdeadadc4119c7b21b38f7d41577","tests/offset_of_tests.rs":"bd9690a817b0ac36e07e4dce98e8de08f246d7f6d5ebd8df27a8a955c32db435","tests/std_tests.rs":"69661f26dc385c38d6c2bd37a62ba476e81ef88b4ed6565f3a47dd173133365c"},"package":"41aa2ec95ca3b5c54cf73c91acf06d24f4495d5f1b1c12506ae3483d646177ac"} \ No newline at end of file diff --git a/third_party/cargo/vendor/bytemuck-1.5.1/.cargo-checksum.json b/third_party/cargo/vendor/bytemuck-1.5.1/.cargo-checksum.json new file mode 100644 index 0000000..1d023d4 --- /dev/null +++ b/third_party/cargo/vendor/bytemuck-1.5.1/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"24ed52e1c8b6f028a51cf36509153c48e47f668dcd2cbf03221511f97e715de9","LICENSE-APACHE":"870e20c217d15bcfcbe53d7c5867cd8fac44a4ca0b41fc1eb843557e16063eba","LICENSE-MIT":"0b2d108c9c686a74ac312990ee8377902756a2a081a7af3b0f9d68abf0a8f1a1","LICENSE-ZLIB":"682b4c81b85e83ce6cc6e1ace38fdd97aeb4de0e972bd2b44aa0916c54af8c96","README.md":"dc60ed213002ac5c27c1dd753090832d3b882ea1c9b6ce9962891572830bcfb4","changelog.md":"29d25e2c3c7b357ca1451eaf04a3241547845e8e5d7858b8dc80f2adfdda078b","rustfmt.toml":"917eca93a0f65d5a2e76cde5813a76c088012fdebb41ac331a96181c82cdf6d5","src/allocation.rs":"1f7f937d3ef6c08d982a6385d85efd236c2d1d248986bec9123af067df677696","src/contiguous.rs":"af81aeb8ec7859a685348964f883b85c3aef1e2a38358d51b3a64252fade2bcd","src/lib.rs":"afdb84f8bc9a202f9a07c4a8897ec4284239fe907d273fda4a50576843020f4f","src/offset_of.rs":"db97a5018a8d56ad5382895593c3e44935356749646419b42524cdeeb25871df","src/pod.rs":"d1a87bc2d249dcfbf3566d2a81997e79b8c948b89d551d678174a77d98d69401","src/transparent.rs":"eb723ae91c57e3119b02af46b70e8b9028a905323112deb0f73db72f3f52c3f1","src/zeroable.rs":"5f381abadb2b0d48dd5629d5566d705e0f1d50d2f977d46b3bc3f258c689e730","tests/cast_slice_tests.rs":"aaf14cf6830ee38e659356e6b46c22d805f1c6b4aa0f494cf4fbde98f834fedb","tests/derive.rs":"ffd24f95388cd02493753112acb6522010667f54d1c60dd15fba64e2b40adc33","tests/doc_tests.rs":"eb4ce9cb167dbc1d6742b7d5c518c0636c77ce020c7cde28802d8dd67961bd15","tests/offset_of_tests.rs":"435a92c321865ddba9f29b81fc27c23f268e1dc12955a3c8b01ff2cc0c4f5615","tests/std_tests.rs":"ba0936ed2508b109bb4d3edda1294f61cda28118f511f9909dc6916be4e59207"},"package":"bed57e2090563b83ba8f83366628ce535a7584c9afa4c9fc0612a03925c6df58"} \ No newline at end of file diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/BUILD.bazel b/third_party/cargo/vendor/bytemuck-1.5.1/BUILD.bazel similarity index 98% rename from third_party/cargo/vendor/bytemuck-1.4.1/BUILD.bazel rename to third_party/cargo/vendor/bytemuck-1.5.1/BUILD.bazel index 7938c7d..c935cfa 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/BUILD.bazel +++ b/third_party/cargo/vendor/bytemuck-1.5.1/BUILD.bazel @@ -46,7 +46,7 @@ rust_library( "cargo-raze", "manual", ], - version = "1.4.1", + version = "1.5.1", # buildifier: leave-alone deps = [ ], diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/Cargo.toml b/third_party/cargo/vendor/bytemuck-1.5.1/Cargo.toml similarity index 98% rename from third_party/cargo/vendor/bytemuck-1.4.1/Cargo.toml rename to third_party/cargo/vendor/bytemuck-1.5.1/Cargo.toml index 3ceb9ed..ec87e0e 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/Cargo.toml +++ b/third_party/cargo/vendor/bytemuck-1.5.1/Cargo.toml @@ -13,7 +13,7 @@ [package] edition = "2018" name = "bytemuck" -version = "1.4.1" +version = "1.5.1" authors = ["Lokathor "] exclude = ["/pedantic.bat"] description = "A crate for mucking around with piles of bytes." diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/LICENSE-APACHE b/third_party/cargo/vendor/bytemuck-1.5.1/LICENSE-APACHE similarity index 99% rename from third_party/cargo/vendor/bytemuck-1.4.1/LICENSE-APACHE rename to third_party/cargo/vendor/bytemuck-1.5.1/LICENSE-APACHE index 136d900..1d02268 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/LICENSE-APACHE +++ b/third_party/cargo/vendor/bytemuck-1.5.1/LICENSE-APACHE @@ -1,61 +1,61 @@ -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - - "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and - (b) You must cause any modified files to carry prominent notices stating that You changed the files; and - (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - - You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - -To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/LICENSE-MIT b/third_party/cargo/vendor/bytemuck-1.5.1/LICENSE-MIT similarity index 99% rename from third_party/cargo/vendor/bytemuck-1.4.1/LICENSE-MIT rename to third_party/cargo/vendor/bytemuck-1.5.1/LICENSE-MIT index 164045f..0aa8816 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/LICENSE-MIT +++ b/third_party/cargo/vendor/bytemuck-1.5.1/LICENSE-MIT @@ -1,9 +1,9 @@ -MIT License - -Copyright (c) 2019 Daniel "Lokathor" Gee. - -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 (including the next paragraph) 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. +MIT License + +Copyright (c) 2019 Daniel "Lokathor" Gee. + +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 (including the next paragraph) 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 --git a/third_party/cargo/vendor/bytemuck-1.4.1/LICENSE-ZLIB b/third_party/cargo/vendor/bytemuck-1.5.1/LICENSE-ZLIB similarity index 98% rename from third_party/cargo/vendor/bytemuck-1.4.1/LICENSE-ZLIB rename to third_party/cargo/vendor/bytemuck-1.5.1/LICENSE-ZLIB index d70707c..aa2dabe 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/LICENSE-ZLIB +++ b/third_party/cargo/vendor/bytemuck-1.5.1/LICENSE-ZLIB @@ -1,11 +1,11 @@ -Copyright (c) 2019 Daniel "Lokathor" Gee. - -This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source distribution. +Copyright (c) 2019 Daniel "Lokathor" Gee. + +This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/README.md b/third_party/cargo/vendor/bytemuck-1.5.1/README.md similarity index 97% rename from third_party/cargo/vendor/bytemuck-1.4.1/README.md rename to third_party/cargo/vendor/bytemuck-1.5.1/README.md index 7970d32..fc492f8 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/README.md +++ b/third_party/cargo/vendor/bytemuck-1.5.1/README.md @@ -1,27 +1,27 @@ -[![License:Zlib](https://img.shields.io/badge/License-Zlib-brightgreen.svg)](https://opensource.org/licenses/Zlib) -![Minimum Rust Version](https://img.shields.io/badge/Min%20Rust-1.34-green.svg) -[![crates.io](https://img.shields.io/crates/v/bytemuck.svg)](https://crates.io/crates/bytemuck) -[![docs.rs](https://docs.rs/bytemuck/badge.svg)](https://docs.rs/bytemuck/) - -# bytemuck - -A crate for mucking around with piles of bytes. - -## Extensions - -There is experimental support for the `Zeroable` trait being derived through a -proc-macro. I'm not the author of that crate, please file bugs with that crate -in the other repo. - -* https://github.com/rodrimati1992/zeroable_crates - -## Stability - -The goal is to stay at 1.y.z until _at least_ the next edition of Rust. - -I consider any increase of the Minimum Rust Version to be a semver breaking change, -so `rustc-1.34` will continue to be supported for at least the rest of the -`bytemuck-1.y.z` series of the crate. - -(The secret goal is to get all of this functionality into the standard library -some day so that we don't even need to import a crate to do all this fun stuff.) +[![License:Zlib](https://img.shields.io/badge/License-Zlib-brightgreen.svg)](https://opensource.org/licenses/Zlib) +![Minimum Rust Version](https://img.shields.io/badge/Min%20Rust-1.34-green.svg) +[![crates.io](https://img.shields.io/crates/v/bytemuck.svg)](https://crates.io/crates/bytemuck) +[![docs.rs](https://docs.rs/bytemuck/badge.svg)](https://docs.rs/bytemuck/) + +# bytemuck + +A crate for mucking around with piles of bytes. + +## Extensions + +There is experimental support for the `Zeroable` trait being derived through a +proc-macro. I'm not the author of that crate, please file bugs with that crate +in the other repo. + +* https://github.com/rodrimati1992/zeroable_crates + +## Stability + +The goal is to stay at 1.y.z until _at least_ the next edition of Rust. + +I consider any increase of the Minimum Rust Version to be a semver breaking change, +so `rustc-1.34` will continue to be supported for at least the rest of the +`bytemuck-1.y.z` series of the crate. + +(The secret goal is to get all of this functionality into the standard library +some day so that we don't even need to import a crate to do all this fun stuff.) diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/changelog.md b/third_party/cargo/vendor/bytemuck-1.5.1/changelog.md similarity index 78% rename from third_party/cargo/vendor/bytemuck-1.4.1/changelog.md rename to third_party/cargo/vendor/bytemuck-1.5.1/changelog.md index a474435..838cdd4 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/changelog.md +++ b/third_party/cargo/vendor/bytemuck-1.5.1/changelog.md @@ -1,62 +1,84 @@ -# `bytemuck` changelog - -## 1.4 - -* [icewind1991](https://github.com/icewind1991) has contributed the proc-macros - for deriving impls of `Pod`, `TransparentWrapper`, `Zeroable`!! Everyone has - been waiting for this one folks! It's a big deal. Just enable the `derive` - cargo feature and then you'll be able to derive the traits on your types. It - generates all the appropriate tests for you. -* The `zeroable_maybe_uninit` feature now adds a `Zeroable` impl to the - `MaybeUninit` type. This is only behind a feature flag because `MaybeUninit` - didn't exist back in `1.34.0` (the minimum rust version of `bytemuck`). - -## 1.3.1 - -* The entire crate is now available under the `Apache-2.0 OR MIT` license as - well as the previous `Zlib` license - [#24](https://github.com/Lokathor/bytemuck/pull/24). -* [HeroicKatora](https://github.com/HeroicKatora) added the - `try_zeroed_slice_box` function - [#10](https://github.com/Lokathor/bytemuck/pull/17). `zeroed_slice_box` is - also available. -* The `offset_of!` macro now supports a 2-arg version. For types that impl - Default, it'll just make an instance using `default` and then call over to the - 3-arg version. -* The `PodCastError` type now supports `Hash` and `Display`. Also if you enable - the `extern_crate_std` feature then it will support `std::error::Error`. -* We now provide a `TransparentWrapper` impl for `core::num::Wrapper`. -* The error type of `try_from_bytes` and `try_from_bytes_mut` when the input - isn't aligned has been corrected from being `AlignmentMismatch` (intended for - allocation casting only) to `TargetAlignmentGreaterAndInputNotAligned`. - -## 1.3.0 - -* Had a bug because the CI was messed up! It wasn't soundness related, because - it prevented the crate from building entirely if the `extern_crate_alloc` - feature was used. Still, this is yanked, sorry. - -## 1.2.0 - -* [thomcc](https://github.com/thomcc) added many things: - * A fully sound `offset_of!` macro - [#10](https://github.com/Lokathor/bytemuck/pull/10) - * A `Contiguous` trait for when you've got enums with declared values - all in a row [#12](https://github.com/Lokathor/bytemuck/pull/12) - * A `TransparentWrapper` marker trait for when you want to more clearly - enable adding and removing a wrapper struct to its inner value - [#15](https://github.com/Lokathor/bytemuck/pull/15) - * Now MIRI is run on CI in every single push! - [#16](https://github.com/Lokathor/bytemuck/pull/16) - -## 1.1.0 - -* [SimonSapin](https://github.com/SimonSapin) added `from_bytes`, - `from_bytes_mut`, `try_from_bytes`, and `try_from_bytes_mut` ([PR - Link](https://github.com/Lokathor/bytemuck/pull/8)) - -## 1.0.1 - -* Changed to the [zlib](https://opensource.org/licenses/Zlib) license. -* Added much more proper documentation. -* Reduced the minimum Rust version to 1.34 +# `bytemuck` changelog + +## 1.5.1 + +* Fix `bytes_of` failing on zero sized types. + [PR 53](https://github.com/Lokathor/bytemuck/pull/53) + +## 1.5 + +* Added `pod_collect_to_vec`, which will gather a slice into a vec, +allowing you to change the pod type while also safely ignoring alignment. +[PR 50](https://github.com/Lokathor/bytemuck/pull/50) + +## 1.4.2 + +* [Kimundi](https://github.com/Kimundi) fixed an issue that could make `try_zeroed_box` +stack overflow for large values at low optimization levels. +[PR 43](https://github.com/Lokathor/bytemuck/pull/43) + +## 1.4.1 + +* [thomcc](https://github.com/thomcc) fixed up the CI and patched over a soundness hole in `offset_of!`. +[PR 38](https://github.com/Lokathor/bytemuck/pull/38) + +## 1.4 + +* [icewind1991](https://github.com/icewind1991) has contributed the proc-macros + for deriving impls of `Pod`, `TransparentWrapper`, `Zeroable`!! Everyone has + been waiting for this one folks! It's a big deal. Just enable the `derive` + cargo feature and then you'll be able to derive the traits on your types. It + generates all the appropriate tests for you. +* The `zeroable_maybe_uninit` feature now adds a `Zeroable` impl to the + `MaybeUninit` type. This is only behind a feature flag because `MaybeUninit` + didn't exist back in `1.34.0` (the minimum rust version of `bytemuck`). + +## 1.3.1 + +* The entire crate is now available under the `Apache-2.0 OR MIT` license as + well as the previous `Zlib` license + [#24](https://github.com/Lokathor/bytemuck/pull/24). +* [HeroicKatora](https://github.com/HeroicKatora) added the + `try_zeroed_slice_box` function + [#10](https://github.com/Lokathor/bytemuck/pull/17). `zeroed_slice_box` is + also available. +* The `offset_of!` macro now supports a 2-arg version. For types that impl + Default, it'll just make an instance using `default` and then call over to the + 3-arg version. +* The `PodCastError` type now supports `Hash` and `Display`. Also if you enable + the `extern_crate_std` feature then it will support `std::error::Error`. +* We now provide a `TransparentWrapper` impl for `core::num::Wrapper`. +* The error type of `try_from_bytes` and `try_from_bytes_mut` when the input + isn't aligned has been corrected from being `AlignmentMismatch` (intended for + allocation casting only) to `TargetAlignmentGreaterAndInputNotAligned`. + +## 1.3.0 + +* Had a bug because the CI was messed up! It wasn't soundness related, because + it prevented the crate from building entirely if the `extern_crate_alloc` + feature was used. Still, this is yanked, sorry. + +## 1.2.0 + +* [thomcc](https://github.com/thomcc) added many things: + * A fully sound `offset_of!` macro + [#10](https://github.com/Lokathor/bytemuck/pull/10) + * A `Contiguous` trait for when you've got enums with declared values + all in a row [#12](https://github.com/Lokathor/bytemuck/pull/12) + * A `TransparentWrapper` marker trait for when you want to more clearly + enable adding and removing a wrapper struct to its inner value + [#15](https://github.com/Lokathor/bytemuck/pull/15) + * Now MIRI is run on CI in every single push! + [#16](https://github.com/Lokathor/bytemuck/pull/16) + +## 1.1.0 + +* [SimonSapin](https://github.com/SimonSapin) added `from_bytes`, + `from_bytes_mut`, `try_from_bytes`, and `try_from_bytes_mut` ([PR + Link](https://github.com/Lokathor/bytemuck/pull/8)) + +## 1.0.1 + +* Changed to the [zlib](https://opensource.org/licenses/Zlib) license. +* Added much more proper documentation. +* Reduced the minimum Rust version to 1.34 diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/rustfmt.toml b/third_party/cargo/vendor/bytemuck-1.5.1/rustfmt.toml similarity index 95% rename from third_party/cargo/vendor/bytemuck-1.4.1/rustfmt.toml rename to third_party/cargo/vendor/bytemuck-1.5.1/rustfmt.toml index f214385..23b0fd5 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/rustfmt.toml +++ b/third_party/cargo/vendor/bytemuck-1.5.1/rustfmt.toml @@ -1,16 +1,16 @@ -# Based on -# https://github.com/rust-lang/rustfmt/blob/rustfmt-1.4.19/Configurations.md - -# Stable -edition = "2018" -fn_args_layout = "Compressed" -max_width = 80 -tab_spaces = 2 -use_field_init_shorthand = true -use_try_shorthand = true -use_small_heuristics = "Max" - -# Unstable -format_code_in_doc_comments = true -merge_imports = true -wrap_comments = true +# Based on +# https://github.com/rust-lang/rustfmt/blob/rustfmt-1.4.19/Configurations.md + +# Stable +edition = "2018" +fn_args_layout = "Compressed" +max_width = 80 +tab_spaces = 2 +use_field_init_shorthand = true +use_try_shorthand = true +use_small_heuristics = "Max" + +# Unstable +format_code_in_doc_comments = true +merge_imports = true +wrap_comments = true diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/src/allocation.rs b/third_party/cargo/vendor/bytemuck-1.5.1/src/allocation.rs similarity index 73% rename from third_party/cargo/vendor/bytemuck-1.4.1/src/allocation.rs rename to third_party/cargo/vendor/bytemuck-1.5.1/src/allocation.rs index 06d62fa..7b7c7c2 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/src/allocation.rs +++ b/third_party/cargo/vendor/bytemuck-1.5.1/src/allocation.rs @@ -1,166 +1,212 @@ -#![cfg(feature = "extern_crate_alloc")] - -//! Stuff to boost things in the `alloc` crate. -//! -//! * You must enable the `extern_crate_alloc` feature of `bytemuck` or you will -//! not be able to use this module! - -use super::*; -use alloc::{ - alloc::{alloc_zeroed, Layout}, - boxed::Box, - vec::Vec, -}; - -/// As [`try_cast_box`](try_cast_box), but unwraps for you. -#[inline] -pub fn cast_box(input: Box) -> Box { - try_cast_box(input).map_err(|(e, _v)| e).unwrap() -} - -/// Attempts to cast the content type of a [`Box`](alloc::boxed::Box). -/// -/// On failure you get back an error along with the starting `Box`. -/// -/// ## Failure -/// -/// * The start and end content type of the `Box` must have the exact same -/// alignment. -/// * The start and end size of the `Box` must have the exact same size. -#[inline] -pub fn try_cast_box( - input: Box, -) -> Result, (PodCastError, Box)> { - if align_of::() != align_of::() { - Err((PodCastError::AlignmentMismatch, input)) - } else if size_of::() != size_of::() { - Err((PodCastError::SizeMismatch, input)) - } else { - // Note(Lokathor): This is much simpler than with the Vec casting! - let ptr: *mut B = Box::into_raw(input) as *mut B; - Ok(unsafe { Box::from_raw(ptr) }) - } -} - -/// Allocates a `Box` with all of the contents being zeroed out. -/// -/// This uses the global allocator to create a zeroed allocation and _then_ -/// turns it into a Box. In other words, it's 100% assured that the zeroed data -/// won't be put temporarily on the stack. You can make a box of any size -/// without fear of a stack overflow. -/// -/// ## Failure -/// -/// This fails if the allocation fails. -#[inline] -pub fn try_zeroed_box() -> Result, ()> { - if size_of::() == 0 { - return Ok(Box::new(T::zeroed())); - } - let layout = - Layout::from_size_align(size_of::(), align_of::()).unwrap(); - let ptr = unsafe { alloc_zeroed(layout) }; - if ptr.is_null() { - // we don't know what the error is because `alloc_zeroed` is a dumb API - Err(()) - } else { - Ok(unsafe { Box::::from_raw(ptr as *mut T) }) - } -} - -/// As [`try_zeroed_box`], but unwraps for you. -#[inline] -pub fn zeroed_box() -> Box { - try_zeroed_box().unwrap() -} - -/// Allocates a `Box<[T]>` with all contents being zeroed out. -/// -/// This uses the global allocator to create a zeroed allocation and _then_ -/// turns it into a Box. In other words, it's 100% assured that the zeroed data -/// won't be put temporarily on the stack. You can make a box of any size -/// without fear of a stack overflow. -/// -/// ## Failure -/// -/// This fails if the allocation fails. -#[inline] -pub fn try_zeroed_slice_box( - length: usize, -) -> Result, ()> { - if size_of::() == 0 { - // This will not allocate but simple create a dangling slice pointer. - let mut vec = Vec::with_capacity(length); - vec.resize_with(length, || T::zeroed()); - return Ok(vec.into_boxed_slice()); - } - if length == 0 { - // This will also not allocate. - return Ok(Vec::new().into_boxed_slice()); - } - // For Pod types, the layout of the array/slice is equivalent to repeating the type. - let layout_length = size_of::().checked_mul(length).ok_or(())?; - assert!(layout_length != 0); - let layout = - Layout::from_size_align(layout_length, align_of::()).map_err(|_| ())?; - let ptr = unsafe { alloc_zeroed(layout) }; - if ptr.is_null() { - // we don't know what the error is because `alloc_zeroed` is a dumb API - Err(()) - } else { - let slice = - unsafe { core::slice::from_raw_parts_mut(ptr as *mut T, length) }; - Ok(unsafe { Box::<[T]>::from_raw(slice) }) - } -} - -/// As [`try_zeroed_slice_box`](try_zeroed_slice_box), but unwraps for you. -pub fn zeroed_slice_box(length: usize) -> Box<[T]> { - try_zeroed_slice_box(length).unwrap() -} - -/// As [`try_cast_vec`](try_cast_vec), but unwraps for you. -#[inline] -pub fn cast_vec(input: Vec) -> Vec { - try_cast_vec(input).map_err(|(e, _v)| e).unwrap() -} - -/// Attempts to cast the content type of a [`Vec`](alloc::vec::Vec). -/// -/// On failure you get back an error along with the starting `Vec`. -/// -/// ## Failure -/// -/// * The start and end content type of the `Vec` must have the exact same -/// alignment. -/// * The start and end size of the `Vec` must have the exact same size. -/// * In the future this second restriction might be lessened by having the -/// capacity and length get adjusted during transmutation, but for now it's -/// absolute. -#[inline] -pub fn try_cast_vec( - input: Vec, -) -> Result, (PodCastError, Vec)> { - if align_of::() != align_of::() { - Err((PodCastError::AlignmentMismatch, input)) - } else if size_of::() != size_of::() { - // Note(Lokathor): Under some conditions it would be possible to cast - // between Vec content types of the same alignment but different sizes by - // changing the capacity and len values in the output Vec. However, we will - // not attempt that for now. - Err((PodCastError::SizeMismatch, input)) - } else { - // Note(Lokathor): First we record the length and capacity, which don't have - // any secret provenance metadata. - let length: usize = input.len(); - let capacity: usize = input.capacity(); - // Note(Lokathor): Next we "pre-forget" the old Vec by wrapping with - // ManuallyDrop, because if we used `core::mem::forget` after taking the - // pointer then that would invalidate our pointer. In nightly there's a - // "into raw parts" method, which we can switch this too eventually. - let mut manual_drop_vec = ManuallyDrop::new(input); - let vec_ptr: *mut A = manual_drop_vec.as_mut_ptr(); - let ptr: *mut B = vec_ptr as *mut B; - Ok(unsafe { Vec::from_raw_parts(ptr, length, capacity) }) - } -} +#![cfg(feature = "extern_crate_alloc")] + +//! Stuff to boost things in the `alloc` crate. +//! +//! * You must enable the `extern_crate_alloc` feature of `bytemuck` or you will +//! not be able to use this module! + +use super::*; +use alloc::{ + alloc::{alloc_zeroed, Layout}, + boxed::Box, + vec, + vec::Vec, +}; +use core::convert::TryInto; + +/// As [`try_cast_box`](try_cast_box), but unwraps for you. +#[inline] +pub fn cast_box(input: Box) -> Box { + try_cast_box(input).map_err(|(e, _v)| e).unwrap() +} + +/// Attempts to cast the content type of a [`Box`](alloc::boxed::Box). +/// +/// On failure you get back an error along with the starting `Box`. +/// +/// ## Failure +/// +/// * The start and end content type of the `Box` must have the exact same +/// alignment. +/// * The start and end size of the `Box` must have the exact same size. +#[inline] +pub fn try_cast_box( + input: Box, +) -> Result, (PodCastError, Box)> { + if align_of::() != align_of::() { + Err((PodCastError::AlignmentMismatch, input)) + } else if size_of::() != size_of::() { + Err((PodCastError::SizeMismatch, input)) + } else { + // Note(Lokathor): This is much simpler than with the Vec casting! + let ptr: *mut B = Box::into_raw(input) as *mut B; + Ok(unsafe { Box::from_raw(ptr) }) + } +} + +/// Allocates a `Box` with all of the contents being zeroed out. +/// +/// This uses the global allocator to create a zeroed allocation and _then_ +/// turns it into a Box. In other words, it's 100% assured that the zeroed data +/// won't be put temporarily on the stack. You can make a box of any size +/// without fear of a stack overflow. +/// +/// ## Failure +/// +/// This fails if the allocation fails. +#[inline] +pub fn try_zeroed_box() -> Result, ()> { + if size_of::() == 0 { + // This will not allocate but simple create a dangling slice pointer. + // NB: We go the way via a push to `Vec` to ensure the compiler + // does not allocate space for T on the stack even if the branch + // would not be taken. + let mut vec = Vec::with_capacity(1); + vec.resize_with(1, || T::zeroed()); + let ptr: Box<[T; 1]> = vec.into_boxed_slice().try_into().ok().unwrap(); + debug_assert!( + align_of::<[T; 1]>() == align_of::() + && size_of::<[T; 1]>() == size_of::() + ); + // NB: We basically do the same as in try_cast_box here: + let ptr: Box = unsafe { Box::from_raw(Box::into_raw(ptr) as *mut _) }; + return Ok(ptr); + } + let layout = + Layout::from_size_align(size_of::(), align_of::()).unwrap(); + let ptr = unsafe { alloc_zeroed(layout) }; + if ptr.is_null() { + // we don't know what the error is because `alloc_zeroed` is a dumb API + Err(()) + } else { + Ok(unsafe { Box::::from_raw(ptr as *mut T) }) + } +} + +/// As [`try_zeroed_box`], but unwraps for you. +#[inline] +pub fn zeroed_box() -> Box { + try_zeroed_box().unwrap() +} + +/// Allocates a `Box<[T]>` with all contents being zeroed out. +/// +/// This uses the global allocator to create a zeroed allocation and _then_ +/// turns it into a Box. In other words, it's 100% assured that the zeroed data +/// won't be put temporarily on the stack. You can make a box of any size +/// without fear of a stack overflow. +/// +/// ## Failure +/// +/// This fails if the allocation fails. +#[inline] +pub fn try_zeroed_slice_box( + length: usize, +) -> Result, ()> { + if size_of::() == 0 { + // This will not allocate but simple create a dangling slice pointer. + let mut vec = Vec::with_capacity(length); + vec.resize_with(length, || T::zeroed()); + return Ok(vec.into_boxed_slice()); + } + if length == 0 { + // This will also not allocate. + return Ok(Vec::new().into_boxed_slice()); + } + // For Pod types, the layout of the array/slice is equivalent to repeating the + // type. + let layout_length = size_of::().checked_mul(length).ok_or(())?; + assert!(layout_length != 0); + let layout = + Layout::from_size_align(layout_length, align_of::()).map_err(|_| ())?; + let ptr = unsafe { alloc_zeroed(layout) }; + if ptr.is_null() { + // we don't know what the error is because `alloc_zeroed` is a dumb API + Err(()) + } else { + let slice = + unsafe { core::slice::from_raw_parts_mut(ptr as *mut T, length) }; + Ok(unsafe { Box::<[T]>::from_raw(slice) }) + } +} + +/// As [`try_zeroed_slice_box`](try_zeroed_slice_box), but unwraps for you. +pub fn zeroed_slice_box(length: usize) -> Box<[T]> { + try_zeroed_slice_box(length).unwrap() +} + +/// As [`try_cast_vec`](try_cast_vec), but unwraps for you. +#[inline] +pub fn cast_vec(input: Vec) -> Vec { + try_cast_vec(input).map_err(|(e, _v)| e).unwrap() +} + +/// Attempts to cast the content type of a [`Vec`](alloc::vec::Vec). +/// +/// On failure you get back an error along with the starting `Vec`. +/// +/// ## Failure +/// +/// * The start and end content type of the `Vec` must have the exact same +/// alignment. +/// * The start and end size of the `Vec` must have the exact same size. +/// * In the future this second restriction might be lessened by having the +/// capacity and length get adjusted during transmutation, but for now it's +/// absolute. +#[inline] +pub fn try_cast_vec( + input: Vec, +) -> Result, (PodCastError, Vec)> { + if align_of::() != align_of::() { + Err((PodCastError::AlignmentMismatch, input)) + } else if size_of::() != size_of::() { + // Note(Lokathor): Under some conditions it would be possible to cast + // between Vec content types of the same alignment but different sizes by + // changing the capacity and len values in the output Vec. However, we will + // not attempt that for now. + Err((PodCastError::SizeMismatch, input)) + } else { + // Note(Lokathor): First we record the length and capacity, which don't have + // any secret provenance metadata. + let length: usize = input.len(); + let capacity: usize = input.capacity(); + // Note(Lokathor): Next we "pre-forget" the old Vec by wrapping with + // ManuallyDrop, because if we used `core::mem::forget` after taking the + // pointer then that would invalidate our pointer. In nightly there's a + // "into raw parts" method, which we can switch this too eventually. + let mut manual_drop_vec = ManuallyDrop::new(input); + let vec_ptr: *mut A = manual_drop_vec.as_mut_ptr(); + let ptr: *mut B = vec_ptr as *mut B; + Ok(unsafe { Vec::from_raw_parts(ptr, length, capacity) }) + } +} + +/// This "collects" a slice of pod data into a vec of a different pod type. +/// +/// Unlike with [`cast_slice`] and [`cast_slice_mut`], this will always work. +/// +/// The output vec will be of a minimal size/capacity to hold the slice given. +/// +/// ```rust +/// # use bytemuck::*; +/// let halfwords: [u16; 4] = [5, 6, 7, 8]; +/// let vec_of_words: Vec = pod_collect_to_vec(&halfwords); +/// if cfg!(target_endian = "little") { +/// assert_eq!(&vec_of_words[..], &[0x0006_0005, 0x0008_0007][..]) +/// } else { +/// assert_eq!(&vec_of_words[..], &[0x0005_0006, 0x0007_0008][..]) +/// } +/// ``` +pub fn pod_collect_to_vec(src: &[A]) -> Vec { + let src_size = size_of_val(src); + // Note(Lokathor): dst_count is rounded up so that the dest will always be at + // least as many bytes as the src. + let dst_count = src_size / size_of::() + + if src_size % size_of::() != 0 { 1 } else { 0 }; + let mut dst = vec![B::zeroed(); dst_count]; + + let src_bytes: &[u8] = cast_slice(src); + let dst_bytes: &mut [u8] = cast_slice_mut(&mut dst[..]); + dst_bytes[..src_size].copy_from_slice(src_bytes); + dst +} diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/src/contiguous.rs b/third_party/cargo/vendor/bytemuck-1.5.1/src/contiguous.rs similarity index 97% rename from third_party/cargo/vendor/bytemuck-1.4.1/src/contiguous.rs rename to third_party/cargo/vendor/bytemuck-1.5.1/src/contiguous.rs index 30709a7..78774de 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/src/contiguous.rs +++ b/third_party/cargo/vendor/bytemuck-1.5.1/src/contiguous.rs @@ -1,203 +1,203 @@ -use super::*; -use core::mem::{size_of, transmute_copy}; - -/// A trait indicating that: -/// -/// 1. A type has an equivalent representation to some known integral type. -/// 2. All instances of this type fall in a fixed range of values. -/// 3. Within that range, there are no gaps. -/// -/// This is generally useful for fieldless enums (aka "c-style" enums), however -/// it's important that it only be used for those with an explicit `#[repr]`, as -/// `#[repr(Rust)]` fieldess enums have an unspecified layout. -/// -/// Additionally, you shouldn't assume that all implementations are enums. Any -/// type which meets the requirements above while following the rules under -/// "Safety" below is valid. -/// -/// # Example -/// -/// ``` -/// # use bytemuck::Contiguous; -/// #[repr(u8)] -/// #[derive(Debug, Copy, Clone, PartialEq)] -/// enum Foo { -/// A = 0, -/// B = 1, -/// C = 2, -/// D = 3, -/// E = 4, -/// } -/// unsafe impl Contiguous for Foo { -/// type Int = u8; -/// const MIN_VALUE: u8 = Foo::A as u8; -/// const MAX_VALUE: u8 = Foo::E as u8; -/// } -/// assert_eq!(Foo::from_integer(3).unwrap(), Foo::D); -/// assert_eq!(Foo::from_integer(8), None); -/// assert_eq!(Foo::C.into_integer(), 2); -/// ``` -/// # Safety -/// -/// This is an unsafe trait, and incorrectly implementing it is undefined -/// behavior. -/// -/// Informally, by implementing it, you're asserting that `C` is identical to -/// the integral type `C::Int`, and that every `C` falls between `C::MIN_VALUE` -/// and `C::MAX_VALUE` exactly once, without any gaps. -/// -/// Precisely, the guarantees you must uphold when implementing `Contiguous` for -/// some type `C` are: -/// -/// 1. The size of `C` and `C::Int` must be the same, and neither may be a ZST. -/// (Note: alignment is explicitly allowed to differ) -/// -/// 2. `C::Int` must be a primitive integer, and not a wrapper type. In the -/// future, this may be lifted to include cases where the behavior is -/// identical for a relevant set of traits (Ord, arithmetic, ...). -/// -/// 3. All `C::Int`s which are in the *inclusive* range between `C::MIN_VALUE` -/// and `C::MAX_VALUE` are bitwise identical to unique valid instances of -/// `C`. -/// -/// 4. There exist no instances of `C` such that their bitpatterns, when -/// interpreted as instances of `C::Int`, fall outside of the `MAX_VALUE` / -/// `MIN_VALUE` range -- It is legal for unsafe code to assume that if it -/// gets a `C` that implements `Contiguous`, it is in the appropriate range. -/// -/// 5. Finally, you promise not to provide overridden implementations of -/// `Contiguous::from_integer` and `Contiguous::into_integer`. -/// -/// For clarity, the following rules could be derived from the above, but are -/// listed explicitly: -/// -/// - `C::MAX_VALUE` must be greater or equal to `C::MIN_VALUE` (therefore, `C` -/// must be an inhabited type). -/// -/// - There exist no two values between `MIN_VALUE` and `MAX_VALUE` such that -/// when interpreted as a `C` they are considered identical (by, say, match). -pub unsafe trait Contiguous: Copy + 'static { - /// The primitive integer type with an identical representation to this - /// type. - /// - /// Contiguous is broadly intended for use with fieldless enums, and for - /// these the correct integer type is easy: The enum should have a - /// `#[repr(Int)]` or `#[repr(C)]` attribute, (if it does not, it is - /// *unsound* to implement `Contiguous`!). - /// - /// - For `#[repr(Int)]`, use the listed `Int`. e.g. `#[repr(u8)]` should - /// use `type Int = u8`. - /// - /// - For `#[repr(C)]`, use whichever type the C compiler will use to - /// represent the given enum. This is usually `c_int` (from `std::os::raw` - /// or `libc`), but it's up to you to make the determination as the - /// implementer of the unsafe trait. - /// - /// For precise rules, see the list under "Safety" above. - type Int: Copy + Ord; - - /// The upper *inclusive* bound for valid instances of this type. - const MAX_VALUE: Self::Int; - - /// The lower *inclusive* bound for valid instances of this type. - const MIN_VALUE: Self::Int; - - /// If `value` is within the range for valid instances of this type, - /// returns `Some(converted_value)`, otherwise, returns `None`. - /// - /// This is a trait method so that you can write `value.into_integer()` in - /// your code. It is a contract of this trait that if you implement - /// `Contiguous` on your type you **must not** override this method. - /// - /// # Panics - /// - /// We will not panic for any correct implementation of `Contiguous`, but - /// *may* panic if we detect an incorrect one. - /// - /// This is undefined behavior regardless, so it could have been the nasal - /// demons at that point anyway ;). - #[inline] - fn from_integer(value: Self::Int) -> Option { - // Guard against an illegal implementation of Contiguous. Annoyingly we - // can't rely on `transmute` to do this for us (see below), but - // whatever, this gets compiled into nothing in release. - assert!(size_of::() == size_of::()); - if Self::MIN_VALUE <= value && value <= Self::MAX_VALUE { - // SAFETY: We've checked their bounds (and their size, even though - // they've sworn under the Oath Of Unsafe Rust that that already - // matched) so this is allowed by `Contiguous`'s unsafe contract. - // - // So, the `transmute_copy`. ideally we'd use transmute here, which - // is more obviously safe. Sadly, we can't, as these types still - // have unspecified sizes. - Some(unsafe { transmute_copy::(&value) }) - } else { - None - } - } - - /// Perform the conversion from `C` into the underlying integral type. This - /// mostly exists otherwise generic code would need unsafe for the `value as - /// integer` - /// - /// This is a trait method so that you can write `value.into_integer()` in - /// your code. It is a contract of this trait that if you implement - /// `Contiguous` on your type you **must not** override this method. - /// - /// # Panics - /// - /// We will not panic for any correct implementation of `Contiguous`, but - /// *may* panic if we detect an incorrect one. - /// - /// This is undefined behavior regardless, so it could have been the nasal - /// demons at that point anyway ;). - #[inline] - fn into_integer(self) -> Self::Int { - // Guard against an illegal implementation of Contiguous. Annoyingly we - // can't rely on `transmute` to do the size check for us (see - // `from_integer's comment`), but whatever, this gets compiled into - // nothing in release. Note that we don't check the result of cast - assert!(size_of::() == size_of::()); - - // SAFETY: The unsafe contract requires that these have identical - // representations, and that the range be entirely valid. Using - // transmute_copy instead of transmute here is annoying, but is required - // as `Self` and `Self::Int` have unspecified sizes still. - unsafe { transmute_copy::(&self) } - } -} - -macro_rules! impl_contiguous { - ($($src:ty as $repr:ident in [$min:expr, $max:expr];)*) => {$( - unsafe impl Contiguous for $src { - type Int = $repr; - const MAX_VALUE: $repr = $max; - const MIN_VALUE: $repr = $min; - } - )*}; -} - -impl_contiguous! { - bool as u8 in [0, 1]; - - u8 as u8 in [0, u8::max_value()]; - u16 as u16 in [0, u16::max_value()]; - u32 as u32 in [0, u32::max_value()]; - u64 as u64 in [0, u64::max_value()]; - u128 as u128 in [0, u128::max_value()]; - usize as usize in [0, usize::max_value()]; - - i8 as i8 in [i8::min_value(), i8::max_value()]; - i16 as i16 in [i16::min_value(), i16::max_value()]; - i32 as i32 in [i32::min_value(), i32::max_value()]; - i64 as i64 in [i64::min_value(), i64::max_value()]; - i128 as i128 in [i128::min_value(), i128::max_value()]; - isize as isize in [isize::min_value(), isize::max_value()]; - - NonZeroU8 as u8 in [1, u8::max_value()]; - NonZeroU16 as u16 in [1, u16::max_value()]; - NonZeroU32 as u32 in [1, u32::max_value()]; - NonZeroU64 as u64 in [1, u64::max_value()]; - NonZeroU128 as u128 in [1, u128::max_value()]; - NonZeroUsize as usize in [1, usize::max_value()]; -} +use super::*; +use core::mem::{size_of, transmute_copy}; + +/// A trait indicating that: +/// +/// 1. A type has an equivalent representation to some known integral type. +/// 2. All instances of this type fall in a fixed range of values. +/// 3. Within that range, there are no gaps. +/// +/// This is generally useful for fieldless enums (aka "c-style" enums), however +/// it's important that it only be used for those with an explicit `#[repr]`, as +/// `#[repr(Rust)]` fieldess enums have an unspecified layout. +/// +/// Additionally, you shouldn't assume that all implementations are enums. Any +/// type which meets the requirements above while following the rules under +/// "Safety" below is valid. +/// +/// # Example +/// +/// ``` +/// # use bytemuck::Contiguous; +/// #[repr(u8)] +/// #[derive(Debug, Copy, Clone, PartialEq)] +/// enum Foo { +/// A = 0, +/// B = 1, +/// C = 2, +/// D = 3, +/// E = 4, +/// } +/// unsafe impl Contiguous for Foo { +/// type Int = u8; +/// const MIN_VALUE: u8 = Foo::A as u8; +/// const MAX_VALUE: u8 = Foo::E as u8; +/// } +/// assert_eq!(Foo::from_integer(3).unwrap(), Foo::D); +/// assert_eq!(Foo::from_integer(8), None); +/// assert_eq!(Foo::C.into_integer(), 2); +/// ``` +/// # Safety +/// +/// This is an unsafe trait, and incorrectly implementing it is undefined +/// behavior. +/// +/// Informally, by implementing it, you're asserting that `C` is identical to +/// the integral type `C::Int`, and that every `C` falls between `C::MIN_VALUE` +/// and `C::MAX_VALUE` exactly once, without any gaps. +/// +/// Precisely, the guarantees you must uphold when implementing `Contiguous` for +/// some type `C` are: +/// +/// 1. The size of `C` and `C::Int` must be the same, and neither may be a ZST. +/// (Note: alignment is explicitly allowed to differ) +/// +/// 2. `C::Int` must be a primitive integer, and not a wrapper type. In the +/// future, this may be lifted to include cases where the behavior is +/// identical for a relevant set of traits (Ord, arithmetic, ...). +/// +/// 3. All `C::Int`s which are in the *inclusive* range between `C::MIN_VALUE` +/// and `C::MAX_VALUE` are bitwise identical to unique valid instances of +/// `C`. +/// +/// 4. There exist no instances of `C` such that their bitpatterns, when +/// interpreted as instances of `C::Int`, fall outside of the `MAX_VALUE` / +/// `MIN_VALUE` range -- It is legal for unsafe code to assume that if it +/// gets a `C` that implements `Contiguous`, it is in the appropriate range. +/// +/// 5. Finally, you promise not to provide overridden implementations of +/// `Contiguous::from_integer` and `Contiguous::into_integer`. +/// +/// For clarity, the following rules could be derived from the above, but are +/// listed explicitly: +/// +/// - `C::MAX_VALUE` must be greater or equal to `C::MIN_VALUE` (therefore, `C` +/// must be an inhabited type). +/// +/// - There exist no two values between `MIN_VALUE` and `MAX_VALUE` such that +/// when interpreted as a `C` they are considered identical (by, say, match). +pub unsafe trait Contiguous: Copy + 'static { + /// The primitive integer type with an identical representation to this + /// type. + /// + /// Contiguous is broadly intended for use with fieldless enums, and for + /// these the correct integer type is easy: The enum should have a + /// `#[repr(Int)]` or `#[repr(C)]` attribute, (if it does not, it is + /// *unsound* to implement `Contiguous`!). + /// + /// - For `#[repr(Int)]`, use the listed `Int`. e.g. `#[repr(u8)]` should + /// use `type Int = u8`. + /// + /// - For `#[repr(C)]`, use whichever type the C compiler will use to + /// represent the given enum. This is usually `c_int` (from `std::os::raw` + /// or `libc`), but it's up to you to make the determination as the + /// implementer of the unsafe trait. + /// + /// For precise rules, see the list under "Safety" above. + type Int: Copy + Ord; + + /// The upper *inclusive* bound for valid instances of this type. + const MAX_VALUE: Self::Int; + + /// The lower *inclusive* bound for valid instances of this type. + const MIN_VALUE: Self::Int; + + /// If `value` is within the range for valid instances of this type, + /// returns `Some(converted_value)`, otherwise, returns `None`. + /// + /// This is a trait method so that you can write `value.into_integer()` in + /// your code. It is a contract of this trait that if you implement + /// `Contiguous` on your type you **must not** override this method. + /// + /// # Panics + /// + /// We will not panic for any correct implementation of `Contiguous`, but + /// *may* panic if we detect an incorrect one. + /// + /// This is undefined behavior regardless, so it could have been the nasal + /// demons at that point anyway ;). + #[inline] + fn from_integer(value: Self::Int) -> Option { + // Guard against an illegal implementation of Contiguous. Annoyingly we + // can't rely on `transmute` to do this for us (see below), but + // whatever, this gets compiled into nothing in release. + assert!(size_of::() == size_of::()); + if Self::MIN_VALUE <= value && value <= Self::MAX_VALUE { + // SAFETY: We've checked their bounds (and their size, even though + // they've sworn under the Oath Of Unsafe Rust that that already + // matched) so this is allowed by `Contiguous`'s unsafe contract. + // + // So, the `transmute_copy`. ideally we'd use transmute here, which + // is more obviously safe. Sadly, we can't, as these types still + // have unspecified sizes. + Some(unsafe { transmute_copy::(&value) }) + } else { + None + } + } + + /// Perform the conversion from `C` into the underlying integral type. This + /// mostly exists otherwise generic code would need unsafe for the `value as + /// integer` + /// + /// This is a trait method so that you can write `value.into_integer()` in + /// your code. It is a contract of this trait that if you implement + /// `Contiguous` on your type you **must not** override this method. + /// + /// # Panics + /// + /// We will not panic for any correct implementation of `Contiguous`, but + /// *may* panic if we detect an incorrect one. + /// + /// This is undefined behavior regardless, so it could have been the nasal + /// demons at that point anyway ;). + #[inline] + fn into_integer(self) -> Self::Int { + // Guard against an illegal implementation of Contiguous. Annoyingly we + // can't rely on `transmute` to do the size check for us (see + // `from_integer's comment`), but whatever, this gets compiled into + // nothing in release. Note that we don't check the result of cast + assert!(size_of::() == size_of::()); + + // SAFETY: The unsafe contract requires that these have identical + // representations, and that the range be entirely valid. Using + // transmute_copy instead of transmute here is annoying, but is required + // as `Self` and `Self::Int` have unspecified sizes still. + unsafe { transmute_copy::(&self) } + } +} + +macro_rules! impl_contiguous { + ($($src:ty as $repr:ident in [$min:expr, $max:expr];)*) => {$( + unsafe impl Contiguous for $src { + type Int = $repr; + const MAX_VALUE: $repr = $max; + const MIN_VALUE: $repr = $min; + } + )*}; +} + +impl_contiguous! { + bool as u8 in [0, 1]; + + u8 as u8 in [0, u8::max_value()]; + u16 as u16 in [0, u16::max_value()]; + u32 as u32 in [0, u32::max_value()]; + u64 as u64 in [0, u64::max_value()]; + u128 as u128 in [0, u128::max_value()]; + usize as usize in [0, usize::max_value()]; + + i8 as i8 in [i8::min_value(), i8::max_value()]; + i16 as i16 in [i16::min_value(), i16::max_value()]; + i32 as i32 in [i32::min_value(), i32::max_value()]; + i64 as i64 in [i64::min_value(), i64::max_value()]; + i128 as i128 in [i128::min_value(), i128::max_value()]; + isize as isize in [isize::min_value(), isize::max_value()]; + + NonZeroU8 as u8 in [1, u8::max_value()]; + NonZeroU16 as u16 in [1, u16::max_value()]; + NonZeroU32 as u32 in [1, u32::max_value()]; + NonZeroU64 as u64 in [1, u64::max_value()]; + NonZeroU128 as u128 in [1, u128::max_value()]; + NonZeroUsize as usize in [1, usize::max_value()]; +} diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/src/lib.rs b/third_party/cargo/vendor/bytemuck-1.5.1/src/lib.rs similarity index 94% rename from third_party/cargo/vendor/bytemuck-1.4.1/src/lib.rs rename to third_party/cargo/vendor/bytemuck-1.5.1/src/lib.rs index ccbdbda..f8bc018 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/src/lib.rs +++ b/third_party/cargo/vendor/bytemuck-1.5.1/src/lib.rs @@ -1,442 +1,450 @@ -#![no_std] -#![warn(missing_docs)] - -//! This crate gives small utilities for casting between plain data types. -//! -//! ## Basics -//! -//! Data comes in five basic forms in Rust, so we have five basic casting -//! functions: -//! -//! * `T` uses [`cast`] -//! * `&T` uses [`cast_ref`] -//! * `&mut T` uses [`cast_mut`] -//! * `&[T]` uses [`cast_slice`] -//! * `&mut [T]` uses [`cast_slice_mut`] -//! -//! Some casts will never fail (eg: `cast::` always works), other -//! casts might fail (eg: `cast_ref::<[u8; 4], u32>` will fail if the reference -//! isn't already aligned to 4). Each casting function has a "try" version which -//! will return a `Result`, and the "normal" version which will simply panic on -//! invalid input. -//! -//! ## Using Your Own Types -//! -//! All the functions here are guarded by the [`Pod`] trait, which is a -//! sub-trait of the [`Zeroable`] trait. -//! -//! If you're very sure that your type is eligible, you can implement those -//! traits for your type and then they'll have full casting support. However, -//! these traits are `unsafe`, and you should carefully read the requirements -//! before adding the them to your own types. -//! -//! ## Features -//! -//! * This crate is core only by default, but if you're using Rust 1.36 or later -//! you can enable the `extern_crate_alloc` cargo feature for some additional -//! methods related to `Box` and `Vec`. Note that the `docs.rs` documentation -//! is always built with `extern_crate_alloc` cargo feature enabled. - -#[cfg(target_arch = "x86")] -use core::arch::x86; -#[cfg(target_arch = "x86_64")] -use core::arch::x86_64; -// -use core::{marker::*, mem::*, num::*, ptr::*}; - -// Used from macros to ensure we aren't using some locally defined name and -// actually are referencing libcore. This also would allow pre-2018 edition -// crates to use our macros, but I'm not sure how important that is. -#[doc(hidden)] -pub use ::core as __core; - -macro_rules! impl_unsafe_marker_for_array { - ( $marker:ident , $( $n:expr ),* ) => { - $(unsafe impl $marker for [T; $n] where T: $marker {})* - } -} - -#[cfg(feature = "extern_crate_std")] -extern crate std; - -#[cfg(feature = "extern_crate_alloc")] -extern crate alloc; -#[cfg(feature = "extern_crate_alloc")] -pub mod allocation; -#[cfg(feature = "extern_crate_alloc")] -pub use allocation::*; - -mod zeroable; -pub use zeroable::*; - -mod pod; -pub use pod::*; - -mod contiguous; -pub use contiguous::*; - -mod offset_of; -pub use offset_of::*; - -mod transparent; -pub use transparent::*; - -#[cfg(feature = "derive")] -pub use bytemuck_derive::{Zeroable, Pod, TransparentWrapper, Contiguous}; - -/* - -Note(Lokathor): We've switched all of the `unwrap` to `match` because there is -apparently a bug: https://github.com/rust-lang/rust/issues/68667 -and it doesn't seem to show up in simple godbolt examples but has been reported -as having an impact when there's a cast mixed in with other more complicated -code around it. Rustc/LLVM ends up missing that the `Err` can't ever happen for -particular type combinations, and then it doesn't fully eliminated the panic -possibility code branch. - -*/ - -/// Immediately panics. -#[cold] -#[inline(never)] -fn something_went_wrong(src: &str, err: PodCastError) -> ! { - // Note(Lokathor): Keeping the panic here makes the panic _formatting_ go - // here too, which helps assembly readability and also helps keep down - // the inline pressure. - panic!("{src}>{err:?}", src = src, err = err) -} - -/// Re-interprets `&T` as `&[u8]`. -/// -/// Any ZST becomes an empty slice, and in that case the pointer value of that -/// empty slice might not match the pointer value of the input reference. -#[inline] -pub fn bytes_of(t: &T) -> &[u8] { - match try_cast_slice::(core::slice::from_ref(t)) { - Ok(s) => s, - Err(_) => unreachable!(), - } -} - -/// Re-interprets `&mut T` as `&mut [u8]`. -/// -/// Any ZST becomes an empty slice, and in that case the pointer value of that -/// empty slice might not match the pointer value of the input reference. -#[inline] -pub fn bytes_of_mut(t: &mut T) -> &mut [u8] { - match try_cast_slice_mut::(core::slice::from_mut(t)) { - Ok(s) => s, - Err(_) => unreachable!(), - } -} - -/// Re-interprets `&[u8]` as `&T`. -/// -/// ## Panics -/// -/// This is [`try_from_bytes`] but will panic on error. -#[inline] -pub fn from_bytes(s: &[u8]) -> &T { - match try_from_bytes(s) { - Ok(t) => t, - Err(e) => something_went_wrong("from_bytes", e), - } -} - -/// Re-interprets `&mut [u8]` as `&mut T`. -/// -/// ## Panics -/// -/// This is [`try_from_bytes_mut`] but will panic on error. -#[inline] -pub fn from_bytes_mut(s: &mut [u8]) -> &mut T { - match try_from_bytes_mut(s) { - Ok(t) => t, - Err(e) => something_went_wrong("from_bytes_mut", e), - } -} - -/// Re-interprets `&[u8]` as `&T`. -/// -/// ## Failure -/// -/// * If the slice isn't aligned for the new type -/// * If the slice's length isn’t exactly the size of the new type -#[inline] -pub fn try_from_bytes(s: &[u8]) -> Result<&T, PodCastError> { - if s.len() != size_of::() { - Err(PodCastError::SizeMismatch) - } else if (s.as_ptr() as usize) % align_of::() != 0 { - Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) - } else { - Ok(unsafe { &*(s.as_ptr() as *const T) }) - } -} - -/// Re-interprets `&mut [u8]` as `&mut T`. -/// -/// ## Failure -/// -/// * If the slice isn't aligned for the new type -/// * If the slice's length isn’t exactly the size of the new type -#[inline] -pub fn try_from_bytes_mut( - s: &mut [u8], -) -> Result<&mut T, PodCastError> { - if s.len() != size_of::() { - Err(PodCastError::SizeMismatch) - } else if (s.as_ptr() as usize) % align_of::() != 0 { - Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) - } else { - Ok(unsafe { &mut *(s.as_mut_ptr() as *mut T) }) - } -} - -/// The things that can go wrong when casting between [`Pod`] data forms. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub enum PodCastError { - /// You tried to cast a slice to an element type with a higher alignment - /// requirement but the slice wasn't aligned. - TargetAlignmentGreaterAndInputNotAligned, - /// If the element size changes then the output slice changes length - /// accordingly. If the output slice wouldn't be a whole number of elements - /// then the conversion fails. - OutputSliceWouldHaveSlop, - /// When casting a slice you can't convert between ZST elements and non-ZST - /// elements. When casting an individual `T`, `&T`, or `&mut T` value the - /// source size and destination size must be an exact match. - SizeMismatch, - /// For this type of cast the alignments must be exactly the same and they - /// were not so now you're sad. - /// - /// This error is generated **only** by operations that cast allocated types - /// (such as `Box` and `Vec`), because in that case the alignment must stay - /// exact. - AlignmentMismatch, -} -impl core::fmt::Display for PodCastError { - fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - write!(f, "{:?}", self) - } -} -#[cfg(feature = "extern_crate_std")] -impl std::error::Error for PodCastError {} - -/// Cast `T` into `U` -/// -/// ## Panics -/// -/// * This is like [`try_cast`](try_cast), but will panic on a size mismatch. -#[inline] -pub fn cast(a: A) -> B { - if size_of::() == size_of::() { - unsafe { core::mem::transmute_copy(&a) } - } else { - something_went_wrong("cast", PodCastError::SizeMismatch) - } -} - -/// Cast `&mut T` into `&mut U`. -/// -/// ## Panics -/// -/// This is [`try_cast_mut`] but will panic on error. -#[inline] -pub fn cast_mut(a: &mut A) -> &mut B { - if size_of::() == size_of::() && align_of::() >= align_of::() { - // Plz mr compiler, just notice that we can't ever hit Err in this case. - match try_cast_mut(a) { - Ok(b) => b, - Err(_) => unreachable!(), - } - } else { - match try_cast_mut(a) { - Ok(b) => b, - Err(e) => something_went_wrong("cast_mut", e), - } - } -} - -/// Cast `&T` into `&U`. -/// -/// ## Panics -/// -/// This is [`try_cast_ref`] but will panic on error. -#[inline] -pub fn cast_ref(a: &A) -> &B { - if size_of::() == size_of::() && align_of::() >= align_of::() { - // Plz mr compiler, just notice that we can't ever hit Err in this case. - match try_cast_ref(a) { - Ok(b) => b, - Err(_) => unreachable!(), - } - } else { - match try_cast_ref(a) { - Ok(b) => b, - Err(e) => something_went_wrong("cast_ref", e), - } - } -} - -/// Cast `&[A]` into `&[B]`. -/// -/// ## Panics -/// -/// This is [`try_cast_slice`] but will panic on error. -#[inline] -pub fn cast_slice(a: &[A]) -> &[B] { - match try_cast_slice(a) { - Ok(b) => b, - Err(e) => something_went_wrong("cast_slice", e), - } -} - -/// Cast `&mut [T]` into `&mut [U]`. -/// -/// ## Panics -/// -/// This is [`try_cast_slice_mut`] but will panic on error. -#[inline] -pub fn cast_slice_mut(a: &mut [A]) -> &mut [B] { - match try_cast_slice_mut(a) { - Ok(b) => b, - Err(e) => something_went_wrong("cast_slice_mut", e), - } -} - -/// As `align_to`, but safe because of the [`Pod`] bound. -#[inline] -pub fn pod_align_to(vals: &[T]) -> (&[T], &[U], &[T]) { - unsafe { vals.align_to::() } -} - -/// As `align_to_mut`, but safe because of the [`Pod`] bound. -#[inline] -pub fn pod_align_to_mut( - vals: &mut [T], -) -> (&mut [T], &mut [U], &mut [T]) { - unsafe { vals.align_to_mut::() } -} - -/// Try to cast `T` into `U`. -/// -/// Note that for this particular type of cast, alignment isn't a factor. The -/// input value is semantically copied into the function and then returned to a -/// new memory location which will have whatever the required alignment of the -/// output type is. -/// -/// ## Failure -/// -/// * If the types don't have the same size this fails. -#[inline] -pub fn try_cast(a: A) -> Result { - if size_of::() == size_of::() { - Ok(unsafe { core::mem::transmute_copy(&a) }) - } else { - Err(PodCastError::SizeMismatch) - } -} - -/// Try to convert a `&T` into `&U`. -/// -/// ## Failure -/// -/// * If the reference isn't aligned in the new type -/// * If the source type and target type aren't the same size. -#[inline] -pub fn try_cast_ref(a: &A) -> Result<&B, PodCastError> { - // Note(Lokathor): everything with `align_of` and `size_of` will optimize away - // after monomorphization. - if align_of::() > align_of::() - && (a as *const A as usize) % align_of::() != 0 - { - Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) - } else if size_of::() == size_of::() { - Ok(unsafe { &*(a as *const A as *const B) }) - } else { - Err(PodCastError::SizeMismatch) - } -} - -/// Try to convert a `&mut T` into `&mut U`. -/// -/// As [`try_cast_ref`], but `mut`. -#[inline] -pub fn try_cast_mut(a: &mut A) -> Result<&mut B, PodCastError> { - // Note(Lokathor): everything with `align_of` and `size_of` will optimize away - // after monomorphization. - if align_of::() > align_of::() - && (a as *mut A as usize) % align_of::() != 0 - { - Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) - } else if size_of::() == size_of::() { - Ok(unsafe { &mut *(a as *mut A as *mut B) }) - } else { - Err(PodCastError::SizeMismatch) - } -} - -/// Try to convert `&[A]` into `&[B]` (possibly with a change in length). -/// -/// * `input.as_ptr() as usize == output.as_ptr() as usize` -/// * `input.len() * size_of::() == output.len() * size_of::()` -/// -/// ## Failure -/// -/// * If the target type has a greater alignment requirement and the input slice -/// isn't aligned. -/// * If the target element type is a different size from the current element -/// type, and the output slice wouldn't be a whole number of elements when -/// accounting for the size change (eg: 3 `u16` values is 1.5 `u32` values, so -/// that's a failure). -/// * Similarly, you can't convert between a [ZST](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts) -/// and a non-ZST. -#[inline] -pub fn try_cast_slice(a: &[A]) -> Result<&[B], PodCastError> { - // Note(Lokathor): everything with `align_of` and `size_of` will optimize away - // after monomorphization. - if align_of::() > align_of::() - && (a.as_ptr() as usize) % align_of::() != 0 - { - Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) - } else if size_of::() == size_of::() { - Ok(unsafe { core::slice::from_raw_parts(a.as_ptr() as *const B, a.len()) }) - } else if size_of::() == 0 || size_of::() == 0 { - Err(PodCastError::SizeMismatch) - } else if core::mem::size_of_val(a) % size_of::() == 0 { - let new_len = core::mem::size_of_val(a) / size_of::(); - Ok(unsafe { core::slice::from_raw_parts(a.as_ptr() as *const B, new_len) }) - } else { - Err(PodCastError::OutputSliceWouldHaveSlop) - } -} - -/// Try to convert `&mut [A]` into `&mut [B]` (possibly with a change in -/// length). -/// -/// As [`try_cast_slice`], but `&mut`. -#[inline] -pub fn try_cast_slice_mut( - a: &mut [A], -) -> Result<&mut [B], PodCastError> { - // Note(Lokathor): everything with `align_of` and `size_of` will optimize away - // after monomorphization. - if align_of::() > align_of::() - && (a.as_mut_ptr() as usize) % align_of::() != 0 - { - Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) - } else if size_of::() == size_of::() { - Ok(unsafe { - core::slice::from_raw_parts_mut(a.as_mut_ptr() as *mut B, a.len()) - }) - } else if size_of::() == 0 || size_of::() == 0 { - Err(PodCastError::SizeMismatch) - } else if core::mem::size_of_val(a) % size_of::() == 0 { - let new_len = core::mem::size_of_val(a) / size_of::(); - Ok(unsafe { - core::slice::from_raw_parts_mut(a.as_mut_ptr() as *mut B, new_len) - }) - } else { - Err(PodCastError::OutputSliceWouldHaveSlop) - } -} +#![no_std] +#![warn(missing_docs)] + +//! This crate gives small utilities for casting between plain data types. +//! +//! ## Basics +//! +//! Data comes in five basic forms in Rust, so we have five basic casting +//! functions: +//! +//! * `T` uses [`cast`] +//! * `&T` uses [`cast_ref`] +//! * `&mut T` uses [`cast_mut`] +//! * `&[T]` uses [`cast_slice`] +//! * `&mut [T]` uses [`cast_slice_mut`] +//! +//! Some casts will never fail (eg: `cast::` always works), other +//! casts might fail (eg: `cast_ref::<[u8; 4], u32>` will fail if the reference +//! isn't already aligned to 4). Each casting function has a "try" version which +//! will return a `Result`, and the "normal" version which will simply panic on +//! invalid input. +//! +//! ## Using Your Own Types +//! +//! All the functions here are guarded by the [`Pod`] trait, which is a +//! sub-trait of the [`Zeroable`] trait. +//! +//! If you're very sure that your type is eligible, you can implement those +//! traits for your type and then they'll have full casting support. However, +//! these traits are `unsafe`, and you should carefully read the requirements +//! before adding the them to your own types. +//! +//! ## Features +//! +//! * This crate is core only by default, but if you're using Rust 1.36 or later +//! you can enable the `extern_crate_alloc` cargo feature for some additional +//! methods related to `Box` and `Vec`. Note that the `docs.rs` documentation +//! is always built with `extern_crate_alloc` cargo feature enabled. + +#[cfg(target_arch = "x86")] +use core::arch::x86; +#[cfg(target_arch = "x86_64")] +use core::arch::x86_64; +// +use core::{marker::*, mem::*, num::*, ptr::*}; + +// Used from macros to ensure we aren't using some locally defined name and +// actually are referencing libcore. This also would allow pre-2018 edition +// crates to use our macros, but I'm not sure how important that is. +#[doc(hidden)] +pub use ::core as __core; + +macro_rules! impl_unsafe_marker_for_array { + ( $marker:ident , $( $n:expr ),* ) => { + $(unsafe impl $marker for [T; $n] where T: $marker {})* + } +} + +#[cfg(feature = "extern_crate_std")] +extern crate std; + +#[cfg(feature = "extern_crate_alloc")] +extern crate alloc; +#[cfg(feature = "extern_crate_alloc")] +pub mod allocation; +#[cfg(feature = "extern_crate_alloc")] +pub use allocation::*; + +mod zeroable; +pub use zeroable::*; + +mod pod; +pub use pod::*; + +mod contiguous; +pub use contiguous::*; + +mod offset_of; +pub use offset_of::*; + +mod transparent; +pub use transparent::*; + +#[cfg(feature = "derive")] +pub use bytemuck_derive::{Contiguous, Pod, TransparentWrapper, Zeroable}; + +/* + +Note(Lokathor): We've switched all of the `unwrap` to `match` because there is +apparently a bug: https://github.com/rust-lang/rust/issues/68667 +and it doesn't seem to show up in simple godbolt examples but has been reported +as having an impact when there's a cast mixed in with other more complicated +code around it. Rustc/LLVM ends up missing that the `Err` can't ever happen for +particular type combinations, and then it doesn't fully eliminated the panic +possibility code branch. + +*/ + +/// Immediately panics. +#[cold] +#[inline(never)] +fn something_went_wrong(src: &str, err: PodCastError) -> ! { + // Note(Lokathor): Keeping the panic here makes the panic _formatting_ go + // here too, which helps assembly readability and also helps keep down + // the inline pressure. + panic!("{src}>{err:?}", src = src, err = err) +} + +/// Re-interprets `&T` as `&[u8]`. +/// +/// Any ZST becomes an empty slice, and in that case the pointer value of that +/// empty slice might not match the pointer value of the input reference. +#[inline] +pub fn bytes_of(t: &T) -> &[u8] { + if size_of::() == 0 { + &[] + } else { + match try_cast_slice::(core::slice::from_ref(t)) { + Ok(s) => s, + Err(_) => unreachable!(), + } + } +} + +/// Re-interprets `&mut T` as `&mut [u8]`. +/// +/// Any ZST becomes an empty slice, and in that case the pointer value of that +/// empty slice might not match the pointer value of the input reference. +#[inline] +pub fn bytes_of_mut(t: &mut T) -> &mut [u8] { + if size_of::() == 0 { + &mut [] + } else { + match try_cast_slice_mut::(core::slice::from_mut(t)) { + Ok(s) => s, + Err(_) => unreachable!(), + } + } +} + +/// Re-interprets `&[u8]` as `&T`. +/// +/// ## Panics +/// +/// This is [`try_from_bytes`] but will panic on error. +#[inline] +pub fn from_bytes(s: &[u8]) -> &T { + match try_from_bytes(s) { + Ok(t) => t, + Err(e) => something_went_wrong("from_bytes", e), + } +} + +/// Re-interprets `&mut [u8]` as `&mut T`. +/// +/// ## Panics +/// +/// This is [`try_from_bytes_mut`] but will panic on error. +#[inline] +pub fn from_bytes_mut(s: &mut [u8]) -> &mut T { + match try_from_bytes_mut(s) { + Ok(t) => t, + Err(e) => something_went_wrong("from_bytes_mut", e), + } +} + +/// Re-interprets `&[u8]` as `&T`. +/// +/// ## Failure +/// +/// * If the slice isn't aligned for the new type +/// * If the slice's length isn’t exactly the size of the new type +#[inline] +pub fn try_from_bytes(s: &[u8]) -> Result<&T, PodCastError> { + if s.len() != size_of::() { + Err(PodCastError::SizeMismatch) + } else if (s.as_ptr() as usize) % align_of::() != 0 { + Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) + } else { + Ok(unsafe { &*(s.as_ptr() as *const T) }) + } +} + +/// Re-interprets `&mut [u8]` as `&mut T`. +/// +/// ## Failure +/// +/// * If the slice isn't aligned for the new type +/// * If the slice's length isn’t exactly the size of the new type +#[inline] +pub fn try_from_bytes_mut( + s: &mut [u8], +) -> Result<&mut T, PodCastError> { + if s.len() != size_of::() { + Err(PodCastError::SizeMismatch) + } else if (s.as_ptr() as usize) % align_of::() != 0 { + Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) + } else { + Ok(unsafe { &mut *(s.as_mut_ptr() as *mut T) }) + } +} + +/// The things that can go wrong when casting between [`Pod`] data forms. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub enum PodCastError { + /// You tried to cast a slice to an element type with a higher alignment + /// requirement but the slice wasn't aligned. + TargetAlignmentGreaterAndInputNotAligned, + /// If the element size changes then the output slice changes length + /// accordingly. If the output slice wouldn't be a whole number of elements + /// then the conversion fails. + OutputSliceWouldHaveSlop, + /// When casting a slice you can't convert between ZST elements and non-ZST + /// elements. When casting an individual `T`, `&T`, or `&mut T` value the + /// source size and destination size must be an exact match. + SizeMismatch, + /// For this type of cast the alignments must be exactly the same and they + /// were not so now you're sad. + /// + /// This error is generated **only** by operations that cast allocated types + /// (such as `Box` and `Vec`), because in that case the alignment must stay + /// exact. + AlignmentMismatch, +} +impl core::fmt::Display for PodCastError { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{:?}", self) + } +} +#[cfg(feature = "extern_crate_std")] +impl std::error::Error for PodCastError {} + +/// Cast `T` into `U` +/// +/// ## Panics +/// +/// * This is like [`try_cast`](try_cast), but will panic on a size mismatch. +#[inline] +pub fn cast(a: A) -> B { + if size_of::() == size_of::() { + unsafe { core::mem::transmute_copy(&a) } + } else { + something_went_wrong("cast", PodCastError::SizeMismatch) + } +} + +/// Cast `&mut T` into `&mut U`. +/// +/// ## Panics +/// +/// This is [`try_cast_mut`] but will panic on error. +#[inline] +pub fn cast_mut(a: &mut A) -> &mut B { + if size_of::() == size_of::() && align_of::() >= align_of::() { + // Plz mr compiler, just notice that we can't ever hit Err in this case. + match try_cast_mut(a) { + Ok(b) => b, + Err(_) => unreachable!(), + } + } else { + match try_cast_mut(a) { + Ok(b) => b, + Err(e) => something_went_wrong("cast_mut", e), + } + } +} + +/// Cast `&T` into `&U`. +/// +/// ## Panics +/// +/// This is [`try_cast_ref`] but will panic on error. +#[inline] +pub fn cast_ref(a: &A) -> &B { + if size_of::() == size_of::() && align_of::() >= align_of::() { + // Plz mr compiler, just notice that we can't ever hit Err in this case. + match try_cast_ref(a) { + Ok(b) => b, + Err(_) => unreachable!(), + } + } else { + match try_cast_ref(a) { + Ok(b) => b, + Err(e) => something_went_wrong("cast_ref", e), + } + } +} + +/// Cast `&[A]` into `&[B]`. +/// +/// ## Panics +/// +/// This is [`try_cast_slice`] but will panic on error. +#[inline] +pub fn cast_slice(a: &[A]) -> &[B] { + match try_cast_slice(a) { + Ok(b) => b, + Err(e) => something_went_wrong("cast_slice", e), + } +} + +/// Cast `&mut [T]` into `&mut [U]`. +/// +/// ## Panics +/// +/// This is [`try_cast_slice_mut`] but will panic on error. +#[inline] +pub fn cast_slice_mut(a: &mut [A]) -> &mut [B] { + match try_cast_slice_mut(a) { + Ok(b) => b, + Err(e) => something_went_wrong("cast_slice_mut", e), + } +} + +/// As `align_to`, but safe because of the [`Pod`] bound. +#[inline] +pub fn pod_align_to(vals: &[T]) -> (&[T], &[U], &[T]) { + unsafe { vals.align_to::() } +} + +/// As `align_to_mut`, but safe because of the [`Pod`] bound. +#[inline] +pub fn pod_align_to_mut( + vals: &mut [T], +) -> (&mut [T], &mut [U], &mut [T]) { + unsafe { vals.align_to_mut::() } +} + +/// Try to cast `T` into `U`. +/// +/// Note that for this particular type of cast, alignment isn't a factor. The +/// input value is semantically copied into the function and then returned to a +/// new memory location which will have whatever the required alignment of the +/// output type is. +/// +/// ## Failure +/// +/// * If the types don't have the same size this fails. +#[inline] +pub fn try_cast(a: A) -> Result { + if size_of::() == size_of::() { + Ok(unsafe { core::mem::transmute_copy(&a) }) + } else { + Err(PodCastError::SizeMismatch) + } +} + +/// Try to convert a `&T` into `&U`. +/// +/// ## Failure +/// +/// * If the reference isn't aligned in the new type +/// * If the source type and target type aren't the same size. +#[inline] +pub fn try_cast_ref(a: &A) -> Result<&B, PodCastError> { + // Note(Lokathor): everything with `align_of` and `size_of` will optimize away + // after monomorphization. + if align_of::() > align_of::() + && (a as *const A as usize) % align_of::() != 0 + { + Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) + } else if size_of::() == size_of::() { + Ok(unsafe { &*(a as *const A as *const B) }) + } else { + Err(PodCastError::SizeMismatch) + } +} + +/// Try to convert a `&mut T` into `&mut U`. +/// +/// As [`try_cast_ref`], but `mut`. +#[inline] +pub fn try_cast_mut(a: &mut A) -> Result<&mut B, PodCastError> { + // Note(Lokathor): everything with `align_of` and `size_of` will optimize away + // after monomorphization. + if align_of::() > align_of::() + && (a as *mut A as usize) % align_of::() != 0 + { + Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) + } else if size_of::() == size_of::() { + Ok(unsafe { &mut *(a as *mut A as *mut B) }) + } else { + Err(PodCastError::SizeMismatch) + } +} + +/// Try to convert `&[A]` into `&[B]` (possibly with a change in length). +/// +/// * `input.as_ptr() as usize == output.as_ptr() as usize` +/// * `input.len() * size_of::() == output.len() * size_of::()` +/// +/// ## Failure +/// +/// * If the target type has a greater alignment requirement and the input slice +/// isn't aligned. +/// * If the target element type is a different size from the current element +/// type, and the output slice wouldn't be a whole number of elements when +/// accounting for the size change (eg: 3 `u16` values is 1.5 `u32` values, so +/// that's a failure). +/// * Similarly, you can't convert between a [ZST](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts) +/// and a non-ZST. +#[inline] +pub fn try_cast_slice(a: &[A]) -> Result<&[B], PodCastError> { + // Note(Lokathor): everything with `align_of` and `size_of` will optimize away + // after monomorphization. + if align_of::() > align_of::() + && (a.as_ptr() as usize) % align_of::() != 0 + { + Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) + } else if size_of::() == size_of::() { + Ok(unsafe { core::slice::from_raw_parts(a.as_ptr() as *const B, a.len()) }) + } else if size_of::() == 0 || size_of::() == 0 { + Err(PodCastError::SizeMismatch) + } else if core::mem::size_of_val(a) % size_of::() == 0 { + let new_len = core::mem::size_of_val(a) / size_of::(); + Ok(unsafe { core::slice::from_raw_parts(a.as_ptr() as *const B, new_len) }) + } else { + Err(PodCastError::OutputSliceWouldHaveSlop) + } +} + +/// Try to convert `&mut [A]` into `&mut [B]` (possibly with a change in +/// length). +/// +/// As [`try_cast_slice`], but `&mut`. +#[inline] +pub fn try_cast_slice_mut( + a: &mut [A], +) -> Result<&mut [B], PodCastError> { + // Note(Lokathor): everything with `align_of` and `size_of` will optimize away + // after monomorphization. + if align_of::() > align_of::() + && (a.as_mut_ptr() as usize) % align_of::() != 0 + { + Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) + } else if size_of::() == size_of::() { + Ok(unsafe { + core::slice::from_raw_parts_mut(a.as_mut_ptr() as *mut B, a.len()) + }) + } else if size_of::() == 0 || size_of::() == 0 { + Err(PodCastError::SizeMismatch) + } else if core::mem::size_of_val(a) % size_of::() == 0 { + let new_len = core::mem::size_of_val(a) / size_of::(); + Ok(unsafe { + core::slice::from_raw_parts_mut(a.as_mut_ptr() as *mut B, new_len) + }) + } else { + Err(PodCastError::OutputSliceWouldHaveSlop) + } +} diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/src/offset_of.rs b/third_party/cargo/vendor/bytemuck-1.5.1/src/offset_of.rs similarity index 97% rename from third_party/cargo/vendor/bytemuck-1.4.1/src/offset_of.rs rename to third_party/cargo/vendor/bytemuck-1.5.1/src/offset_of.rs index 604379a..eb6f8a9 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/src/offset_of.rs +++ b/third_party/cargo/vendor/bytemuck-1.5.1/src/offset_of.rs @@ -1,132 +1,132 @@ -#![forbid(unsafe_code)] - -/// Find the offset in bytes of the given `$field` of `$Type`. Requires an -/// already initialized `$instance` value to work with. -/// -/// This is similar to the macro from [`memoffset`](https://docs.rs/memoffset), -/// however it uses no `unsafe` code. -/// -/// This macro has a 3-argument and 2-argument version. -/// * In the 3-arg version you specify an instance of the type, the type itself, -/// and the field name. -/// * In the 2-arg version the macro will call the [`default`](Default::default) -/// method to make a temporary instance of the type for you. -/// -/// The output of this macro is the byte offset of the field (as a `usize`). The -/// calculations of the macro are fixed across the entire program, but if the -/// type used is `repr(Rust)` then they're *not* fixed across compilations or -/// compilers. -/// -/// ## Examples -/// -/// ### 3-arg Usage -/// -/// ```rust -/// # use bytemuck::offset_of; -/// // enums can't derive default, and for this example we don't pick one -/// enum MyExampleEnum { -/// A, B, C, -/// } -/// -/// // so now our struct here doesn't have Default -/// #[repr(C)] -/// struct MyNotDefaultType { -/// pub counter: i32, -/// pub some_field: MyExampleEnum, -/// } -/// -/// // but we provide an instance of the type and it's all good. -/// let val = MyNotDefaultType { counter: 5, some_field: MyExampleEnum::A }; -/// assert_eq!(offset_of!(val, MyNotDefaultType, some_field), 4); -/// ``` -/// -/// ### 2-arg Usage -/// -/// ```rust -/// # use bytemuck::offset_of; -/// #[derive(Default)] -/// #[repr(C)] -/// struct Vertex { -/// pub loc: [f32; 3], -/// pub color: [f32; 3], -/// } -/// // if the type impls Default the macro can make its own default instance. -/// assert_eq!(offset_of!(Vertex, loc), 0); -/// assert_eq!(offset_of!(Vertex, color), 12); -/// ``` -/// -/// # Usage with `#[repr(packed)]` structs -/// -/// Attempting to compute the offset of a `#[repr(packed)]` struct with -/// `bytemuck::offset_of!` requires an `unsafe` block. We hope to relax this in -/// the future, but currently it is required to work around a soundness hole in -/// Rust (See [rust-lang/rust#27060]). -/// -/// [rust-lang/rust#27060]: https://github.com/rust-lang/rust/issues/27060 -/// -///

-/// Warning: This is only true for versions of bytemuck > 1.4.0. -/// Previous versions of -/// bytemuck::offset_of! -/// will only emit a warning when used on the field of a packed struct in safe code, -/// which can lead to unsoundness. -///

-/// -/// For example, the following will fail to compile: -/// -/// ```compile_fail -/// #[repr(C, packed)] -/// #[derive(Default)] -/// struct Example { -/// field: u32, -/// } -/// // Doesn't compile: -/// let _offset = bytemuck::offset_of!(Example, field); -/// ``` -/// -/// While the error message this generates will mention the -/// `safe_packed_borrows` lint, the macro will still fail to compile even if -/// that lint is `#[allow]`ed: -/// -/// ```compile_fail -/// # #[repr(C, packed)] #[derive(Default)] struct Example { field: u32 } -/// // Still doesn't compile: -/// #[allow(safe_packed_borrows)] { -/// let _offset = bytemuck::offset_of!(Example, field); -/// } -/// ``` -/// -/// This *can* be worked around by using `unsafe`, but it is only sound to do so -/// if you can guarantee that taking a reference to the field is sound. -/// -/// In practice, this means it only works for fields of align(1) types, or if -/// you know the field's offset in advance (defeating the point of `offset_of`) -/// and can prove that the struct's alignment and the field's offset are enough -/// to prove the field's alignment. -/// -/// Once the `raw_ref` macros are available, a future version of this crate will -/// use them to lift the limitations of packed structs. For the duration of the -/// `1.x` version of this crate that will be behind an on-by-default cargo -/// feature (to maintain minimum rust version support). -#[macro_export] -macro_rules! offset_of { - ($instance:expr, $Type:path, $field:tt) => {{ - #[forbid(safe_packed_borrows)] - { - // This helps us guard against field access going through a Deref impl. - #[allow(clippy::unneeded_field_pattern)] - let $Type { $field: _, .. }; - let reference: &$Type = &$instance; - let address = reference as *const _ as usize; - let field_pointer = &reference.$field as *const _ as usize; - // These asserts/unwraps are compiled away at release, and defend against - // the case where somehow a deref impl is still invoked. - let result = field_pointer.checked_sub(address).unwrap(); - assert!(result <= $crate::__core::mem::size_of::<$Type>()); - result - } - }}; - ($Type:path, $field:tt) => {{ - $crate::offset_of!(<$Type as Default>::default(), $Type, $field) - }}; -} +#![forbid(unsafe_code)] + +/// Find the offset in bytes of the given `$field` of `$Type`. Requires an +/// already initialized `$instance` value to work with. +/// +/// This is similar to the macro from [`memoffset`](https://docs.rs/memoffset), +/// however it uses no `unsafe` code. +/// +/// This macro has a 3-argument and 2-argument version. +/// * In the 3-arg version you specify an instance of the type, the type itself, +/// and the field name. +/// * In the 2-arg version the macro will call the [`default`](Default::default) +/// method to make a temporary instance of the type for you. +/// +/// The output of this macro is the byte offset of the field (as a `usize`). The +/// calculations of the macro are fixed across the entire program, but if the +/// type used is `repr(Rust)` then they're *not* fixed across compilations or +/// compilers. +/// +/// ## Examples +/// +/// ### 3-arg Usage +/// +/// ```rust +/// # use bytemuck::offset_of; +/// // enums can't derive default, and for this example we don't pick one +/// enum MyExampleEnum { +/// A, B, C, +/// } +/// +/// // so now our struct here doesn't have Default +/// #[repr(C)] +/// struct MyNotDefaultType { +/// pub counter: i32, +/// pub some_field: MyExampleEnum, +/// } +/// +/// // but we provide an instance of the type and it's all good. +/// let val = MyNotDefaultType { counter: 5, some_field: MyExampleEnum::A }; +/// assert_eq!(offset_of!(val, MyNotDefaultType, some_field), 4); +/// ``` +/// +/// ### 2-arg Usage +/// +/// ```rust +/// # use bytemuck::offset_of; +/// #[derive(Default)] +/// #[repr(C)] +/// struct Vertex { +/// pub loc: [f32; 3], +/// pub color: [f32; 3], +/// } +/// // if the type impls Default the macro can make its own default instance. +/// assert_eq!(offset_of!(Vertex, loc), 0); +/// assert_eq!(offset_of!(Vertex, color), 12); +/// ``` +/// +/// # Usage with `#[repr(packed)]` structs +/// +/// Attempting to compute the offset of a `#[repr(packed)]` struct with +/// `bytemuck::offset_of!` requires an `unsafe` block. We hope to relax this in +/// the future, but currently it is required to work around a soundness hole in +/// Rust (See [rust-lang/rust#27060]). +/// +/// [rust-lang/rust#27060]: https://github.com/rust-lang/rust/issues/27060 +/// +///

+/// Warning: This is only true for versions of bytemuck > 1.4.0. +/// Previous versions of +/// bytemuck::offset_of! +/// will only emit a warning when used on the field of a packed struct in safe code, +/// which can lead to unsoundness. +///

+/// +/// For example, the following will fail to compile: +/// +/// ```compile_fail +/// #[repr(C, packed)] +/// #[derive(Default)] +/// struct Example { +/// field: u32, +/// } +/// // Doesn't compile: +/// let _offset = bytemuck::offset_of!(Example, field); +/// ``` +/// +/// While the error message this generates will mention the +/// `safe_packed_borrows` lint, the macro will still fail to compile even if +/// that lint is `#[allow]`ed: +/// +/// ```compile_fail +/// # #[repr(C, packed)] #[derive(Default)] struct Example { field: u32 } +/// // Still doesn't compile: +/// #[allow(safe_packed_borrows)] { +/// let _offset = bytemuck::offset_of!(Example, field); +/// } +/// ``` +/// +/// This *can* be worked around by using `unsafe`, but it is only sound to do so +/// if you can guarantee that taking a reference to the field is sound. +/// +/// In practice, this means it only works for fields of align(1) types, or if +/// you know the field's offset in advance (defeating the point of `offset_of`) +/// and can prove that the struct's alignment and the field's offset are enough +/// to prove the field's alignment. +/// +/// Once the `raw_ref` macros are available, a future version of this crate will +/// use them to lift the limitations of packed structs. For the duration of the +/// `1.x` version of this crate that will be behind an on-by-default cargo +/// feature (to maintain minimum rust version support). +#[macro_export] +macro_rules! offset_of { + ($instance:expr, $Type:path, $field:tt) => {{ + #[forbid(safe_packed_borrows)] + { + // This helps us guard against field access going through a Deref impl. + #[allow(clippy::unneeded_field_pattern)] + let $Type { $field: _, .. }; + let reference: &$Type = &$instance; + let address = reference as *const _ as usize; + let field_pointer = &reference.$field as *const _ as usize; + // These asserts/unwraps are compiled away at release, and defend against + // the case where somehow a deref impl is still invoked. + let result = field_pointer.checked_sub(address).unwrap(); + assert!(result <= $crate::__core::mem::size_of::<$Type>()); + result + } + }}; + ($Type:path, $field:tt) => {{ + $crate::offset_of!(<$Type as Default>::default(), $Type, $field) + }}; +} diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/src/pod.rs b/third_party/cargo/vendor/bytemuck-1.5.1/src/pod.rs similarity index 97% rename from third_party/cargo/vendor/bytemuck-1.4.1/src/pod.rs rename to third_party/cargo/vendor/bytemuck-1.5.1/src/pod.rs index e5cc693..ad0494e 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/src/pod.rs +++ b/third_party/cargo/vendor/bytemuck-1.5.1/src/pod.rs @@ -1,99 +1,99 @@ -use super::*; - -/// Marker trait for "plain old data". -/// -/// The point of this trait is that once something is marked "plain old data" -/// you can really go to town with the bit fiddling and bit casting. Therefore, -/// it's a relatively strong claim to make about a type. Do not add this to your -/// type casually. -/// -/// **Reminder:** The results of casting around bytes between data types are -/// _endian dependant_. Little-endian machines are the most common, but -/// big-endian machines do exist (and big-endian is also used for "network -/// order" bytes). -/// -/// ## Safety -/// -/// * The type must be inhabited (eg: no -/// [Infallible](core::convert::Infallible)). -/// * The type must allow any bit pattern (eg: no `bool` or `char`, which have -/// illegal bit patterns). -/// * The type must not contain any padding bytes, either in the middle or on -/// the end (eg: no `#[repr(C)] struct Foo(u8, u16)`, which has padding in the -/// middle, and also no `#[repr(C)] struct Foo(u16, u8)`, which has padding on -/// the end). -/// * The type needs to have all fields also be `Pod`. -/// * The type needs to be `repr(C)` or `repr(transparent)`. In the case of -/// `repr(C)`, the `packed` and `align` repr modifiers can be used as long as -/// all other rules end up being followed. -pub unsafe trait Pod: Zeroable + Copy + 'static {} - -unsafe impl Pod for () {} -unsafe impl Pod for u8 {} -unsafe impl Pod for i8 {} -unsafe impl Pod for u16 {} -unsafe impl Pod for i16 {} -unsafe impl Pod for u32 {} -unsafe impl Pod for i32 {} -unsafe impl Pod for u64 {} -unsafe impl Pod for i64 {} -unsafe impl Pod for usize {} -unsafe impl Pod for isize {} -unsafe impl Pod for u128 {} -unsafe impl Pod for i128 {} -unsafe impl Pod for f32 {} -unsafe impl Pod for f64 {} -unsafe impl Pod for Wrapping {} - -unsafe impl Pod for Option {} -unsafe impl Pod for Option {} -unsafe impl Pod for Option {} -unsafe impl Pod for Option {} -unsafe impl Pod for Option {} -unsafe impl Pod for Option {} -unsafe impl Pod for Option {} -unsafe impl Pod for Option {} -unsafe impl Pod for Option {} -unsafe impl Pod for Option {} -unsafe impl Pod for Option {} -unsafe impl Pod for Option {} - -unsafe impl Pod for *mut T {} -unsafe impl Pod for *const T {} -unsafe impl Pod for Option> {} -unsafe impl Pod for PhantomData {} -unsafe impl Pod for ManuallyDrop {} - -// Note(Lokathor): MaybeUninit can NEVER be Pod. - -impl_unsafe_marker_for_array!( - Pod, 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, 32, 48, 64, 96, 128, 256, - 512, 1024, 2048, 4096 -); - -#[cfg(target_arch = "x86")] -unsafe impl Pod for x86::__m128i {} -#[cfg(target_arch = "x86")] -unsafe impl Pod for x86::__m128 {} -#[cfg(target_arch = "x86")] -unsafe impl Pod for x86::__m128d {} -#[cfg(target_arch = "x86")] -unsafe impl Pod for x86::__m256i {} -#[cfg(target_arch = "x86")] -unsafe impl Pod for x86::__m256 {} -#[cfg(target_arch = "x86")] -unsafe impl Pod for x86::__m256d {} - -#[cfg(target_arch = "x86_64")] -unsafe impl Pod for x86_64::__m128i {} -#[cfg(target_arch = "x86_64")] -unsafe impl Pod for x86_64::__m128 {} -#[cfg(target_arch = "x86_64")] -unsafe impl Pod for x86_64::__m128d {} -#[cfg(target_arch = "x86_64")] -unsafe impl Pod for x86_64::__m256i {} -#[cfg(target_arch = "x86_64")] -unsafe impl Pod for x86_64::__m256 {} -#[cfg(target_arch = "x86_64")] -unsafe impl Pod for x86_64::__m256d {} +use super::*; + +/// Marker trait for "plain old data". +/// +/// The point of this trait is that once something is marked "plain old data" +/// you can really go to town with the bit fiddling and bit casting. Therefore, +/// it's a relatively strong claim to make about a type. Do not add this to your +/// type casually. +/// +/// **Reminder:** The results of casting around bytes between data types are +/// _endian dependant_. Little-endian machines are the most common, but +/// big-endian machines do exist (and big-endian is also used for "network +/// order" bytes). +/// +/// ## Safety +/// +/// * The type must be inhabited (eg: no +/// [Infallible](core::convert::Infallible)). +/// * The type must allow any bit pattern (eg: no `bool` or `char`, which have +/// illegal bit patterns). +/// * The type must not contain any padding bytes, either in the middle or on +/// the end (eg: no `#[repr(C)] struct Foo(u8, u16)`, which has padding in the +/// middle, and also no `#[repr(C)] struct Foo(u16, u8)`, which has padding on +/// the end). +/// * The type needs to have all fields also be `Pod`. +/// * The type needs to be `repr(C)` or `repr(transparent)`. In the case of +/// `repr(C)`, the `packed` and `align` repr modifiers can be used as long as +/// all other rules end up being followed. +pub unsafe trait Pod: Zeroable + Copy + 'static {} + +unsafe impl Pod for () {} +unsafe impl Pod for u8 {} +unsafe impl Pod for i8 {} +unsafe impl Pod for u16 {} +unsafe impl Pod for i16 {} +unsafe impl Pod for u32 {} +unsafe impl Pod for i32 {} +unsafe impl Pod for u64 {} +unsafe impl Pod for i64 {} +unsafe impl Pod for usize {} +unsafe impl Pod for isize {} +unsafe impl Pod for u128 {} +unsafe impl Pod for i128 {} +unsafe impl Pod for f32 {} +unsafe impl Pod for f64 {} +unsafe impl Pod for Wrapping {} + +unsafe impl Pod for Option {} +unsafe impl Pod for Option {} +unsafe impl Pod for Option {} +unsafe impl Pod for Option {} +unsafe impl Pod for Option {} +unsafe impl Pod for Option {} +unsafe impl Pod for Option {} +unsafe impl Pod for Option {} +unsafe impl Pod for Option {} +unsafe impl Pod for Option {} +unsafe impl Pod for Option {} +unsafe impl Pod for Option {} + +unsafe impl Pod for *mut T {} +unsafe impl Pod for *const T {} +unsafe impl Pod for Option> {} +unsafe impl Pod for PhantomData {} +unsafe impl Pod for ManuallyDrop {} + +// Note(Lokathor): MaybeUninit can NEVER be Pod. + +impl_unsafe_marker_for_array!( + Pod, 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, 32, 48, 64, 96, 128, 256, + 512, 1024, 2048, 4096 +); + +#[cfg(target_arch = "x86")] +unsafe impl Pod for x86::__m128i {} +#[cfg(target_arch = "x86")] +unsafe impl Pod for x86::__m128 {} +#[cfg(target_arch = "x86")] +unsafe impl Pod for x86::__m128d {} +#[cfg(target_arch = "x86")] +unsafe impl Pod for x86::__m256i {} +#[cfg(target_arch = "x86")] +unsafe impl Pod for x86::__m256 {} +#[cfg(target_arch = "x86")] +unsafe impl Pod for x86::__m256d {} + +#[cfg(target_arch = "x86_64")] +unsafe impl Pod for x86_64::__m128i {} +#[cfg(target_arch = "x86_64")] +unsafe impl Pod for x86_64::__m128 {} +#[cfg(target_arch = "x86_64")] +unsafe impl Pod for x86_64::__m128d {} +#[cfg(target_arch = "x86_64")] +unsafe impl Pod for x86_64::__m256i {} +#[cfg(target_arch = "x86_64")] +unsafe impl Pod for x86_64::__m256 {} +#[cfg(target_arch = "x86_64")] +unsafe impl Pod for x86_64::__m256d {} diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/src/transparent.rs b/third_party/cargo/vendor/bytemuck-1.5.1/src/transparent.rs similarity index 97% rename from third_party/cargo/vendor/bytemuck-1.4.1/src/transparent.rs rename to third_party/cargo/vendor/bytemuck-1.5.1/src/transparent.rs index fa6d479..620dcd5 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/src/transparent.rs +++ b/third_party/cargo/vendor/bytemuck-1.5.1/src/transparent.rs @@ -1,135 +1,135 @@ -use super::*; - -/// A trait which indicates that a type is a `repr(transparent)` wrapper around -/// the `Wrapped` value. -/// -/// This allows safely creating references to `T` from those to the `Wrapped` -/// type, using the `wrap_ref` and `wrap_mut` functions. -/// -/// # Safety -/// -/// The safety contract of `TransparentWrapper` is relatively simple: -/// -/// For a given `Wrapper` which implements `TransparentWrapper`: -/// -/// 1. Wrapper must be a `#[repr(transparent)]` wrapper around `Wrapped`. This -/// either means that it must be a `#[repr(transparent)]` struct which -/// contains a either a field of type `Wrapped` (or a field of some other -/// transparent wrapper for `Wrapped`) as the only non-ZST field. -/// -/// 2. Any fields *other* than the `Wrapped` field must be trivially -/// constructable ZSTs, for example `PhantomData`, `PhantomPinned`, etc. -/// -/// 3. The `Wrapper` may not impose additional alignment requirements over -/// `Wrapped`. -/// - Note: this is currently guaranteed by `repr(transparent)`, but there -/// have been discussions of lifting it, so it's stated here explicitly. -/// -/// 4. The `wrap_ref` and `wrap_mut` functions on `TransparentWrapper` may not -/// be overridden. -/// -/// ## Caveats -/// -/// If the wrapper imposes additional constraints upon the wrapped type which -/// are required for safety, it's responsible for ensuring those still hold -- -/// this generally requires preventing access to instances of the wrapped type, -/// as implementing `TransparentWrapper for T` means anybody can call -/// `T::cast_ref(any_instance_of_u)`. -/// -/// For example, it would be invalid to implement TransparentWrapper for `str` -/// to implement `TransparentWrapper` around `[u8]` because of this. -/// -/// # Examples -/// -/// ## Basic -/// -/// ``` -/// use bytemuck::TransparentWrapper; -/// # #[derive(Default)] -/// # struct SomeStruct(u32); -/// -/// #[repr(transparent)] -/// struct MyWrapper(SomeStruct); -/// -/// unsafe impl TransparentWrapper for MyWrapper {} -/// -/// // interpret a reference to &SomeStruct as a &MyWrapper -/// let thing = SomeStruct::default(); -/// let wrapped_ref: &MyWrapper = MyWrapper::wrap_ref(&thing); -/// -/// // Works with &mut too. -/// let mut mut_thing = SomeStruct::default(); -/// let wrapped_mut: &mut MyWrapper = MyWrapper::wrap_mut(&mut mut_thing); -/// -/// # let _ = (wrapped_ref, wrapped_mut); // silence warnings -/// ``` -/// -/// ## Use with dynamically sized types -/// -/// ``` -/// use bytemuck::TransparentWrapper; -/// -/// #[repr(transparent)] -/// struct Slice([T]); -/// -/// unsafe impl TransparentWrapper<[T]> for Slice {} -/// -/// let s = Slice::wrap_ref(&[1u32, 2, 3]); -/// assert_eq!(&s.0, &[1, 2, 3]); -/// -/// let mut buf = [1, 2, 3u8]; -/// let sm = Slice::wrap_mut(&mut buf); -/// ``` -pub unsafe trait TransparentWrapper { - /// Convert a reference to a wrapped type into a reference to the wrapper. - /// - /// This is a trait method so that you can write `MyType::wrap_ref(...)` in - /// your code. It is part of the safety contract for this trait that if you - /// implement `TransparentWrapper<_>` for your type you **must not** override - /// this method. - #[inline] - fn wrap_ref(s: &Wrapped) -> &Self { - unsafe { - assert!(size_of::<*const Wrapped>() == size_of::<*const Self>()); - // Using a pointer cast doesn't work here because rustc can't tell that the - // vtables match (if we lifted the ?Sized restriction, this would go away), - // and transmute doesn't work for the usual reasons it doesn't work inside - // generic functions. - // - // SAFETY: The unsafe contract requires that these have identical - // representations. Using this transmute_copy instead of transmute here is - // annoying, but is required as `Self` and `Wrapped` have unspecified - // sizes still. - let wrapped_ptr = s as *const Wrapped; - let wrapper_ptr: *const Self = transmute_copy(&wrapped_ptr); - &*wrapper_ptr - } - } - - /// Convert a mut reference to a wrapped type into a mut reference to the - /// wrapper. - /// - /// This is a trait method so that you can write `MyType::wrap_mut(...)` in - /// your code. It is part of the safety contract for this trait that if you implement - /// `TransparentWrapper<_>` for your type you **must not** override this method. - #[inline] - fn wrap_mut(s: &mut Wrapped) -> &mut Self { - unsafe { - assert!(size_of::<*mut Wrapped>() == size_of::<*mut Self>()); - // Using a pointer cast doesn't work here because rustc can't tell that the - // vtables match (if we lifted the ?Sized restriction, this would go away), - // and transmute doesn't work for the usual reasons it doesn't work inside - // generic functions. - // - // SAFETY: The unsafe contract requires that these have identical - // representations. Using this transmute_copy instead of transmute here is - // annoying, but is required as `Self` and `Wrapped` have unspecified - // sizes still. - let wrapped_ptr = s as *mut Wrapped; - let wrapper_ptr: *mut Self = transmute_copy(&wrapped_ptr); - &mut *wrapper_ptr - } - } -} - -unsafe impl TransparentWrapper for core::num::Wrapping {} +use super::*; + +/// A trait which indicates that a type is a `repr(transparent)` wrapper around +/// the `Wrapped` value. +/// +/// This allows safely creating references to `T` from those to the `Wrapped` +/// type, using the `wrap_ref` and `wrap_mut` functions. +/// +/// # Safety +/// +/// The safety contract of `TransparentWrapper` is relatively simple: +/// +/// For a given `Wrapper` which implements `TransparentWrapper`: +/// +/// 1. Wrapper must be a `#[repr(transparent)]` wrapper around `Wrapped`. This +/// either means that it must be a `#[repr(transparent)]` struct which +/// contains a either a field of type `Wrapped` (or a field of some other +/// transparent wrapper for `Wrapped`) as the only non-ZST field. +/// +/// 2. Any fields *other* than the `Wrapped` field must be trivially +/// constructable ZSTs, for example `PhantomData`, `PhantomPinned`, etc. +/// +/// 3. The `Wrapper` may not impose additional alignment requirements over +/// `Wrapped`. +/// - Note: this is currently guaranteed by `repr(transparent)`, but there +/// have been discussions of lifting it, so it's stated here explicitly. +/// +/// 4. The `wrap_ref` and `wrap_mut` functions on `TransparentWrapper` may not +/// be overridden. +/// +/// ## Caveats +/// +/// If the wrapper imposes additional constraints upon the wrapped type which +/// are required for safety, it's responsible for ensuring those still hold -- +/// this generally requires preventing access to instances of the wrapped type, +/// as implementing `TransparentWrapper for T` means anybody can call +/// `T::cast_ref(any_instance_of_u)`. +/// +/// For example, it would be invalid to implement TransparentWrapper for `str` +/// to implement `TransparentWrapper` around `[u8]` because of this. +/// +/// # Examples +/// +/// ## Basic +/// +/// ``` +/// use bytemuck::TransparentWrapper; +/// # #[derive(Default)] +/// # struct SomeStruct(u32); +/// +/// #[repr(transparent)] +/// struct MyWrapper(SomeStruct); +/// +/// unsafe impl TransparentWrapper for MyWrapper {} +/// +/// // interpret a reference to &SomeStruct as a &MyWrapper +/// let thing = SomeStruct::default(); +/// let wrapped_ref: &MyWrapper = MyWrapper::wrap_ref(&thing); +/// +/// // Works with &mut too. +/// let mut mut_thing = SomeStruct::default(); +/// let wrapped_mut: &mut MyWrapper = MyWrapper::wrap_mut(&mut mut_thing); +/// +/// # let _ = (wrapped_ref, wrapped_mut); // silence warnings +/// ``` +/// +/// ## Use with dynamically sized types +/// +/// ``` +/// use bytemuck::TransparentWrapper; +/// +/// #[repr(transparent)] +/// struct Slice([T]); +/// +/// unsafe impl TransparentWrapper<[T]> for Slice {} +/// +/// let s = Slice::wrap_ref(&[1u32, 2, 3]); +/// assert_eq!(&s.0, &[1, 2, 3]); +/// +/// let mut buf = [1, 2, 3u8]; +/// let sm = Slice::wrap_mut(&mut buf); +/// ``` +pub unsafe trait TransparentWrapper { + /// Convert a reference to a wrapped type into a reference to the wrapper. + /// + /// This is a trait method so that you can write `MyType::wrap_ref(...)` in + /// your code. It is part of the safety contract for this trait that if you + /// implement `TransparentWrapper<_>` for your type you **must not** override + /// this method. + #[inline] + fn wrap_ref(s: &Wrapped) -> &Self { + unsafe { + assert!(size_of::<*const Wrapped>() == size_of::<*const Self>()); + // Using a pointer cast doesn't work here because rustc can't tell that the + // vtables match (if we lifted the ?Sized restriction, this would go away), + // and transmute doesn't work for the usual reasons it doesn't work inside + // generic functions. + // + // SAFETY: The unsafe contract requires that these have identical + // representations. Using this transmute_copy instead of transmute here is + // annoying, but is required as `Self` and `Wrapped` have unspecified + // sizes still. + let wrapped_ptr = s as *const Wrapped; + let wrapper_ptr: *const Self = transmute_copy(&wrapped_ptr); + &*wrapper_ptr + } + } + + /// Convert a mut reference to a wrapped type into a mut reference to the + /// wrapper. + /// + /// This is a trait method so that you can write `MyType::wrap_mut(...)` in + /// your code. It is part of the safety contract for this trait that if you implement + /// `TransparentWrapper<_>` for your type you **must not** override this method. + #[inline] + fn wrap_mut(s: &mut Wrapped) -> &mut Self { + unsafe { + assert!(size_of::<*mut Wrapped>() == size_of::<*mut Self>()); + // Using a pointer cast doesn't work here because rustc can't tell that the + // vtables match (if we lifted the ?Sized restriction, this would go away), + // and transmute doesn't work for the usual reasons it doesn't work inside + // generic functions. + // + // SAFETY: The unsafe contract requires that these have identical + // representations. Using this transmute_copy instead of transmute here is + // annoying, but is required as `Self` and `Wrapped` have unspecified + // sizes still. + let wrapped_ptr = s as *mut Wrapped; + let wrapper_ptr: *mut Self = transmute_copy(&wrapped_ptr); + &mut *wrapper_ptr + } + } +} + +unsafe impl TransparentWrapper for core::num::Wrapping {} diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/src/zeroable.rs b/third_party/cargo/vendor/bytemuck-1.5.1/src/zeroable.rs similarity index 96% rename from third_party/cargo/vendor/bytemuck-1.4.1/src/zeroable.rs rename to third_party/cargo/vendor/bytemuck-1.5.1/src/zeroable.rs index ebd412f..a7798e0 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/src/zeroable.rs +++ b/third_party/cargo/vendor/bytemuck-1.5.1/src/zeroable.rs @@ -1,142 +1,142 @@ -use super::*; - -/// Trait for types that can be safely created with -/// [`zeroed`](core::mem::zeroed). -/// -/// An all-zeroes value may or may not be the same value as the -/// [Default](core::default::Default) value of the type. -/// -/// ## Safety -/// -/// * Your type must be inhabited (eg: no -/// [Infallible](core::convert::Infallible)). -/// * Your type must be allowed to be an "all zeroes" bit pattern (eg: no -/// [`NonNull`](core::ptr::NonNull)). -pub unsafe trait Zeroable: Sized { - /// Calls [`zeroed`](core::mem::zeroed). - /// - /// This is a trait method so that you can write `MyType::zeroed()` in your - /// code. It is a contract of this trait that if you implement it on your type - /// you **must not** override this method. - #[inline] - fn zeroed() -> Self { - unsafe { core::mem::zeroed() } - } -} -unsafe impl Zeroable for () {} -unsafe impl Zeroable for bool {} -unsafe impl Zeroable for char {} -unsafe impl Zeroable for u8 {} -unsafe impl Zeroable for i8 {} -unsafe impl Zeroable for u16 {} -unsafe impl Zeroable for i16 {} -unsafe impl Zeroable for u32 {} -unsafe impl Zeroable for i32 {} -unsafe impl Zeroable for u64 {} -unsafe impl Zeroable for i64 {} -unsafe impl Zeroable for usize {} -unsafe impl Zeroable for isize {} -unsafe impl Zeroable for u128 {} -unsafe impl Zeroable for i128 {} -unsafe impl Zeroable for f32 {} -unsafe impl Zeroable for f64 {} -unsafe impl Zeroable for Wrapping {} - -unsafe impl Zeroable for Option {} -unsafe impl Zeroable for Option {} -unsafe impl Zeroable for Option {} -unsafe impl Zeroable for Option {} -unsafe impl Zeroable for Option {} -unsafe impl Zeroable for Option {} -unsafe impl Zeroable for Option {} -unsafe impl Zeroable for Option {} -unsafe impl Zeroable for Option {} -unsafe impl Zeroable for Option {} -unsafe impl Zeroable for Option {} -unsafe impl Zeroable for Option {} - -unsafe impl Zeroable for *mut T {} -unsafe impl Zeroable for *const T {} -unsafe impl Zeroable for Option> {} -unsafe impl Zeroable for PhantomData {} -unsafe impl Zeroable for ManuallyDrop {} - -#[cfg(feature = "zeroable_maybe_uninit")] -unsafe impl Zeroable for core::mem::MaybeUninit {} - -unsafe impl Zeroable for (A,) {} -unsafe impl Zeroable for (A, B) {} -unsafe impl Zeroable for (A, B, C) {} -unsafe impl Zeroable - for (A, B, C, D) -{ -} -unsafe impl - Zeroable for (A, B, C, D, E) -{ -} -unsafe impl< - A: Zeroable, - B: Zeroable, - C: Zeroable, - D: Zeroable, - E: Zeroable, - F: Zeroable, - > Zeroable for (A, B, C, D, E, F) -{ -} -unsafe impl< - A: Zeroable, - B: Zeroable, - C: Zeroable, - D: Zeroable, - E: Zeroable, - F: Zeroable, - G: Zeroable, - > Zeroable for (A, B, C, D, E, F, G) -{ -} -unsafe impl< - A: Zeroable, - B: Zeroable, - C: Zeroable, - D: Zeroable, - E: Zeroable, - F: Zeroable, - G: Zeroable, - H: Zeroable, - > Zeroable for (A, B, C, D, E, F, G, H) -{ -} - -impl_unsafe_marker_for_array!( - Zeroable, 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, 32, 48, 64, 96, 128, 256, - 512, 1024, 2048, 4096 -); - -#[cfg(target_arch = "x86")] -unsafe impl Zeroable for x86::__m128i {} -#[cfg(target_arch = "x86")] -unsafe impl Zeroable for x86::__m128 {} -#[cfg(target_arch = "x86")] -unsafe impl Zeroable for x86::__m128d {} -#[cfg(target_arch = "x86")] -unsafe impl Zeroable for x86::__m256i {} -#[cfg(target_arch = "x86")] -unsafe impl Zeroable for x86::__m256 {} -#[cfg(target_arch = "x86")] -unsafe impl Zeroable for x86::__m256d {} - -#[cfg(target_arch = "x86_64")] -unsafe impl Zeroable for x86_64::__m128i {} -#[cfg(target_arch = "x86_64")] -unsafe impl Zeroable for x86_64::__m128 {} -#[cfg(target_arch = "x86_64")] -unsafe impl Zeroable for x86_64::__m128d {} -#[cfg(target_arch = "x86_64")] -unsafe impl Zeroable for x86_64::__m256i {} -#[cfg(target_arch = "x86_64")] -unsafe impl Zeroable for x86_64::__m256 {} -#[cfg(target_arch = "x86_64")] -unsafe impl Zeroable for x86_64::__m256d {} +use super::*; + +/// Trait for types that can be safely created with +/// [`zeroed`](core::mem::zeroed). +/// +/// An all-zeroes value may or may not be the same value as the +/// [Default](core::default::Default) value of the type. +/// +/// ## Safety +/// +/// * Your type must be inhabited (eg: no +/// [Infallible](core::convert::Infallible)). +/// * Your type must be allowed to be an "all zeroes" bit pattern (eg: no +/// [`NonNull`](core::ptr::NonNull)). +pub unsafe trait Zeroable: Sized { + /// Calls [`zeroed`](core::mem::zeroed). + /// + /// This is a trait method so that you can write `MyType::zeroed()` in your + /// code. It is a contract of this trait that if you implement it on your type + /// you **must not** override this method. + #[inline] + fn zeroed() -> Self { + unsafe { core::mem::zeroed() } + } +} +unsafe impl Zeroable for () {} +unsafe impl Zeroable for bool {} +unsafe impl Zeroable for char {} +unsafe impl Zeroable for u8 {} +unsafe impl Zeroable for i8 {} +unsafe impl Zeroable for u16 {} +unsafe impl Zeroable for i16 {} +unsafe impl Zeroable for u32 {} +unsafe impl Zeroable for i32 {} +unsafe impl Zeroable for u64 {} +unsafe impl Zeroable for i64 {} +unsafe impl Zeroable for usize {} +unsafe impl Zeroable for isize {} +unsafe impl Zeroable for u128 {} +unsafe impl Zeroable for i128 {} +unsafe impl Zeroable for f32 {} +unsafe impl Zeroable for f64 {} +unsafe impl Zeroable for Wrapping {} + +unsafe impl Zeroable for Option {} +unsafe impl Zeroable for Option {} +unsafe impl Zeroable for Option {} +unsafe impl Zeroable for Option {} +unsafe impl Zeroable for Option {} +unsafe impl Zeroable for Option {} +unsafe impl Zeroable for Option {} +unsafe impl Zeroable for Option {} +unsafe impl Zeroable for Option {} +unsafe impl Zeroable for Option {} +unsafe impl Zeroable for Option {} +unsafe impl Zeroable for Option {} + +unsafe impl Zeroable for *mut T {} +unsafe impl Zeroable for *const T {} +unsafe impl Zeroable for Option> {} +unsafe impl Zeroable for PhantomData {} +unsafe impl Zeroable for ManuallyDrop {} + +#[cfg(feature = "zeroable_maybe_uninit")] +unsafe impl Zeroable for core::mem::MaybeUninit {} + +unsafe impl Zeroable for (A,) {} +unsafe impl Zeroable for (A, B) {} +unsafe impl Zeroable for (A, B, C) {} +unsafe impl Zeroable + for (A, B, C, D) +{ +} +unsafe impl + Zeroable for (A, B, C, D, E) +{ +} +unsafe impl< + A: Zeroable, + B: Zeroable, + C: Zeroable, + D: Zeroable, + E: Zeroable, + F: Zeroable, + > Zeroable for (A, B, C, D, E, F) +{ +} +unsafe impl< + A: Zeroable, + B: Zeroable, + C: Zeroable, + D: Zeroable, + E: Zeroable, + F: Zeroable, + G: Zeroable, + > Zeroable for (A, B, C, D, E, F, G) +{ +} +unsafe impl< + A: Zeroable, + B: Zeroable, + C: Zeroable, + D: Zeroable, + E: Zeroable, + F: Zeroable, + G: Zeroable, + H: Zeroable, + > Zeroable for (A, B, C, D, E, F, G, H) +{ +} + +impl_unsafe_marker_for_array!( + Zeroable, 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, 32, 48, 64, 96, 128, 256, + 512, 1024, 2048, 4096 +); + +#[cfg(target_arch = "x86")] +unsafe impl Zeroable for x86::__m128i {} +#[cfg(target_arch = "x86")] +unsafe impl Zeroable for x86::__m128 {} +#[cfg(target_arch = "x86")] +unsafe impl Zeroable for x86::__m128d {} +#[cfg(target_arch = "x86")] +unsafe impl Zeroable for x86::__m256i {} +#[cfg(target_arch = "x86")] +unsafe impl Zeroable for x86::__m256 {} +#[cfg(target_arch = "x86")] +unsafe impl Zeroable for x86::__m256d {} + +#[cfg(target_arch = "x86_64")] +unsafe impl Zeroable for x86_64::__m128i {} +#[cfg(target_arch = "x86_64")] +unsafe impl Zeroable for x86_64::__m128 {} +#[cfg(target_arch = "x86_64")] +unsafe impl Zeroable for x86_64::__m128d {} +#[cfg(target_arch = "x86_64")] +unsafe impl Zeroable for x86_64::__m256i {} +#[cfg(target_arch = "x86_64")] +unsafe impl Zeroable for x86_64::__m256 {} +#[cfg(target_arch = "x86_64")] +unsafe impl Zeroable for x86_64::__m256d {} diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/tests/cast_slice_tests.rs b/third_party/cargo/vendor/bytemuck-1.5.1/tests/cast_slice_tests.rs similarity index 97% rename from third_party/cargo/vendor/bytemuck-1.4.1/tests/cast_slice_tests.rs rename to third_party/cargo/vendor/bytemuck-1.5.1/tests/cast_slice_tests.rs index 9eb08c5..6ccab1e 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/tests/cast_slice_tests.rs +++ b/third_party/cargo/vendor/bytemuck-1.5.1/tests/cast_slice_tests.rs @@ -1,165 +1,165 @@ -use core::mem::size_of; - -use bytemuck::*; - -#[test] -fn test_try_cast_slice() { - // some align4 data - let u32_slice: &[u32] = &[4, 5, 6]; - // the same data as align1 - let the_bytes: &[u8] = try_cast_slice(u32_slice).unwrap(); - - assert_eq!( - u32_slice.as_ptr() as *const u32 as usize, - the_bytes.as_ptr() as *const u8 as usize - ); - assert_eq!( - u32_slice.len() * size_of::(), - the_bytes.len() * size_of::() - ); - - // by taking one byte off the front, we're definitely mis-aligned for u32. - let mis_aligned_bytes = &the_bytes[1..]; - assert_eq!( - try_cast_slice::(mis_aligned_bytes), - Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) - ); - - // by taking one byte off the end, we're aligned but would have slop bytes for u32 - let the_bytes_len_minus1 = the_bytes.len() - 1; - let slop_bytes = &the_bytes[..the_bytes_len_minus1]; - assert_eq!( - try_cast_slice::(slop_bytes), - Err(PodCastError::OutputSliceWouldHaveSlop) - ); - - // if we don't mess with it we can up-alignment cast - try_cast_slice::(the_bytes).unwrap(); -} - -#[test] -fn test_try_cast_slice_mut() { - // some align4 data - let u32_slice: &mut [u32] = &mut [4, 5, 6]; - let u32_len = u32_slice.len(); - let u32_ptr = u32_slice.as_ptr(); - - // the same data as align1 - let the_bytes: &mut [u8] = try_cast_slice_mut(u32_slice).unwrap(); - let the_bytes_len = the_bytes.len(); - let the_bytes_ptr = the_bytes.as_ptr(); - - assert_eq!( - u32_ptr as *const u32 as usize, - the_bytes_ptr as *const u8 as usize - ); - assert_eq!(u32_len * size_of::(), the_bytes_len * size_of::()); - - // by taking one byte off the front, we're definitely mis-aligned for u32. - let mis_aligned_bytes = &mut the_bytes[1..]; - assert_eq!( - try_cast_slice_mut::(mis_aligned_bytes), - Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) - ); - - // by taking one byte off the end, we're aligned but would have slop bytes for u32 - let the_bytes_len_minus1 = the_bytes.len() - 1; - let slop_bytes = &mut the_bytes[..the_bytes_len_minus1]; - assert_eq!( - try_cast_slice_mut::(slop_bytes), - Err(PodCastError::OutputSliceWouldHaveSlop) - ); - - // if we don't mess with it we can up-alignment cast - try_cast_slice_mut::(the_bytes).unwrap(); -} - -#[test] -fn test_types() { - let _: i32 = cast(1.0_f32); - let _: &mut i32 = cast_mut(&mut 1.0_f32); - let _: &i32 = cast_ref(&1.0_f32); - let _: &[i32] = cast_slice(&[1.0_f32]); - let _: &mut [i32] = cast_slice_mut(&mut [1.0_f32]); - // - let _: Result = try_cast(1.0_f32); - let _: Result<&mut i32, PodCastError> = try_cast_mut(&mut 1.0_f32); - let _: Result<&i32, PodCastError> = try_cast_ref(&1.0_f32); - let _: Result<&[i32], PodCastError> = try_cast_slice(&[1.0_f32]); - let _: Result<&mut [i32], PodCastError> = try_cast_slice_mut(&mut [1.0_f32]); -} - -#[test] -fn test_bytes_of() { - assert_eq!(bytes_of(&0xaabbccdd_u32), &0xaabbccdd_u32.to_ne_bytes()); - assert_eq!(bytes_of_mut(&mut 0xaabbccdd_u32), &mut 0xaabbccdd_u32.to_ne_bytes()); - let mut a = 0xaabbccdd_u32; - let a_addr = &a as *const _ as usize; - // ensure addresses match. - assert_eq!(bytes_of(&a).as_ptr() as usize, a_addr); - assert_eq!(bytes_of_mut(&mut a).as_ptr() as usize, a_addr); -} - -#[test] -fn test_try_from_bytes() { - let u32s = [0xaabbccdd, 0x11223344_u32]; - let bytes = bytemuck::cast_slice::(&u32s); - assert_eq!(try_from_bytes::(&bytes[..4]), Ok(&u32s[0])); - assert_eq!(try_from_bytes::(&bytes[..5]), Err(PodCastError::SizeMismatch)); - assert_eq!(try_from_bytes::(&bytes[..3]), Err(PodCastError::SizeMismatch)); - assert_eq!(try_from_bytes::(&bytes[1..5]), Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned)); -} - -#[test] -fn test_try_from_bytes_mut() { - let mut abcd = 0xaabbccdd; - let mut u32s = [abcd, 0x11223344_u32]; - let bytes = bytemuck::cast_slice_mut::(&mut u32s); - assert_eq!(try_from_bytes_mut::(&mut bytes[..4]), Ok(&mut abcd)); - assert_eq!(try_from_bytes_mut::(&mut bytes[..4]), Ok(&mut abcd)); - assert_eq!(try_from_bytes_mut::(&mut bytes[..5]), Err(PodCastError::SizeMismatch)); - assert_eq!(try_from_bytes_mut::(&mut bytes[..3]), Err(PodCastError::SizeMismatch)); - assert_eq!(try_from_bytes::(&mut bytes[1..5]), Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned)); -} - -#[test] -fn test_from_bytes() { - let abcd = 0xaabbccdd_u32; - let aligned_bytes = bytemuck::bytes_of(&abcd); - assert_eq!(from_bytes::(aligned_bytes), &abcd); - assert!(core::ptr::eq(from_bytes(aligned_bytes), &abcd)); -} - -#[test] -fn test_from_bytes_mut() { - let mut a = 0xaabbccdd_u32; - let a_addr = &a as *const _ as usize; - let aligned_bytes = bytemuck::bytes_of_mut(&mut a); - assert_eq!(*from_bytes_mut::(aligned_bytes), 0xaabbccdd_u32); - assert_eq!(from_bytes_mut::(aligned_bytes) as *const u32 as usize, a_addr); -} - -// like #[should_panic], but can be a part of another test, instead of requiring -// it to be it's own test. -macro_rules! should_panic { - ($ex:expr) => { - assert!( - std::panic::catch_unwind(|| { let _ = $ex; }).is_err(), - concat!("should have panicked: `", stringify!($ex), "`") - ); - }; -} - -#[test] -fn test_panics() { - should_panic!(cast_slice::(&[1u8, 2u8])); - should_panic!(cast_slice_mut::(&mut [1u8, 2u8])); - should_panic!(from_bytes::(&[1u8, 2])); - should_panic!(from_bytes::(&[1u8, 2, 3, 4, 5])); - should_panic!(from_bytes_mut::(&mut [1u8, 2])); - should_panic!(from_bytes_mut::(&mut [1u8, 2, 3, 4, 5])); - // use cast_slice on some u32s to get some align>=4 bytes, so we can know - // we'll give from_bytes unaligned ones. - let aligned_bytes = bytemuck::cast_slice::(&[0, 0]); - should_panic!(from_bytes::(&aligned_bytes[1..5])); -} +use core::mem::size_of; + +use bytemuck::*; + +#[test] +fn test_try_cast_slice() { + // some align4 data + let u32_slice: &[u32] = &[4, 5, 6]; + // the same data as align1 + let the_bytes: &[u8] = try_cast_slice(u32_slice).unwrap(); + + assert_eq!( + u32_slice.as_ptr() as *const u32 as usize, + the_bytes.as_ptr() as *const u8 as usize + ); + assert_eq!( + u32_slice.len() * size_of::(), + the_bytes.len() * size_of::() + ); + + // by taking one byte off the front, we're definitely mis-aligned for u32. + let mis_aligned_bytes = &the_bytes[1..]; + assert_eq!( + try_cast_slice::(mis_aligned_bytes), + Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) + ); + + // by taking one byte off the end, we're aligned but would have slop bytes for u32 + let the_bytes_len_minus1 = the_bytes.len() - 1; + let slop_bytes = &the_bytes[..the_bytes_len_minus1]; + assert_eq!( + try_cast_slice::(slop_bytes), + Err(PodCastError::OutputSliceWouldHaveSlop) + ); + + // if we don't mess with it we can up-alignment cast + try_cast_slice::(the_bytes).unwrap(); +} + +#[test] +fn test_try_cast_slice_mut() { + // some align4 data + let u32_slice: &mut [u32] = &mut [4, 5, 6]; + let u32_len = u32_slice.len(); + let u32_ptr = u32_slice.as_ptr(); + + // the same data as align1 + let the_bytes: &mut [u8] = try_cast_slice_mut(u32_slice).unwrap(); + let the_bytes_len = the_bytes.len(); + let the_bytes_ptr = the_bytes.as_ptr(); + + assert_eq!( + u32_ptr as *const u32 as usize, + the_bytes_ptr as *const u8 as usize + ); + assert_eq!(u32_len * size_of::(), the_bytes_len * size_of::()); + + // by taking one byte off the front, we're definitely mis-aligned for u32. + let mis_aligned_bytes = &mut the_bytes[1..]; + assert_eq!( + try_cast_slice_mut::(mis_aligned_bytes), + Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) + ); + + // by taking one byte off the end, we're aligned but would have slop bytes for u32 + let the_bytes_len_minus1 = the_bytes.len() - 1; + let slop_bytes = &mut the_bytes[..the_bytes_len_minus1]; + assert_eq!( + try_cast_slice_mut::(slop_bytes), + Err(PodCastError::OutputSliceWouldHaveSlop) + ); + + // if we don't mess with it we can up-alignment cast + try_cast_slice_mut::(the_bytes).unwrap(); +} + +#[test] +fn test_types() { + let _: i32 = cast(1.0_f32); + let _: &mut i32 = cast_mut(&mut 1.0_f32); + let _: &i32 = cast_ref(&1.0_f32); + let _: &[i32] = cast_slice(&[1.0_f32]); + let _: &mut [i32] = cast_slice_mut(&mut [1.0_f32]); + // + let _: Result = try_cast(1.0_f32); + let _: Result<&mut i32, PodCastError> = try_cast_mut(&mut 1.0_f32); + let _: Result<&i32, PodCastError> = try_cast_ref(&1.0_f32); + let _: Result<&[i32], PodCastError> = try_cast_slice(&[1.0_f32]); + let _: Result<&mut [i32], PodCastError> = try_cast_slice_mut(&mut [1.0_f32]); +} + +#[test] +fn test_bytes_of() { + assert_eq!(bytes_of(&0xaabbccdd_u32), &0xaabbccdd_u32.to_ne_bytes()); + assert_eq!(bytes_of_mut(&mut 0xaabbccdd_u32), &mut 0xaabbccdd_u32.to_ne_bytes()); + let mut a = 0xaabbccdd_u32; + let a_addr = &a as *const _ as usize; + // ensure addresses match. + assert_eq!(bytes_of(&a).as_ptr() as usize, a_addr); + assert_eq!(bytes_of_mut(&mut a).as_ptr() as usize, a_addr); +} + +#[test] +fn test_try_from_bytes() { + let u32s = [0xaabbccdd, 0x11223344_u32]; + let bytes = bytemuck::cast_slice::(&u32s); + assert_eq!(try_from_bytes::(&bytes[..4]), Ok(&u32s[0])); + assert_eq!(try_from_bytes::(&bytes[..5]), Err(PodCastError::SizeMismatch)); + assert_eq!(try_from_bytes::(&bytes[..3]), Err(PodCastError::SizeMismatch)); + assert_eq!(try_from_bytes::(&bytes[1..5]), Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned)); +} + +#[test] +fn test_try_from_bytes_mut() { + let mut abcd = 0xaabbccdd; + let mut u32s = [abcd, 0x11223344_u32]; + let bytes = bytemuck::cast_slice_mut::(&mut u32s); + assert_eq!(try_from_bytes_mut::(&mut bytes[..4]), Ok(&mut abcd)); + assert_eq!(try_from_bytes_mut::(&mut bytes[..4]), Ok(&mut abcd)); + assert_eq!(try_from_bytes_mut::(&mut bytes[..5]), Err(PodCastError::SizeMismatch)); + assert_eq!(try_from_bytes_mut::(&mut bytes[..3]), Err(PodCastError::SizeMismatch)); + assert_eq!(try_from_bytes::(&mut bytes[1..5]), Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned)); +} + +#[test] +fn test_from_bytes() { + let abcd = 0xaabbccdd_u32; + let aligned_bytes = bytemuck::bytes_of(&abcd); + assert_eq!(from_bytes::(aligned_bytes), &abcd); + assert!(core::ptr::eq(from_bytes(aligned_bytes), &abcd)); +} + +#[test] +fn test_from_bytes_mut() { + let mut a = 0xaabbccdd_u32; + let a_addr = &a as *const _ as usize; + let aligned_bytes = bytemuck::bytes_of_mut(&mut a); + assert_eq!(*from_bytes_mut::(aligned_bytes), 0xaabbccdd_u32); + assert_eq!(from_bytes_mut::(aligned_bytes) as *const u32 as usize, a_addr); +} + +// like #[should_panic], but can be a part of another test, instead of requiring +// it to be it's own test. +macro_rules! should_panic { + ($ex:expr) => { + assert!( + std::panic::catch_unwind(|| { let _ = $ex; }).is_err(), + concat!("should have panicked: `", stringify!($ex), "`") + ); + }; +} + +#[test] +fn test_panics() { + should_panic!(cast_slice::(&[1u8, 2u8])); + should_panic!(cast_slice_mut::(&mut [1u8, 2u8])); + should_panic!(from_bytes::(&[1u8, 2])); + should_panic!(from_bytes::(&[1u8, 2, 3, 4, 5])); + should_panic!(from_bytes_mut::(&mut [1u8, 2])); + should_panic!(from_bytes_mut::(&mut [1u8, 2, 3, 4, 5])); + // use cast_slice on some u32s to get some align>=4 bytes, so we can know + // we'll give from_bytes unaligned ones. + let aligned_bytes = bytemuck::cast_slice::(&[0, 0]); + should_panic!(from_bytes::(&aligned_bytes[1..5])); +} diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/tests/derive.rs b/third_party/cargo/vendor/bytemuck-1.5.1/tests/derive.rs similarity index 94% rename from third_party/cargo/vendor/bytemuck-1.4.1/tests/derive.rs rename to third_party/cargo/vendor/bytemuck-1.5.1/tests/derive.rs index 1e1deeb..ac28c27 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/tests/derive.rs +++ b/third_party/cargo/vendor/bytemuck-1.5.1/tests/derive.rs @@ -1,25 +1,25 @@ -#![cfg(feature = "derive")] -#![allow(dead_code)] - -use bytemuck::{Zeroable, Pod, TransparentWrapper}; - -#[derive(Copy, Clone, Pod, Zeroable)] -#[repr(C)] -struct Test { - a: u16, - b: u16, -} - -#[derive(TransparentWrapper)] -#[repr(transparent)] -struct TransparentSingle { - a: u16, -} - -#[derive(TransparentWrapper)] -#[repr(transparent)] -#[transparent(u16)] -struct TransparentWithZeroSized { - a: u16, - b: () +#![cfg(feature = "derive")] +#![allow(dead_code)] + +use bytemuck::{Zeroable, Pod, TransparentWrapper}; + +#[derive(Copy, Clone, Pod, Zeroable)] +#[repr(C)] +struct Test { + a: u16, + b: u16, +} + +#[derive(TransparentWrapper)] +#[repr(transparent)] +struct TransparentSingle { + a: u16, +} + +#[derive(TransparentWrapper)] +#[repr(transparent)] +#[transparent(u16)] +struct TransparentWithZeroSized { + a: u16, + b: () } \ No newline at end of file diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/tests/doc_tests.rs b/third_party/cargo/vendor/bytemuck-1.5.1/tests/doc_tests.rs similarity index 96% rename from third_party/cargo/vendor/bytemuck-1.4.1/tests/doc_tests.rs rename to third_party/cargo/vendor/bytemuck-1.5.1/tests/doc_tests.rs index e5a80db..091226c 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/tests/doc_tests.rs +++ b/third_party/cargo/vendor/bytemuck-1.5.1/tests/doc_tests.rs @@ -1,121 +1,121 @@ -//! Cargo miri doesn't run doctests yet, so we duplicate these here. It's -//! probably not that important to sweat keeping these perfectly up to date, but -//! we should try to catch the cases where the primary tests are doctests. -use bytemuck::*; - -// Miri doesn't run on doctests, so... copypaste to the rescue. -#[test] -fn test_transparent_slice() { - #[repr(transparent)] - struct Slice([T]); - - unsafe impl TransparentWrapper<[T]> for Slice {} - - let s = Slice::wrap_ref(&[1u32, 2, 3]); - assert_eq!(&s.0, &[1, 2, 3]); - - let mut buf = [1, 2, 3u8]; - let _sm = Slice::wrap_mut(&mut buf); -} - -#[test] -fn test_transparent_basic() { - #[derive(Default)] - struct SomeStruct(u32); - - #[repr(transparent)] - struct MyWrapper(SomeStruct); - - unsafe impl TransparentWrapper for MyWrapper {} - - // interpret a reference to &SomeStruct as a &MyWrapper - let thing = SomeStruct::default(); - let wrapped_ref: &MyWrapper = MyWrapper::wrap_ref(&thing); - - // Works with &mut too. - let mut mut_thing = SomeStruct::default(); - let wrapped_mut: &mut MyWrapper = MyWrapper::wrap_mut(&mut mut_thing); - let _ = (wrapped_ref, wrapped_mut); -} - -// Work around miri not running doctests -#[test] -fn test_contiguous_doc() { - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq)] - enum Foo { - A = 0, - B = 1, - C = 2, - D = 3, - E = 4, - } - unsafe impl Contiguous for Foo { - type Int = u8; - const MIN_VALUE: u8 = Foo::A as u8; - const MAX_VALUE: u8 = Foo::E as u8; - } - - assert_eq!(Foo::from_integer(3).unwrap(), Foo::D); - assert_eq!(Foo::from_integer(8), None); - assert_eq!(Foo::C.into_integer(), 2); - assert_eq!(Foo::B.into_integer(), Foo::B as u8); -} - -#[test] -fn test_offsetof_vertex() { - #[repr(C)] - struct Vertex { - pos: [f32; 2], - uv: [u16; 2], - color: [u8; 4], - } - unsafe impl Zeroable for Vertex {} - - let pos = offset_of!(Zeroable::zeroed(), Vertex, pos); - let uv = offset_of!(Zeroable::zeroed(), Vertex, uv); - let color = offset_of!(Zeroable::zeroed(), Vertex, color); - - assert_eq!(pos, 0); - assert_eq!(uv, 8); - assert_eq!(color, 12); -} - -#[test] -fn test_offsetof_nonpod() { - #[derive(Default)] - struct Foo { - a: u8, - b: &'static str, - c: i32, - } - - let a_offset = offset_of!(Default::default(), Foo, a); - let b_offset = offset_of!(Default::default(), Foo, b); - let c_offset = offset_of!(Default::default(), Foo, c); - - assert_ne!(a_offset, b_offset); - assert_ne!(b_offset, c_offset); - // We can't check against hardcoded values for a repr(Rust) type, - // but prove to ourself this way. - - let foo = Foo::default(); - // Note: offsets are in bytes. - let as_bytes = &foo as *const _ as *const u8; - - // we're using wrapping_offset here becasue it's not worth - // the unsafe block, but it would be valid to use `add` instead, - // as it cannot overflow. - assert_eq!( - &foo.a as *const _ as usize, - as_bytes.wrapping_add(a_offset) as usize - ); - assert_eq!( - &foo.b as *const _ as usize, - as_bytes.wrapping_add(b_offset) as usize - ); - assert_eq!( - &foo.c as *const _ as usize, - as_bytes.wrapping_add(c_offset) as usize - ); -} +//! Cargo miri doesn't run doctests yet, so we duplicate these here. It's +//! probably not that important to sweat keeping these perfectly up to date, but +//! we should try to catch the cases where the primary tests are doctests. +use bytemuck::*; + +// Miri doesn't run on doctests, so... copypaste to the rescue. +#[test] +fn test_transparent_slice() { + #[repr(transparent)] + struct Slice([T]); + + unsafe impl TransparentWrapper<[T]> for Slice {} + + let s = Slice::wrap_ref(&[1u32, 2, 3]); + assert_eq!(&s.0, &[1, 2, 3]); + + let mut buf = [1, 2, 3u8]; + let _sm = Slice::wrap_mut(&mut buf); +} + +#[test] +fn test_transparent_basic() { + #[derive(Default)] + struct SomeStruct(u32); + + #[repr(transparent)] + struct MyWrapper(SomeStruct); + + unsafe impl TransparentWrapper for MyWrapper {} + + // interpret a reference to &SomeStruct as a &MyWrapper + let thing = SomeStruct::default(); + let wrapped_ref: &MyWrapper = MyWrapper::wrap_ref(&thing); + + // Works with &mut too. + let mut mut_thing = SomeStruct::default(); + let wrapped_mut: &mut MyWrapper = MyWrapper::wrap_mut(&mut mut_thing); + let _ = (wrapped_ref, wrapped_mut); +} + +// Work around miri not running doctests +#[test] +fn test_contiguous_doc() { + #[repr(u8)] + #[derive(Debug, Copy, Clone, PartialEq)] + enum Foo { + A = 0, + B = 1, + C = 2, + D = 3, + E = 4, + } + unsafe impl Contiguous for Foo { + type Int = u8; + const MIN_VALUE: u8 = Foo::A as u8; + const MAX_VALUE: u8 = Foo::E as u8; + } + + assert_eq!(Foo::from_integer(3).unwrap(), Foo::D); + assert_eq!(Foo::from_integer(8), None); + assert_eq!(Foo::C.into_integer(), 2); + assert_eq!(Foo::B.into_integer(), Foo::B as u8); +} + +#[test] +fn test_offsetof_vertex() { + #[repr(C)] + struct Vertex { + pos: [f32; 2], + uv: [u16; 2], + color: [u8; 4], + } + unsafe impl Zeroable for Vertex {} + + let pos = offset_of!(Zeroable::zeroed(), Vertex, pos); + let uv = offset_of!(Zeroable::zeroed(), Vertex, uv); + let color = offset_of!(Zeroable::zeroed(), Vertex, color); + + assert_eq!(pos, 0); + assert_eq!(uv, 8); + assert_eq!(color, 12); +} + +#[test] +fn test_offsetof_nonpod() { + #[derive(Default)] + struct Foo { + a: u8, + b: &'static str, + c: i32, + } + + let a_offset = offset_of!(Default::default(), Foo, a); + let b_offset = offset_of!(Default::default(), Foo, b); + let c_offset = offset_of!(Default::default(), Foo, c); + + assert_ne!(a_offset, b_offset); + assert_ne!(b_offset, c_offset); + // We can't check against hardcoded values for a repr(Rust) type, + // but prove to ourself this way. + + let foo = Foo::default(); + // Note: offsets are in bytes. + let as_bytes = &foo as *const _ as *const u8; + + // we're using wrapping_offset here becasue it's not worth + // the unsafe block, but it would be valid to use `add` instead, + // as it cannot overflow. + assert_eq!( + &foo.a as *const _ as usize, + as_bytes.wrapping_add(a_offset) as usize + ); + assert_eq!( + &foo.b as *const _ as usize, + as_bytes.wrapping_add(b_offset) as usize + ); + assert_eq!( + &foo.c as *const _ as usize, + as_bytes.wrapping_add(c_offset) as usize + ); +} diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/tests/offset_of_tests.rs b/third_party/cargo/vendor/bytemuck-1.5.1/tests/offset_of_tests.rs similarity index 96% rename from third_party/cargo/vendor/bytemuck-1.4.1/tests/offset_of_tests.rs rename to third_party/cargo/vendor/bytemuck-1.5.1/tests/offset_of_tests.rs index b957514..d484845 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/tests/offset_of_tests.rs +++ b/third_party/cargo/vendor/bytemuck-1.5.1/tests/offset_of_tests.rs @@ -1,59 +1,59 @@ -use bytemuck::{offset_of, Zeroable}; - -#[test] -fn test_offset_of_vertex() { - #[repr(C)] - struct Vertex { - pos: [f32; 2], - uv: [u16; 2], - color: [u8; 4], - } - unsafe impl Zeroable for Vertex {} - - let pos = offset_of!(Zeroable::zeroed(), Vertex, pos); - let uv = offset_of!(Zeroable::zeroed(), Vertex, uv); - let color = offset_of!(Zeroable::zeroed(), Vertex, color); - - assert_eq!(pos, 0); - assert_eq!(uv, 8); - assert_eq!(color, 12); -} - -#[test] -fn test_offset_of_foo() { - #[derive(Default)] - struct Foo { - a: u8, - b: &'static str, - c: i32, - } - - let a_offset = offset_of!(Default::default(), Foo, a); - let b_offset = offset_of!(Default::default(), Foo, b); - let c_offset = offset_of!(Default::default(), Foo, c); - - assert_ne!(a_offset, b_offset); - assert_ne!(b_offset, c_offset); - // We can't check against hardcoded values for a repr(Rust) type, - // but prove to ourself this way. - - let foo = Foo::default(); - // Note: offsets are in bytes. - let as_bytes = &foo as *const _ as *const u8; - - // we're using wrapping_offset here because it's not worth - // the unsafe block, but it would be valid to use `add` instead, - // as it cannot overflow. - assert_eq!( - &foo.a as *const _ as usize, - as_bytes.wrapping_add(a_offset) as usize - ); - assert_eq!( - &foo.b as *const _ as usize, - as_bytes.wrapping_add(b_offset) as usize - ); - assert_eq!( - &foo.c as *const _ as usize, - as_bytes.wrapping_add(c_offset) as usize - ); -} +use bytemuck::{offset_of, Zeroable}; + +#[test] +fn test_offset_of_vertex() { + #[repr(C)] + struct Vertex { + pos: [f32; 2], + uv: [u16; 2], + color: [u8; 4], + } + unsafe impl Zeroable for Vertex {} + + let pos = offset_of!(Zeroable::zeroed(), Vertex, pos); + let uv = offset_of!(Zeroable::zeroed(), Vertex, uv); + let color = offset_of!(Zeroable::zeroed(), Vertex, color); + + assert_eq!(pos, 0); + assert_eq!(uv, 8); + assert_eq!(color, 12); +} + +#[test] +fn test_offset_of_foo() { + #[derive(Default)] + struct Foo { + a: u8, + b: &'static str, + c: i32, + } + + let a_offset = offset_of!(Default::default(), Foo, a); + let b_offset = offset_of!(Default::default(), Foo, b); + let c_offset = offset_of!(Default::default(), Foo, c); + + assert_ne!(a_offset, b_offset); + assert_ne!(b_offset, c_offset); + // We can't check against hardcoded values for a repr(Rust) type, + // but prove to ourself this way. + + let foo = Foo::default(); + // Note: offsets are in bytes. + let as_bytes = &foo as *const _ as *const u8; + + // we're using wrapping_offset here because it's not worth + // the unsafe block, but it would be valid to use `add` instead, + // as it cannot overflow. + assert_eq!( + &foo.a as *const _ as usize, + as_bytes.wrapping_add(a_offset) as usize + ); + assert_eq!( + &foo.b as *const _ as usize, + as_bytes.wrapping_add(b_offset) as usize + ); + assert_eq!( + &foo.c as *const _ as usize, + as_bytes.wrapping_add(c_offset) as usize + ); +} diff --git a/third_party/cargo/vendor/bytemuck-1.4.1/tests/std_tests.rs b/third_party/cargo/vendor/bytemuck-1.5.1/tests/std_tests.rs similarity index 62% rename from third_party/cargo/vendor/bytemuck-1.4.1/tests/std_tests.rs rename to third_party/cargo/vendor/bytemuck-1.5.1/tests/std_tests.rs index 0e0fb48..a91ee36 100644 --- a/third_party/cargo/vendor/bytemuck-1.4.1/tests/std_tests.rs +++ b/third_party/cargo/vendor/bytemuck-1.5.1/tests/std_tests.rs @@ -1,29 +1,45 @@ -//! The integration tests seem to always have `std` linked, so things that would -//! depend on that can go here. - -use bytemuck::*; - -#[test] -fn test_transparent_vtabled() { - use core::fmt::Display; - - #[repr(transparent)] - struct DisplayTraitObj(dyn Display); - - unsafe impl TransparentWrapper for DisplayTraitObj {} - - impl Display for DisplayTraitObj { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - self.0.fmt(f) - } - } - - let v = DisplayTraitObj::wrap_ref(&5i32); - let s = format!("{}", v); - assert_eq!(s, "5"); - - let mut x = 100i32; - let v_mut = DisplayTraitObj::wrap_mut(&mut x); - let s = format!("{}", v_mut); - assert_eq!(s, "100"); -} +//! The integration tests seem to always have `std` linked, so things that would +//! depend on that can go here. + +use bytemuck::*; + +#[test] +fn test_transparent_vtabled() { + use core::fmt::Display; + + #[repr(transparent)] + struct DisplayTraitObj(dyn Display); + + unsafe impl TransparentWrapper for DisplayTraitObj {} + + impl Display for DisplayTraitObj { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + self.0.fmt(f) + } + } + + let v = DisplayTraitObj::wrap_ref(&5i32); + let s = format!("{}", v); + assert_eq!(s, "5"); + + let mut x = 100i32; + let v_mut = DisplayTraitObj::wrap_mut(&mut x); + let s = format!("{}", v_mut); + assert_eq!(s, "100"); +} + +#[test] +#[cfg(feature = "extern_crate_alloc")] +fn test_large_box_alloc() { + type SuperPage = [[u8; 4096]; 4096]; + let _: Box = try_zeroed_box().unwrap(); +} + +#[test] +#[cfg(feature = "extern_crate_alloc")] +fn test_zero_sized_box_alloc() { + #[repr(align(4096))] + struct Empty; + unsafe impl Zeroable for Empty {} + let _: Box = try_zeroed_box().unwrap(); +} diff --git a/third_party/cargo/vendor/byteorder-1.3.4/.cargo-checksum.json b/third_party/cargo/vendor/byteorder-1.3.4/.cargo-checksum.json deleted file mode 100644 index 80ba51c..0000000 --- a/third_party/cargo/vendor/byteorder-1.3.4/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"CHANGELOG.md":"51f0eb3b6139fc1a908d41a7b3cba7d58d684700986b3518f82e5af254c39e8e","COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.toml":"fb8b84be3b93b1aa065558cf9f8a867e1fc0f9bda8323d686ece79bbcfe50868","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"b2dd89866b56f619661b90e8b3b7d3f741b0a8d5710e229df86843ae0881284f","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","benches/bench.rs":"80e43e07f34bc6d3ebe4f37cea79ba02cafce6cf30b737a1db65de55f2c38ca5","build.rs":"9671089eb30f52975911effd1fa0b30a0ab14473f44a315af0bafd6701dda6da","src/io.rs":"8f22d1b0e01fa4ce9c7c5cd727dbc40ca35c22d9c82fe8d324d9d83d37cdcc4a","src/lib.rs":"c43331d25d0d12e150b64137d6f180ae46a8c41124a374e4f62d2867482bd3d8"},"package":"08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"} \ No newline at end of file diff --git a/third_party/cargo/vendor/byteorder-1.3.4/build.rs b/third_party/cargo/vendor/byteorder-1.3.4/build.rs deleted file mode 100644 index 320e894..0000000 --- a/third_party/cargo/vendor/byteorder-1.3.4/build.rs +++ /dev/null @@ -1,90 +0,0 @@ -// For the 'try!' macro, until we bump MSRV past 1.12. -#![allow(deprecated)] - -use std::env; -use std::ffi::OsString; -use std::io::{self, Write}; -use std::process::Command; - -fn main() { - let version = match Version::read() { - Ok(version) => version, - Err(err) => { - writeln!( - &mut io::stderr(), - "failed to parse `rustc --version`: {}", - err - ).unwrap(); - return; - } - }; - enable_i128(version); -} - -fn enable_i128(version: Version) { - if version < (Version { major: 1, minor: 26, patch: 0 }) { - return; - } - - println!("cargo:rustc-cfg=byteorder_i128"); -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Ord)] -struct Version { - major: u32, - minor: u32, - patch: u32, -} - -impl Version { - fn read() -> Result { - let rustc = env::var_os("RUSTC").unwrap_or(OsString::from("rustc")); - let output = Command::new(&rustc) - .arg("--version") - .output() - .unwrap() - .stdout; - Version::parse(&String::from_utf8(output).unwrap()) - } - - fn parse(mut s: &str) -> Result { - if !s.starts_with("rustc ") { - return Err(format!("unrecognized version string: {}", s)); - } - s = &s["rustc ".len()..]; - - let parts: Vec<&str> = s.split(".").collect(); - if parts.len() < 3 { - return Err(format!("not enough version parts: {:?}", parts)); - } - - let mut num = String::new(); - for c in parts[0].chars() { - if !c.is_digit(10) { - break; - } - num.push(c); - } - let major = try!(num.parse::().map_err(|e| e.to_string())); - - num.clear(); - for c in parts[1].chars() { - if !c.is_digit(10) { - break; - } - num.push(c); - } - let minor = try!(num.parse::().map_err(|e| e.to_string())); - - num.clear(); - for c in parts[2].chars() { - if !c.is_digit(10) { - break; - } - num.push(c); - } - let patch = try!(num.parse::().map_err(|e| e.to_string())); - - Ok(Version { major: major, minor: minor, patch: patch }) - } -} diff --git a/third_party/cargo/vendor/byteorder-1.4.3/.cargo-checksum.json b/third_party/cargo/vendor/byteorder-1.4.3/.cargo-checksum.json new file mode 100644 index 0000000..434cc1a --- /dev/null +++ b/third_party/cargo/vendor/byteorder-1.4.3/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"3a745d94ee9dce0d9dc638c02078cd5001d3d9d12d58b4f220c0101e32cfc16a","COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.toml":"8585455e5a0e638cf5d489a21e286e93680f835cb8a13595918b5eb7c8c7f212","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"9d57556868344534de2489317e3c6bb611348ecd44438dcb982bd8d2a55a5a1b","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","benches/bench.rs":"a80bf3cd446c9b6c0cca3865c4de047bdf4644b74cdf696822f8ff87adfa1fca","rustfmt.toml":"1ca600239a27401c4a43f363cf3f38183a212affc1f31bff3ae93234bbaec228","src/io.rs":"9612530634d0e7ce9887a23836b58c0d972c1f45b05d9ada8355961567075627","src/lib.rs":"813ce6a8beafee3fd4e63325d783108aa02e8c57e412bc97580191d84082fbc9"},"package":"14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"} \ No newline at end of file diff --git a/third_party/cargo/vendor/byteorder-1.3.4/BUILD.bazel b/third_party/cargo/vendor/byteorder-1.4.3/BUILD.bazel similarity index 90% rename from third_party/cargo/vendor/byteorder-1.3.4/BUILD.bazel rename to third_party/cargo/vendor/byteorder-1.4.3/BUILD.bazel index 49ddc9f..5be6eee 100644 --- a/third_party/cargo/vendor/byteorder-1.3.4/BUILD.bazel +++ b/third_party/cargo/vendor/byteorder-1.4.3/BUILD.bazel @@ -32,8 +32,6 @@ licenses([ # Unsupported target "bench" with type "bench" omitted -# Unsupported target "build-script-build" with type "custom-build" omitted - rust_library( name = "byteorder", srcs = glob(["**/*.rs"]), @@ -44,7 +42,7 @@ rust_library( crate_root = "src/lib.rs", crate_type = "lib", data = [], - edition = "2015", + edition = "2018", rustc_flags = [ "--cap-lints=allow", ], @@ -52,7 +50,7 @@ rust_library( "cargo-raze", "manual", ], - version = "1.3.4", + version = "1.4.3", # buildifier: leave-alone deps = [ ], diff --git a/third_party/cargo/vendor/byteorder-1.3.4/CHANGELOG.md b/third_party/cargo/vendor/byteorder-1.4.3/CHANGELOG.md similarity index 87% rename from third_party/cargo/vendor/byteorder-1.3.4/CHANGELOG.md rename to third_party/cargo/vendor/byteorder-1.4.3/CHANGELOG.md index 020beb4..6b51eb0 100644 --- a/third_party/cargo/vendor/byteorder-1.3.4/CHANGELOG.md +++ b/third_party/cargo/vendor/byteorder-1.4.3/CHANGELOG.md @@ -1,3 +1,28 @@ +1.3.4 +===== +This patch release squashes deprecation warnings for the `try!` macro, in +accordance with byteorder's minimum supported Rust version (currently at Rust +1.12.0). + + +1.3.3 +===== +This patch release adds `ByteOrder::write_i8_into()` as a simple, safe interface +for ordinarily unsafe or tedious code. + + +1.3.2 +===== +This patch release adds `ReadBytesExt::read_i8_into()` as a simple, safe interface +for ordinarily unsafe or tedious code. + + +1.3.1 +===== +This minor release performs mostly small internal changes. Going forward, these +are not going to be incorporated into the changelog. + + 1.3.0 ===== This new minor release now enables `i128` support automatically on Rust diff --git a/third_party/cargo/vendor/byteorder-1.3.4/COPYING b/third_party/cargo/vendor/byteorder-1.4.3/COPYING similarity index 100% rename from third_party/cargo/vendor/byteorder-1.3.4/COPYING rename to third_party/cargo/vendor/byteorder-1.4.3/COPYING diff --git a/third_party/cargo/vendor/byteorder-1.3.4/Cargo.toml b/third_party/cargo/vendor/byteorder-1.4.3/Cargo.toml similarity index 84% rename from third_party/cargo/vendor/byteorder-1.3.4/Cargo.toml rename to third_party/cargo/vendor/byteorder-1.4.3/Cargo.toml index 9d6d324..c71f90b 100644 --- a/third_party/cargo/vendor/byteorder-1.3.4/Cargo.toml +++ b/third_party/cargo/vendor/byteorder-1.4.3/Cargo.toml @@ -11,17 +11,17 @@ # will likely look very different (and much more reasonable) [package] +edition = "2018" name = "byteorder" -version = "1.3.4" +version = "1.4.3" authors = ["Andrew Gallant "] -build = "build.rs" exclude = ["/ci/*"] description = "Library for reading/writing numbers in big-endian and little-endian." homepage = "https://github.com/BurntSushi/byteorder" documentation = "https://docs.rs/byteorder" readme = "README.md" keywords = ["byte", "endian", "big-endian", "little-endian", "binary"] -categories = ["encoding", "parsing"] +categories = ["encoding", "parsing", "no-std"] license = "Unlicense OR MIT" repository = "https://github.com/BurntSushi/byteorder" [profile.bench] @@ -30,19 +30,14 @@ opt-level = 3 [lib] name = "byteorder" bench = false -[dev-dependencies.doc-comment] -version = "0.3" - [dev-dependencies.quickcheck] -version = "0.8" +version = "0.9.2" default-features = false [dev-dependencies.rand] -version = "0.6" +version = "0.7" [features] default = ["std"] i128 = [] std = [] -[badges.travis-ci] -repository = "BurntSushi/byteorder" diff --git a/third_party/cargo/vendor/byteorder-1.3.4/LICENSE-MIT b/third_party/cargo/vendor/byteorder-1.4.3/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/byteorder-1.3.4/LICENSE-MIT rename to third_party/cargo/vendor/byteorder-1.4.3/LICENSE-MIT diff --git a/third_party/cargo/vendor/byteorder-1.3.4/README.md b/third_party/cargo/vendor/byteorder-1.4.3/README.md similarity index 81% rename from third_party/cargo/vendor/byteorder-1.3.4/README.md rename to third_party/cargo/vendor/byteorder-1.4.3/README.md index 8940b29..d8461c5 100644 --- a/third_party/cargo/vendor/byteorder-1.3.4/README.md +++ b/third_party/cargo/vendor/byteorder-1.4.3/README.md @@ -1,10 +1,12 @@ +byteorder +========= This crate provides convenience methods for encoding and decoding numbers in either big-endian or little-endian order. -[![Build status](https://api.travis-ci.org/BurntSushi/byteorder.svg)](https://travis-ci.org/BurntSushi/byteorder) -[![](http://meritbadge.herokuapp.com/byteorder)](https://crates.io/crates/byteorder) +[![Build status](https://github.com/BurntSushi/byteorder/workflows/ci/badge.svg)](https://github.com/BurntSushi/byteorder/actions) +[![](https://meritbadge.herokuapp.com/byteorder)](https://crates.io/crates/byteorder) -Dual-licensed under MIT or the [UNLICENSE](http://unlicense.org). +Dual-licensed under MIT or the [UNLICENSE](https://unlicense.org/). ### Documentation @@ -27,8 +29,6 @@ If you want to augment existing `Read` and `Write` traits, then import the extension methods like so: ```rust -extern crate byteorder; - use byteorder::{ReadBytesExt, WriteBytesExt, BigEndian, LittleEndian}; ``` diff --git a/third_party/cargo/vendor/byteorder-1.3.4/UNLICENSE b/third_party/cargo/vendor/byteorder-1.4.3/UNLICENSE similarity index 100% rename from third_party/cargo/vendor/byteorder-1.3.4/UNLICENSE rename to third_party/cargo/vendor/byteorder-1.4.3/UNLICENSE diff --git a/third_party/cargo/vendor/byteorder-1.3.4/benches/bench.rs b/third_party/cargo/vendor/byteorder-1.4.3/benches/bench.rs similarity index 62% rename from third_party/cargo/vendor/byteorder-1.3.4/benches/bench.rs rename to third_party/cargo/vendor/byteorder-1.4.3/benches/bench.rs index d53d25e..bb00422 100644 --- a/third_party/cargo/vendor/byteorder-1.3.4/benches/bench.rs +++ b/third_party/cargo/vendor/byteorder-1.4.3/benches/bench.rs @@ -1,15 +1,15 @@ #![feature(test)] -extern crate byteorder; -extern crate rand; extern crate test; macro_rules! bench_num { - ($name:ident, $read:ident, $bytes:expr, $data:expr) => ( + ($name:ident, $read:ident, $bytes:expr, $data:expr) => { mod $name { - use byteorder::{ByteOrder, BigEndian, NativeEndian, LittleEndian}; - use super::test::Bencher; - use super::test::black_box as bb; + use byteorder::{ + BigEndian, ByteOrder, LittleEndian, NativeEndian, + }; + use test::black_box as bb; + use test::Bencher; const NITER: usize = 100_000; @@ -43,14 +43,16 @@ macro_rules! bench_num { }); } } - ); + }; ($ty:ident, $max:ident, - $read:ident, $write:ident, $size:expr, $data:expr) => ( + $read:ident, $write:ident, $size:expr, $data:expr) => { mod $ty { + use byteorder::{ + BigEndian, ByteOrder, LittleEndian, NativeEndian, + }; use std::$ty; - use byteorder::{ByteOrder, BigEndian, NativeEndian, LittleEndian}; - use super::test::Bencher; - use super::test::black_box as bb; + use test::black_box as bb; + use test::Bencher; const NITER: usize = 100_000; @@ -117,7 +119,7 @@ macro_rules! bench_num { }); } } - ); + }; } bench_num!(u16, MAX, read_u16, write_u16, 2, [1, 2]); @@ -127,8 +129,7 @@ bench_num!(i32, MAX, read_i32, write_i32, 4, [1, 2, 3, 4]); bench_num!(u64, MAX, read_u64, write_u64, 8, [1, 2, 3, 4, 5, 6, 7, 8]); bench_num!(i64, MAX, read_i64, write_i64, 8, [1, 2, 3, 4, 5, 6, 7, 8]); bench_num!(f32, MAX, read_f32, write_f32, 4, [1, 2, 3, 4]); -bench_num!(f64, MAX, read_f64, write_f64, 8, - [1, 2, 3, 4, 5, 6, 7, 8]); +bench_num!(f64, MAX, read_f64, write_f64, 8, [1, 2, 3, 4, 5, 6, 7, 8]); bench_num!(uint_1, read_uint, 1, [1]); bench_num!(uint_2, read_uint, 2, [1, 2]); @@ -148,120 +149,115 @@ bench_num!(int_6, read_int, 6, [1, 2, 3, 4, 5, 6]); bench_num!(int_7, read_int, 7, [1, 2, 3, 4, 5, 6, 7]); bench_num!(int_8, read_int, 8, [1, 2, 3, 4, 5, 6, 7, 8]); -#[cfg(byteorder_i128)] -bench_num!(u128, MAX, read_u128, write_u128, - 16, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); -#[cfg(byteorder_i128)] -bench_num!(i128, MAX, read_i128, write_i128, - 16, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); +bench_num!( + u128, + MAX, + read_u128, + write_u128, + 16, + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] +); +bench_num!( + i128, + MAX, + read_i128, + write_i128, + 16, + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] +); -#[cfg(byteorder_i128)] -bench_num!(uint128_1, read_uint128, - 1, [1]); -#[cfg(byteorder_i128)] -bench_num!(uint128_2, read_uint128, - 2, [1, 2]); -#[cfg(byteorder_i128)] -bench_num!(uint128_3, read_uint128, - 3, [1, 2, 3]); -#[cfg(byteorder_i128)] -bench_num!(uint128_4, read_uint128, - 4, [1, 2, 3, 4]); -#[cfg(byteorder_i128)] -bench_num!(uint128_5, read_uint128, - 5, [1, 2, 3, 4, 5]); -#[cfg(byteorder_i128)] -bench_num!(uint128_6, read_uint128, - 6, [1, 2, 3, 4, 5, 6]); -#[cfg(byteorder_i128)] -bench_num!(uint128_7, read_uint128, - 7, [1, 2, 3, 4, 5, 6, 7]); -#[cfg(byteorder_i128)] -bench_num!(uint128_8, read_uint128, - 8, [1, 2, 3, 4, 5, 6, 7, 8]); -#[cfg(byteorder_i128)] -bench_num!(uint128_9, read_uint128, - 9, [1, 2, 3, 4, 5, 6, 7, 8, 9]); -#[cfg(byteorder_i128)] -bench_num!(uint128_10, read_uint128, - 10, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); -#[cfg(byteorder_i128)] -bench_num!(uint128_11, read_uint128, - 11, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]); -#[cfg(byteorder_i128)] -bench_num!(uint128_12, read_uint128, - 12, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); -#[cfg(byteorder_i128)] -bench_num!(uint128_13, read_uint128, - 13, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]); -#[cfg(byteorder_i128)] -bench_num!(uint128_14, read_uint128, - 14, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]); -#[cfg(byteorder_i128)] -bench_num!(uint128_15, read_uint128, - 15, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); -#[cfg(byteorder_i128)] -bench_num!(uint128_16, read_uint128, - 16, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); - -#[cfg(byteorder_i128)] -bench_num!(int128_1, read_int128, - 1, [1]); -#[cfg(byteorder_i128)] -bench_num!(int128_2, read_int128, - 2, [1, 2]); -#[cfg(byteorder_i128)] -bench_num!(int128_3, read_int128, - 3, [1, 2, 3]); -#[cfg(byteorder_i128)] -bench_num!(int128_4, read_int128, - 4, [1, 2, 3, 4]); -#[cfg(byteorder_i128)] -bench_num!(int128_5, read_int128, - 5, [1, 2, 3, 4, 5]); -#[cfg(byteorder_i128)] -bench_num!(int128_6, read_int128, - 6, [1, 2, 3, 4, 5, 6]); -#[cfg(byteorder_i128)] -bench_num!(int128_7, read_int128, - 7, [1, 2, 3, 4, 5, 6, 7]); -#[cfg(byteorder_i128)] -bench_num!(int128_8, read_int128, - 8, [1, 2, 3, 4, 5, 6, 7, 8]); -#[cfg(byteorder_i128)] -bench_num!(int128_9, read_int128, - 9, [1, 2, 3, 4, 5, 6, 7, 8, 9]); -#[cfg(byteorder_i128)] -bench_num!(int128_10, read_int128, - 10, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); -#[cfg(byteorder_i128)] -bench_num!(int128_11, read_int128, - 11, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]); -#[cfg(byteorder_i128)] -bench_num!(int128_12, read_int128, - 12, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); -#[cfg(byteorder_i128)] -bench_num!(int128_13, read_int128, - 13, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]); -#[cfg(byteorder_i128)] -bench_num!(int128_14, read_int128, - 14, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]); -#[cfg(byteorder_i128)] -bench_num!(int128_15, read_int128, - 15, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); -#[cfg(byteorder_i128)] -bench_num!(int128_16, read_int128, - 16, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); +bench_num!(uint128_1, read_uint128, 1, [1]); +bench_num!(uint128_2, read_uint128, 2, [1, 2]); +bench_num!(uint128_3, read_uint128, 3, [1, 2, 3]); +bench_num!(uint128_4, read_uint128, 4, [1, 2, 3, 4]); +bench_num!(uint128_5, read_uint128, 5, [1, 2, 3, 4, 5]); +bench_num!(uint128_6, read_uint128, 6, [1, 2, 3, 4, 5, 6]); +bench_num!(uint128_7, read_uint128, 7, [1, 2, 3, 4, 5, 6, 7]); +bench_num!(uint128_8, read_uint128, 8, [1, 2, 3, 4, 5, 6, 7, 8]); +bench_num!(uint128_9, read_uint128, 9, [1, 2, 3, 4, 5, 6, 7, 8, 9]); +bench_num!(uint128_10, read_uint128, 10, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); +bench_num!(uint128_11, read_uint128, 11, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]); +bench_num!( + uint128_12, + read_uint128, + 12, + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] +); +bench_num!( + uint128_13, + read_uint128, + 13, + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] +); +bench_num!( + uint128_14, + read_uint128, + 14, + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] +); +bench_num!( + uint128_15, + read_uint128, + 15, + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] +); +bench_num!( + uint128_16, + read_uint128, + 16, + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] +); +bench_num!(int128_1, read_int128, 1, [1]); +bench_num!(int128_2, read_int128, 2, [1, 2]); +bench_num!(int128_3, read_int128, 3, [1, 2, 3]); +bench_num!(int128_4, read_int128, 4, [1, 2, 3, 4]); +bench_num!(int128_5, read_int128, 5, [1, 2, 3, 4, 5]); +bench_num!(int128_6, read_int128, 6, [1, 2, 3, 4, 5, 6]); +bench_num!(int128_7, read_int128, 7, [1, 2, 3, 4, 5, 6, 7]); +bench_num!(int128_8, read_int128, 8, [1, 2, 3, 4, 5, 6, 7, 8]); +bench_num!(int128_9, read_int128, 9, [1, 2, 3, 4, 5, 6, 7, 8, 9]); +bench_num!(int128_10, read_int128, 10, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); +bench_num!(int128_11, read_int128, 11, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]); +bench_num!( + int128_12, + read_int128, + 12, + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] +); +bench_num!( + int128_13, + read_int128, + 13, + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] +); +bench_num!( + int128_14, + read_int128, + 14, + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] +); +bench_num!( + int128_15, + read_int128, + 15, + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] +); +bench_num!( + int128_16, + read_int128, + 16, + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] +); macro_rules! bench_slice { ($name:ident, $numty:ty, $read:ident, $write:ident) => { mod $name { use std::mem::size_of; - use byteorder::{ByteOrder, BigEndian, LittleEndian}; - use rand::{self, Rng}; + use byteorder::{BigEndian, ByteOrder, LittleEndian}; use rand::distributions; + use rand::{self, Rng}; use test::Bencher; #[bench] @@ -322,7 +318,7 @@ macro_rules! bench_slice { }); } } - } + }; } bench_slice!(slice_u64, u64, read_u64_into, write_u64_into); diff --git a/third_party/cargo/vendor/regex-1.4.2/rustfmt.toml b/third_party/cargo/vendor/byteorder-1.4.3/rustfmt.toml similarity index 100% rename from third_party/cargo/vendor/regex-1.4.2/rustfmt.toml rename to third_party/cargo/vendor/byteorder-1.4.3/rustfmt.toml diff --git a/third_party/cargo/vendor/byteorder-1.3.4/src/io.rs b/third_party/cargo/vendor/byteorder-1.4.3/src/io.rs similarity index 96% rename from third_party/cargo/vendor/byteorder-1.3.4/src/io.rs rename to third_party/cargo/vendor/byteorder-1.4.3/src/io.rs index ed6a848..dfad2ca 100644 --- a/third_party/cargo/vendor/byteorder-1.3.4/src/io.rs +++ b/third_party/cargo/vendor/byteorder-1.4.3/src/io.rs @@ -1,7 +1,9 @@ -use std::io::{self, Result}; -use std::slice; +use std::{ + io::{self, Result}, + slice, +}; -use ByteOrder; +use crate::ByteOrder; /// Extends [`Read`] with methods for reading numbers. (For `std::io`.) /// @@ -52,7 +54,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_u8(&mut self) -> Result { let mut buf = [0; 1]; - try!(self.read_exact(&mut buf)); + self.read_exact(&mut buf)?; Ok(buf[0]) } @@ -82,7 +84,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_i8(&mut self) -> Result { let mut buf = [0; 1]; - try!(self.read_exact(&mut buf)); + self.read_exact(&mut buf)?; Ok(buf[0] as i8) } @@ -109,7 +111,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_u16(&mut self) -> Result { let mut buf = [0; 2]; - try!(self.read_exact(&mut buf)); + self.read_exact(&mut buf)?; Ok(T::read_u16(&buf)) } @@ -136,7 +138,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_i16(&mut self) -> Result { let mut buf = [0; 2]; - try!(self.read_exact(&mut buf)); + self.read_exact(&mut buf)?; Ok(T::read_i16(&buf)) } @@ -162,7 +164,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_u24(&mut self) -> Result { let mut buf = [0; 3]; - try!(self.read_exact(&mut buf)); + self.read_exact(&mut buf)?; Ok(T::read_u24(&buf)) } @@ -188,7 +190,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_i24(&mut self) -> Result { let mut buf = [0; 3]; - try!(self.read_exact(&mut buf)); + self.read_exact(&mut buf)?; Ok(T::read_i24(&buf)) } @@ -214,7 +216,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_u32(&mut self) -> Result { let mut buf = [0; 4]; - try!(self.read_exact(&mut buf)); + self.read_exact(&mut buf)?; Ok(T::read_u32(&buf)) } @@ -240,7 +242,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_i32(&mut self) -> Result { let mut buf = [0; 4]; - try!(self.read_exact(&mut buf)); + self.read_exact(&mut buf)?; Ok(T::read_i32(&buf)) } @@ -266,7 +268,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_u48(&mut self) -> Result { let mut buf = [0; 6]; - try!(self.read_exact(&mut buf)); + self.read_exact(&mut buf)?; Ok(T::read_u48(&buf)) } @@ -292,7 +294,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_i48(&mut self) -> Result { let mut buf = [0; 6]; - try!(self.read_exact(&mut buf)); + self.read_exact(&mut buf)?; Ok(T::read_i48(&buf)) } @@ -318,7 +320,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_u64(&mut self) -> Result { let mut buf = [0; 8]; - try!(self.read_exact(&mut buf)); + self.read_exact(&mut buf)?; Ok(T::read_u64(&buf)) } @@ -344,7 +346,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_i64(&mut self) -> Result { let mut buf = [0; 8]; - try!(self.read_exact(&mut buf)); + self.read_exact(&mut buf)?; Ok(T::read_i64(&buf)) } @@ -370,11 +372,10 @@ pub trait ReadBytesExt: io::Read { /// ]); /// assert_eq!(16947640962301618749969007319746179, rdr.read_u128::().unwrap()); /// ``` - #[cfg(byteorder_i128)] #[inline] fn read_u128(&mut self) -> Result { let mut buf = [0; 16]; - try!(self.read_exact(&mut buf)); + self.read_exact(&mut buf)?; Ok(T::read_u128(&buf)) } @@ -397,11 +398,10 @@ pub trait ReadBytesExt: io::Read { /// let mut rdr = Cursor::new(vec![0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); /// assert_eq!(i128::min_value(), rdr.read_i128::().unwrap()); /// ``` - #[cfg(byteorder_i128)] #[inline] fn read_i128(&mut self) -> Result { let mut buf = [0; 16]; - try!(self.read_exact(&mut buf)); + self.read_exact(&mut buf)?; Ok(T::read_i128(&buf)) } @@ -426,7 +426,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_uint(&mut self, nbytes: usize) -> Result { let mut buf = [0; 8]; - try!(self.read_exact(&mut buf[..nbytes])); + self.read_exact(&mut buf[..nbytes])?; Ok(T::read_uint(&buf[..nbytes], nbytes)) } @@ -451,25 +451,23 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_int(&mut self, nbytes: usize) -> Result { let mut buf = [0; 8]; - try!(self.read_exact(&mut buf[..nbytes])); + self.read_exact(&mut buf[..nbytes])?; Ok(T::read_int(&buf[..nbytes], nbytes)) } /// Reads an unsigned n-bytes integer from the underlying reader. - #[cfg(byteorder_i128)] #[inline] fn read_uint128(&mut self, nbytes: usize) -> Result { let mut buf = [0; 16]; - try!(self.read_exact(&mut buf[..nbytes])); + self.read_exact(&mut buf[..nbytes])?; Ok(T::read_uint128(&buf[..nbytes], nbytes)) } /// Reads a signed n-bytes integer from the underlying reader. - #[cfg(byteorder_i128)] #[inline] fn read_int128(&mut self, nbytes: usize) -> Result { let mut buf = [0; 16]; - try!(self.read_exact(&mut buf[..nbytes])); + self.read_exact(&mut buf[..nbytes])?; Ok(T::read_int128(&buf[..nbytes], nbytes)) } @@ -500,7 +498,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_f32(&mut self) -> Result { let mut buf = [0; 4]; - try!(self.read_exact(&mut buf)); + self.read_exact(&mut buf)?; Ok(T::read_f32(&buf)) } @@ -531,7 +529,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_f64(&mut self) -> Result { let mut buf = [0; 8]; - try!(self.read_exact(&mut buf)); + self.read_exact(&mut buf)?; Ok(T::read_f64(&buf)) } @@ -564,7 +562,7 @@ pub trait ReadBytesExt: io::Read { fn read_u16_into(&mut self, dst: &mut [u16]) -> Result<()> { { let buf = unsafe { slice_to_u8_mut(dst) }; - try!(self.read_exact(buf)); + self.read_exact(buf)?; } T::from_slice_u16(dst); Ok(()) @@ -599,7 +597,7 @@ pub trait ReadBytesExt: io::Read { fn read_u32_into(&mut self, dst: &mut [u32]) -> Result<()> { { let buf = unsafe { slice_to_u8_mut(dst) }; - try!(self.read_exact(buf)); + self.read_exact(buf)?; } T::from_slice_u32(dst); Ok(()) @@ -637,7 +635,7 @@ pub trait ReadBytesExt: io::Read { fn read_u64_into(&mut self, dst: &mut [u64]) -> Result<()> { { let buf = unsafe { slice_to_u8_mut(dst) }; - try!(self.read_exact(buf)); + self.read_exact(buf)?; } T::from_slice_u64(dst); Ok(()) @@ -671,7 +669,6 @@ pub trait ReadBytesExt: io::Read { /// rdr.read_u128_into::(&mut dst).unwrap(); /// assert_eq!([517, 768], dst); /// ``` - #[cfg(byteorder_i128)] #[inline] fn read_u128_into( &mut self, @@ -679,7 +676,7 @@ pub trait ReadBytesExt: io::Read { ) -> Result<()> { { let buf = unsafe { slice_to_u8_mut(dst) }; - try!(self.read_exact(buf)); + self.read_exact(buf)?; } T::from_slice_u128(dst); Ok(()) @@ -750,7 +747,7 @@ pub trait ReadBytesExt: io::Read { fn read_i16_into(&mut self, dst: &mut [i16]) -> Result<()> { { let buf = unsafe { slice_to_u8_mut(dst) }; - try!(self.read_exact(buf)); + self.read_exact(buf)?; } T::from_slice_i16(dst); Ok(()) @@ -785,7 +782,7 @@ pub trait ReadBytesExt: io::Read { fn read_i32_into(&mut self, dst: &mut [i32]) -> Result<()> { { let buf = unsafe { slice_to_u8_mut(dst) }; - try!(self.read_exact(buf)); + self.read_exact(buf)?; } T::from_slice_i32(dst); Ok(()) @@ -823,7 +820,7 @@ pub trait ReadBytesExt: io::Read { fn read_i64_into(&mut self, dst: &mut [i64]) -> Result<()> { { let buf = unsafe { slice_to_u8_mut(dst) }; - try!(self.read_exact(buf)); + self.read_exact(buf)?; } T::from_slice_i64(dst); Ok(()) @@ -857,7 +854,6 @@ pub trait ReadBytesExt: io::Read { /// rdr.read_i128_into::(&mut dst).unwrap(); /// assert_eq!([517, 768], dst); /// ``` - #[cfg(byteorder_i128)] #[inline] fn read_i128_into( &mut self, @@ -865,7 +861,7 @@ pub trait ReadBytesExt: io::Read { ) -> Result<()> { { let buf = unsafe { slice_to_u8_mut(dst) }; - try!(self.read_exact(buf)); + self.read_exact(buf)?; } T::from_slice_i128(dst); Ok(()) @@ -903,13 +899,10 @@ pub trait ReadBytesExt: io::Read { /// assert_eq!([f32::consts::PI, 1.0], dst); /// ``` #[inline] - fn read_f32_into( - &mut self, - dst: &mut [f32], - ) -> Result<()> { + fn read_f32_into(&mut self, dst: &mut [f32]) -> Result<()> { { let buf = unsafe { slice_to_u8_mut(dst) }; - try!(self.read_exact(buf)); + self.read_exact(buf)?; } T::from_slice_f32(dst); Ok(()) @@ -951,7 +944,7 @@ pub trait ReadBytesExt: io::Read { /// assert_eq!([f32::consts::PI, 1.0], dst); /// ``` #[inline] - #[deprecated(since="1.2.0", note="please use `read_f32_into` instead")] + #[deprecated(since = "1.2.0", note = "please use `read_f32_into` instead")] fn read_f32_into_unchecked( &mut self, dst: &mut [f32], @@ -991,13 +984,10 @@ pub trait ReadBytesExt: io::Read { /// assert_eq!([f64::consts::PI, 1.0], dst); /// ``` #[inline] - fn read_f64_into( - &mut self, - dst: &mut [f64], - ) -> Result<()> { + fn read_f64_into(&mut self, dst: &mut [f64]) -> Result<()> { { let buf = unsafe { slice_to_u8_mut(dst) }; - try!(self.read_exact(buf)); + self.read_exact(buf)?; } T::from_slice_f64(dst); Ok(()) @@ -1045,7 +1035,7 @@ pub trait ReadBytesExt: io::Read { /// assert_eq!([f64::consts::PI, 1.0], dst); /// ``` #[inline] - #[deprecated(since="1.2.0", note="please use `read_f64_into` instead")] + #[deprecated(since = "1.2.0", note = "please use `read_f64_into` instead")] fn read_f64_into_unchecked( &mut self, dst: &mut [f64], @@ -1408,7 +1398,6 @@ pub trait WriteBytesExt: io::Write { } /// Writes an unsigned 128 bit integer to the underlying writer. - #[cfg(byteorder_i128)] #[inline] fn write_u128(&mut self, n: u128) -> Result<()> { let mut buf = [0; 16]; @@ -1417,7 +1406,6 @@ pub trait WriteBytesExt: io::Write { } /// Writes a signed 128 bit integer to the underlying writer. - #[cfg(byteorder_i128)] #[inline] fn write_i128(&mut self, n: i128) -> Result<()> { let mut buf = [0; 16]; @@ -1501,7 +1489,6 @@ pub trait WriteBytesExt: io::Write { /// /// If the given integer is not representable in the given number of bytes, /// this method panics. If `nbytes > 16`, this method panics. - #[cfg(byteorder_i128)] #[inline] fn write_uint128( &mut self, @@ -1517,7 +1504,6 @@ pub trait WriteBytesExt: io::Write { /// /// If the given integer is not representable in the given number of bytes, /// this method panics. If `nbytes > 16`, this method panics. - #[cfg(byteorder_i128)] #[inline] fn write_int128( &mut self, @@ -1596,7 +1582,8 @@ impl WriteBytesExt for W {} /// representation. /// /// This function is wildly unsafe because it permits arbitrary modification of -/// the binary representation of any `Copy` type. Use with care. +/// the binary representation of any `Copy` type. Use with care. It's intended +/// to be called only where `T` is a numeric type. unsafe fn slice_to_u8_mut(slice: &mut [T]) -> &mut [u8] { use std::mem::size_of; diff --git a/third_party/cargo/vendor/byteorder-1.3.4/src/lib.rs b/third_party/cargo/vendor/byteorder-1.4.3/src/lib.rs similarity index 74% rename from third_party/cargo/vendor/byteorder-1.3.4/src/lib.rs rename to third_party/cargo/vendor/byteorder-1.4.3/src/lib.rs index 5423ed1..cc37cca 100644 --- a/third_party/cargo/vendor/byteorder-1.3.4/src/lib.rs +++ b/third_party/cargo/vendor/byteorder-1.4.3/src/lib.rs @@ -67,29 +67,15 @@ cases. [`Write`]: https://doc.rust-lang.org/std/io/trait.Write.html */ -// For the 'try!' macro, until we bump MSRV past 1.12. -#![allow(deprecated)] - #![deny(missing_docs)] #![cfg_attr(not(feature = "std"), no_std)] -#[cfg(feature = "std")] -extern crate core; - -#[cfg(test)] -#[macro_use] -extern crate doc_comment; - -#[cfg(test)] -doctest!("../README.md"); - -use core::fmt::Debug; -use core::hash::Hash; -use core::ptr::copy_nonoverlapping; -use core::slice; +use core::{ + convert::TryInto, fmt::Debug, hash::Hash, ptr::copy_nonoverlapping, slice, +}; #[cfg(feature = "std")] -pub use io::{ReadBytesExt, WriteBytesExt}; +pub use crate::io::{ReadBytesExt, WriteBytesExt}; #[cfg(feature = "std")] mod io; @@ -100,7 +86,6 @@ fn extend_sign(val: u64, nbytes: usize) -> i64 { (val << shift) as i64 >> shift } -#[cfg(byteorder_i128)] #[inline] fn extend_sign128(val: u128, nbytes: usize) -> i128 { let shift = (16 - nbytes) * 8; @@ -113,7 +98,6 @@ fn unextend_sign(val: i64, nbytes: usize) -> u64 { (val << shift) as u64 >> shift } -#[cfg(byteorder_i128)] #[inline] fn unextend_sign128(val: i128, nbytes: usize) -> u128 { let shift = (16 - nbytes) * 8; @@ -141,7 +125,6 @@ fn pack_size(n: u64) -> usize { } } -#[cfg(byteorder_i128)] #[inline] fn pack_size128(n: u128) -> usize { if n < 1 << 8 { @@ -182,7 +165,7 @@ fn pack_size128(n: u128) -> usize { mod private { /// Sealed stops crates other than byteorder from implementing any traits /// that use it. - pub trait Sealed{} + pub trait Sealed {} impl Sealed for super::LittleEndian {} impl Sealed for super::BigEndian {} } @@ -222,8 +205,16 @@ mod private { /// /// [`BigEndian`]: enum.BigEndian.html /// [`LittleEndian`]: enum.LittleEndian.html -pub trait ByteOrder - : Clone + Copy + Debug + Default + Eq + Hash + Ord + PartialEq + PartialOrd +pub trait ByteOrder: + Clone + + Copy + + Debug + + Default + + Eq + + Hash + + Ord + + PartialEq + + PartialOrd + private::Sealed { /// Reads an unsigned 16 bit integer from `buf`. @@ -330,7 +321,6 @@ pub trait ByteOrder /// LittleEndian::write_u128(&mut buf, 1_000_000); /// assert_eq!(1_000_000, LittleEndian::read_u128(&buf)); /// ``` - #[cfg(byteorder_i128)] fn read_u128(buf: &[u8]) -> u128; /// Reads an unsigned n-bytes integer from `buf`. @@ -371,7 +361,6 @@ pub trait ByteOrder /// LittleEndian::write_uint128(&mut buf, 1_000_000, 3); /// assert_eq!(1_000_000, LittleEndian::read_uint128(&buf, 3)); /// ``` - #[cfg(byteorder_i128)] fn read_uint128(buf: &[u8], nbytes: usize) -> u128; /// Writes an unsigned 16 bit integer `n` to `buf`. @@ -490,7 +479,6 @@ pub trait ByteOrder /// LittleEndian::write_u128(&mut buf, 1_000_000); /// assert_eq!(1_000_000, LittleEndian::read_u128(&buf)); /// ``` - #[cfg(byteorder_i128)] fn write_u128(buf: &mut [u8], n: u128); /// Writes an unsigned integer `n` to `buf` using only `nbytes`. @@ -531,7 +519,6 @@ pub trait ByteOrder /// LittleEndian::write_uint128(&mut buf, 1_000_000, 3); /// assert_eq!(1_000_000, LittleEndian::read_uint128(&buf, 3)); /// ``` - #[cfg(byteorder_i128)] fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize); /// Reads a signed 16 bit integer from `buf`. @@ -661,7 +648,6 @@ pub trait ByteOrder /// LittleEndian::write_i128(&mut buf, -1_000_000_000); /// assert_eq!(-1_000_000_000, LittleEndian::read_i128(&buf)); /// ``` - #[cfg(byteorder_i128)] #[inline] fn read_i128(buf: &[u8]) -> i128 { Self::read_u128(buf) as i128 @@ -708,7 +694,6 @@ pub trait ByteOrder /// LittleEndian::write_int128(&mut buf, -1_000, 3); /// assert_eq!(-1_000, LittleEndian::read_int128(&buf, 3)); /// ``` - #[cfg(byteorder_i128)] #[inline] fn read_int128(buf: &[u8], nbytes: usize) -> i128 { extend_sign128(Self::read_uint128(buf, nbytes), nbytes) @@ -734,7 +719,7 @@ pub trait ByteOrder /// ``` #[inline] fn read_f32(buf: &[u8]) -> f32 { - unsafe { *(&Self::read_u32(buf) as *const u32 as *const f32) } + f32::from_bits(Self::read_u32(buf)) } /// Reads a IEEE754 double-precision (8 bytes) floating point number. @@ -757,7 +742,7 @@ pub trait ByteOrder /// ``` #[inline] fn read_f64(buf: &[u8]) -> f64 { - unsafe { *(&Self::read_u64(buf) as *const u64 as *const f64) } + f64::from_bits(Self::read_u64(buf)) } /// Writes a signed 16 bit integer `n` to `buf`. @@ -887,7 +872,6 @@ pub trait ByteOrder /// LittleEndian::write_i128(&mut buf, -1_000_000_000); /// assert_eq!(-1_000_000_000, LittleEndian::read_i128(&buf)); /// ``` - #[cfg(byteorder_i128)] #[inline] fn write_i128(buf: &mut [u8], n: i128) { Self::write_u128(buf, n as u128) @@ -934,7 +918,6 @@ pub trait ByteOrder /// LittleEndian::write_int128(&mut buf, -1_000, 3); /// assert_eq!(-1_000, LittleEndian::read_int128(&buf, 3)); /// ``` - #[cfg(byteorder_i128)] #[inline] fn write_int128(buf: &mut [u8], n: i128, nbytes: usize) { Self::write_uint128(buf, unextend_sign128(n, nbytes), nbytes) @@ -960,8 +943,7 @@ pub trait ByteOrder /// ``` #[inline] fn write_f32(buf: &mut [u8], n: f32) { - let n = unsafe { *(&n as *const f32 as *const u32) }; - Self::write_u32(buf, n) + Self::write_u32(buf, n.to_bits()) } /// Writes a IEEE754 double-precision (8 bytes) floating point number. @@ -984,8 +966,7 @@ pub trait ByteOrder /// ``` #[inline] fn write_f64(buf: &mut [u8], n: f64) { - let n = unsafe { *(&n as *const f64 as *const u64) }; - Self::write_u64(buf, n) + Self::write_u64(buf, n.to_bits()) } /// Reads unsigned 16 bit integers from `src` into `dst`. @@ -1078,7 +1059,6 @@ pub trait ByteOrder /// LittleEndian::read_u128_into(&bytes, &mut numbers_got); /// assert_eq!(numbers_given, numbers_got); /// ``` - #[cfg(byteorder_i128)] fn read_u128_into(src: &[u8], dst: &mut [u128]); /// Reads signed 16 bit integers from `src` to `dst`. @@ -1189,7 +1169,6 @@ pub trait ByteOrder /// LittleEndian::read_i128_into(&bytes, &mut numbers_got); /// assert_eq!(numbers_given, numbers_got); /// ``` - #[cfg(byteorder_i128)] #[inline] fn read_i128_into(src: &[u8], dst: &mut [i128]) { let dst = unsafe { @@ -1254,7 +1233,7 @@ pub trait ByteOrder /// assert_eq!(numbers_given, numbers_got); /// ``` #[inline] - #[deprecated(since="1.3.0", note="please use `read_f32_into` instead")] + #[deprecated(since = "1.3.0", note = "please use `read_f32_into` instead")] fn read_f32_into_unchecked(src: &[u8], dst: &mut [f32]) { Self::read_f32_into(src, dst); } @@ -1316,7 +1295,7 @@ pub trait ByteOrder /// assert_eq!(numbers_given, numbers_got); /// ``` #[inline] - #[deprecated(since="1.3.0", note="please use `read_f64_into` instead")] + #[deprecated(since = "1.3.0", note = "please use `read_f64_into` instead")] fn read_f64_into_unchecked(src: &[u8], dst: &mut [f64]) { Self::read_f64_into(src, dst); } @@ -1411,7 +1390,6 @@ pub trait ByteOrder /// LittleEndian::read_u128_into(&bytes, &mut numbers_got); /// assert_eq!(numbers_given, numbers_got); /// ``` - #[cfg(byteorder_i128)] fn write_u128_into(src: &[u128], dst: &mut [u8]); /// Writes signed 8 bit integers from `src` into `dst`. @@ -1553,7 +1531,6 @@ pub trait ByteOrder /// LittleEndian::read_i128_into(&bytes, &mut numbers_got); /// assert_eq!(numbers_given, numbers_got); /// ``` - #[cfg(byteorder_i128)] fn write_i128_into(src: &[i128], dst: &mut [u8]) { let src = unsafe { slice::from_raw_parts(src.as_ptr() as *const u128, src.len()) @@ -1580,9 +1557,7 @@ pub trait ByteOrder /// LittleEndian::write_f32_into(&numbers_given, &mut bytes); /// /// let mut numbers_got = [0.0; 4]; - /// unsafe { - /// LittleEndian::read_f32_into(&bytes, &mut numbers_got); - /// } + /// LittleEndian::read_f32_into(&bytes, &mut numbers_got); /// assert_eq!(numbers_given, numbers_got); /// ``` fn write_f32_into(src: &[f32], dst: &mut [u8]) { @@ -1611,9 +1586,7 @@ pub trait ByteOrder /// LittleEndian::write_f64_into(&numbers_given, &mut bytes); /// /// let mut numbers_got = [0.0; 4]; - /// unsafe { - /// LittleEndian::read_f64_into(&bytes, &mut numbers_got); - /// } + /// LittleEndian::read_f64_into(&bytes, &mut numbers_got); /// assert_eq!(numbers_given, numbers_got); /// ``` fn write_f64_into(src: &[f64], dst: &mut [u8]) { @@ -1697,7 +1670,6 @@ pub trait ByteOrder /// BigEndian::from_slice_u128(&mut numbers); /// assert_eq!(numbers, [5u128.to_be(), 65000u128.to_be()]); /// ``` - #[cfg(byteorder_i128)] fn from_slice_u128(numbers: &mut [u128]); /// Converts the given slice of signed 16 bit integers to a particular @@ -1720,7 +1692,7 @@ pub trait ByteOrder #[inline] fn from_slice_i16(src: &mut [i16]) { let src = unsafe { - slice::from_raw_parts_mut(src.as_ptr() as *mut u16, src.len()) + slice::from_raw_parts_mut(src.as_mut_ptr() as *mut u16, src.len()) }; Self::from_slice_u16(src); } @@ -1745,7 +1717,7 @@ pub trait ByteOrder #[inline] fn from_slice_i32(src: &mut [i32]) { let src = unsafe { - slice::from_raw_parts_mut(src.as_ptr() as *mut u32, src.len()) + slice::from_raw_parts_mut(src.as_mut_ptr() as *mut u32, src.len()) }; Self::from_slice_u32(src); } @@ -1770,7 +1742,7 @@ pub trait ByteOrder #[inline] fn from_slice_i64(src: &mut [i64]) { let src = unsafe { - slice::from_raw_parts_mut(src.as_ptr() as *mut u64, src.len()) + slice::from_raw_parts_mut(src.as_mut_ptr() as *mut u64, src.len()) }; Self::from_slice_u64(src); } @@ -1792,11 +1764,10 @@ pub trait ByteOrder /// BigEndian::from_slice_i128(&mut numbers); /// assert_eq!(numbers, [5i128.to_be(), 65000i128.to_be()]); /// ``` - #[cfg(byteorder_i128)] #[inline] fn from_slice_i128(src: &mut [i128]) { let src = unsafe { - slice::from_raw_parts_mut(src.as_ptr() as *mut u128, src.len()) + slice::from_raw_parts_mut(src.as_mut_ptr() as *mut u128, src.len()) }; Self::from_slice_u128(src); } @@ -1924,33 +1895,30 @@ pub type NativeEndian = LittleEndian; #[cfg(target_endian = "big")] pub type NativeEndian = BigEndian; -macro_rules! read_num_bytes { - ($ty:ty, $size:expr, $src:expr, $which:ident) => ({ - assert!($size == ::core::mem::size_of::<$ty>()); - assert!($size <= $src.len()); - let mut data: $ty = 0; - unsafe { - copy_nonoverlapping( - $src.as_ptr(), - &mut data as *mut $ty as *mut u8, - $size); - } - data.$which() - }); -} - -macro_rules! write_num_bytes { - ($ty:ty, $size:expr, $n:expr, $dst:expr, $which:ident) => ({ +/// Copies $size bytes from a number $n to a &mut [u8] $dst. $ty represents the +/// numeric type of $n and $which must be either to_be or to_le, depending on +/// which endianness one wants to use when writing to $dst. +/// +/// This macro is only safe to call when $ty is a numeric type and $size == +/// size_of::<$ty>() and where $dst is a &mut [u8]. +macro_rules! unsafe_write_num_bytes { + ($ty:ty, $size:expr, $n:expr, $dst:expr, $which:ident) => {{ assert!($size <= $dst.len()); unsafe { // N.B. https://github.com/rust-lang/rust/issues/22776 let bytes = *(&$n.$which() as *const _ as *const [u8; $size]); copy_nonoverlapping((&bytes).as_ptr(), $dst.as_mut_ptr(), $size); } - }); + }}; } -macro_rules! read_slice { +/// Copies a &[u8] $src into a &mut [] $dst for the endianness given +/// by $which (must be either to_be or to_le). +/// +/// This macro is only safe to call when $src and $dst are &[u8] and &mut [u8], +/// respectively. The macro will panic if $src.len() != $size * $dst.len(), +/// where $size represents the size of the integers encoded in $src. +macro_rules! unsafe_read_slice { ($src:expr, $dst:expr, $size:expr, $which:ident) => {{ assert_eq!($src.len(), $size * $dst.len()); @@ -1958,7 +1926,8 @@ macro_rules! read_slice { copy_nonoverlapping( $src.as_ptr(), $dst.as_mut_ptr() as *mut u8, - $src.len()); + $src.len(), + ); } for v in $dst.iter_mut() { *v = v.$which(); @@ -1966,51 +1935,57 @@ macro_rules! read_slice { }}; } -macro_rules! write_slice_native { - ($src:expr, $dst:expr, $ty:ty, $size:expr) => {{ - assert!($size == ::core::mem::size_of::<$ty>()); - assert_eq!($size * $src.len(), $dst.len()); +/// Copies a &[$ty] $src into a &mut [u8] $dst, where $ty must be a numeric +/// type. This panics if size_of::<$ty>() * $src.len() != $dst.len(). +/// +/// This macro is only safe to call when $src is a slice of numeric types and +/// $dst is a &mut [u8] and where $ty represents the type of the integers in +/// $src. +macro_rules! unsafe_write_slice_native { + ($src:expr, $dst:expr, $ty:ty) => {{ + let size = core::mem::size_of::<$ty>(); + assert_eq!(size * $src.len(), $dst.len()); unsafe { copy_nonoverlapping( $src.as_ptr() as *const u8, $dst.as_mut_ptr(), - $dst.len()); + $dst.len(), + ); } }}; } macro_rules! write_slice { - ($src:expr, $dst:expr, $ty:ty, $size:expr, $write:expr) => ({ + ($src:expr, $dst:expr, $ty:ty, $size:expr, $write:expr) => {{ assert!($size == ::core::mem::size_of::<$ty>()); assert_eq!($size * $src.len(), $dst.len()); for (&n, chunk) in $src.iter().zip($dst.chunks_mut($size)) { $write(chunk, n); } - }); + }}; } impl ByteOrder for BigEndian { #[inline] fn read_u16(buf: &[u8]) -> u16 { - read_num_bytes!(u16, 2, buf, to_be) + u16::from_be_bytes(buf[..2].try_into().unwrap()) } #[inline] fn read_u32(buf: &[u8]) -> u32 { - read_num_bytes!(u32, 4, buf, to_be) + u32::from_be_bytes(buf[..4].try_into().unwrap()) } #[inline] fn read_u64(buf: &[u8]) -> u64 { - read_num_bytes!(u64, 8, buf, to_be) + u64::from_be_bytes(buf[..8].try_into().unwrap()) } - #[cfg(byteorder_i128)] #[inline] fn read_u128(buf: &[u8]) -> u128 { - read_num_bytes!(u128, 16, buf, to_be) + u128::from_be_bytes(buf[..16].try_into().unwrap()) } #[inline] @@ -2020,12 +1995,14 @@ impl ByteOrder for BigEndian { let ptr_out = &mut out as *mut u64 as *mut u8; unsafe { copy_nonoverlapping( - buf.as_ptr(), ptr_out.offset((8 - nbytes) as isize), nbytes); + buf.as_ptr(), + ptr_out.offset((8 - nbytes) as isize), + nbytes, + ); } out.to_be() } - #[cfg(byteorder_i128)] #[inline] fn read_uint128(buf: &[u8], nbytes: usize) -> u128 { assert!(1 <= nbytes && nbytes <= 16 && nbytes <= buf.len()); @@ -2033,30 +2010,32 @@ impl ByteOrder for BigEndian { let ptr_out = &mut out as *mut u128 as *mut u8; unsafe { copy_nonoverlapping( - buf.as_ptr(), ptr_out.offset((16 - nbytes) as isize), nbytes); + buf.as_ptr(), + ptr_out.offset((16 - nbytes) as isize), + nbytes, + ); } out.to_be() } #[inline] fn write_u16(buf: &mut [u8], n: u16) { - write_num_bytes!(u16, 2, n, buf, to_be); + unsafe_write_num_bytes!(u16, 2, n, buf, to_be); } #[inline] fn write_u32(buf: &mut [u8], n: u32) { - write_num_bytes!(u32, 4, n, buf, to_be); + unsafe_write_num_bytes!(u32, 4, n, buf, to_be); } #[inline] fn write_u64(buf: &mut [u8], n: u64) { - write_num_bytes!(u64, 8, n, buf, to_be); + unsafe_write_num_bytes!(u64, 8, n, buf, to_be); } - #[cfg(byteorder_i128)] #[inline] fn write_u128(buf: &mut [u8], n: u128) { - write_num_bytes!(u128, 16, n, buf, to_be); + unsafe_write_num_bytes!(u128, 16, n, buf, to_be); } #[inline] @@ -2068,11 +2047,11 @@ impl ByteOrder for BigEndian { copy_nonoverlapping( bytes.as_ptr().offset((8 - nbytes) as isize), buf.as_mut_ptr(), - nbytes); + nbytes, + ); } } - #[cfg(byteorder_i128)] #[inline] fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize) { assert!(pack_size128(n) <= nbytes && nbytes <= 16); @@ -2082,35 +2061,35 @@ impl ByteOrder for BigEndian { copy_nonoverlapping( bytes.as_ptr().offset((16 - nbytes) as isize), buf.as_mut_ptr(), - nbytes); + nbytes, + ); } } #[inline] fn read_u16_into(src: &[u8], dst: &mut [u16]) { - read_slice!(src, dst, 2, to_be); + unsafe_read_slice!(src, dst, 2, to_be); } #[inline] fn read_u32_into(src: &[u8], dst: &mut [u32]) { - read_slice!(src, dst, 4, to_be); + unsafe_read_slice!(src, dst, 4, to_be); } #[inline] fn read_u64_into(src: &[u8], dst: &mut [u64]) { - read_slice!(src, dst, 8, to_be); + unsafe_read_slice!(src, dst, 8, to_be); } - #[cfg(byteorder_i128)] #[inline] fn read_u128_into(src: &[u8], dst: &mut [u128]) { - read_slice!(src, dst, 16, to_be); + unsafe_read_slice!(src, dst, 16, to_be); } #[inline] fn write_u16_into(src: &[u16], dst: &mut [u8]) { if cfg!(target_endian = "big") { - write_slice_native!(src, dst, u16, 2); + unsafe_write_slice_native!(src, dst, u16); } else { write_slice!(src, dst, u16, 2, Self::write_u16); } @@ -2119,7 +2098,7 @@ impl ByteOrder for BigEndian { #[inline] fn write_u32_into(src: &[u32], dst: &mut [u8]) { if cfg!(target_endian = "big") { - write_slice_native!(src, dst, u32, 4); + unsafe_write_slice_native!(src, dst, u32); } else { write_slice!(src, dst, u32, 4, Self::write_u32); } @@ -2128,17 +2107,16 @@ impl ByteOrder for BigEndian { #[inline] fn write_u64_into(src: &[u64], dst: &mut [u8]) { if cfg!(target_endian = "big") { - write_slice_native!(src, dst, u64, 8); + unsafe_write_slice_native!(src, dst, u64); } else { write_slice!(src, dst, u64, 8, Self::write_u64); } } - #[cfg(byteorder_i128)] #[inline] fn write_u128_into(src: &[u128], dst: &mut [u8]) { if cfg!(target_endian = "big") { - write_slice_native!(src, dst, u128, 16); + unsafe_write_slice_native!(src, dst, u128); } else { write_slice!(src, dst, u128, 16, Self::write_u128); } @@ -2171,7 +2149,6 @@ impl ByteOrder for BigEndian { } } - #[cfg(byteorder_i128)] #[inline] fn from_slice_u128(numbers: &mut [u128]) { if cfg!(target_endian = "little") { @@ -2209,23 +2186,22 @@ impl ByteOrder for BigEndian { impl ByteOrder for LittleEndian { #[inline] fn read_u16(buf: &[u8]) -> u16 { - read_num_bytes!(u16, 2, buf, to_le) + u16::from_le_bytes(buf[..2].try_into().unwrap()) } #[inline] fn read_u32(buf: &[u8]) -> u32 { - read_num_bytes!(u32, 4, buf, to_le) + u32::from_le_bytes(buf[..4].try_into().unwrap()) } #[inline] fn read_u64(buf: &[u8]) -> u64 { - read_num_bytes!(u64, 8, buf, to_le) + u64::from_le_bytes(buf[..8].try_into().unwrap()) } - #[cfg(byteorder_i128)] #[inline] fn read_u128(buf: &[u8]) -> u128 { - read_num_bytes!(u128, 16, buf, to_le) + u128::from_le_bytes(buf[..16].try_into().unwrap()) } #[inline] @@ -2239,7 +2215,6 @@ impl ByteOrder for LittleEndian { out.to_le() } - #[cfg(byteorder_i128)] #[inline] fn read_uint128(buf: &[u8], nbytes: usize) -> u128 { assert!(1 <= nbytes && nbytes <= 16 && nbytes <= buf.len()); @@ -2253,23 +2228,22 @@ impl ByteOrder for LittleEndian { #[inline] fn write_u16(buf: &mut [u8], n: u16) { - write_num_bytes!(u16, 2, n, buf, to_le); + unsafe_write_num_bytes!(u16, 2, n, buf, to_le); } #[inline] fn write_u32(buf: &mut [u8], n: u32) { - write_num_bytes!(u32, 4, n, buf, to_le); + unsafe_write_num_bytes!(u32, 4, n, buf, to_le); } #[inline] fn write_u64(buf: &mut [u8], n: u64) { - write_num_bytes!(u64, 8, n, buf, to_le); + unsafe_write_num_bytes!(u64, 8, n, buf, to_le); } - #[cfg(byteorder_i128)] #[inline] fn write_u128(buf: &mut [u8], n: u128) { - write_num_bytes!(u128, 16, n, buf, to_le); + unsafe_write_num_bytes!(u128, 16, n, buf, to_le); } #[inline] @@ -2282,7 +2256,6 @@ impl ByteOrder for LittleEndian { } } - #[cfg(byteorder_i128)] #[inline] fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize) { assert!(pack_size128(n as u128) <= nbytes && nbytes <= 16); @@ -2295,29 +2268,28 @@ impl ByteOrder for LittleEndian { #[inline] fn read_u16_into(src: &[u8], dst: &mut [u16]) { - read_slice!(src, dst, 2, to_le); + unsafe_read_slice!(src, dst, 2, to_le); } #[inline] fn read_u32_into(src: &[u8], dst: &mut [u32]) { - read_slice!(src, dst, 4, to_le); + unsafe_read_slice!(src, dst, 4, to_le); } #[inline] fn read_u64_into(src: &[u8], dst: &mut [u64]) { - read_slice!(src, dst, 8, to_le); + unsafe_read_slice!(src, dst, 8, to_le); } - #[cfg(byteorder_i128)] #[inline] fn read_u128_into(src: &[u8], dst: &mut [u128]) { - read_slice!(src, dst, 16, to_le); + unsafe_read_slice!(src, dst, 16, to_le); } #[inline] fn write_u16_into(src: &[u16], dst: &mut [u8]) { if cfg!(target_endian = "little") { - write_slice_native!(src, dst, u16, 2); + unsafe_write_slice_native!(src, dst, u16); } else { write_slice!(src, dst, u16, 2, Self::write_u16); } @@ -2326,7 +2298,7 @@ impl ByteOrder for LittleEndian { #[inline] fn write_u32_into(src: &[u32], dst: &mut [u8]) { if cfg!(target_endian = "little") { - write_slice_native!(src, dst, u32, 4); + unsafe_write_slice_native!(src, dst, u32); } else { write_slice!(src, dst, u32, 4, Self::write_u32); } @@ -2335,17 +2307,16 @@ impl ByteOrder for LittleEndian { #[inline] fn write_u64_into(src: &[u64], dst: &mut [u8]) { if cfg!(target_endian = "little") { - write_slice_native!(src, dst, u64, 8); + unsafe_write_slice_native!(src, dst, u64); } else { write_slice!(src, dst, u64, 8, Self::write_u64); } } - #[cfg(byteorder_i128)] #[inline] fn write_u128_into(src: &[u128], dst: &mut [u8]) { if cfg!(target_endian = "little") { - write_slice_native!(src, dst, u128, 16); + unsafe_write_slice_native!(src, dst, u128); } else { write_slice!(src, dst, u128, 16, Self::write_u128); } @@ -2378,7 +2349,6 @@ impl ByteOrder for LittleEndian { } } - #[cfg(byteorder_i128)] #[inline] fn from_slice_u128(numbers: &mut [u128]) { if cfg!(target_endian = "big") { @@ -2415,15 +2385,8 @@ impl ByteOrder for LittleEndian { #[cfg(test)] mod test { - extern crate quickcheck; - extern crate rand; - - use self::quickcheck::{QuickCheck, StdGen, Testable}; - use self::rand::thread_rng; - #[cfg(byteorder_i128)] - use self::rand::Rng; - #[cfg(byteorder_i128)] - use self::quickcheck::{Arbitrary, Gen}; + use quickcheck::{Arbitrary, Gen, QuickCheck, StdGen, Testable}; + use rand::{thread_rng, Rng}; pub const U24_MAX: u32 = 16_777_215; pub const I24_MAX: i32 = 8_388_607; @@ -2434,7 +2397,9 @@ mod test { pub const I64_MAX: u64 = ::core::i64::MAX as u64; macro_rules! calc_max { - ($max:expr, $bytes:expr) => { calc_max!($max, $bytes, 8) }; + ($max:expr, $bytes:expr) => { + calc_max!($max, $bytes, 8) + }; ($max:expr, $bytes:expr, $maxbytes:expr) => { ($max - 1) >> (8 * ($maxbytes - $bytes)) }; @@ -2443,7 +2408,6 @@ mod test { #[derive(Clone, Debug)] pub struct Wi128(pub T); - #[cfg(byteorder_i128)] impl Wi128 { pub fn clone(&self) -> T { self.0.clone() @@ -2456,24 +2420,20 @@ mod test { } } - #[cfg(byteorder_i128)] impl Arbitrary for Wi128 { fn arbitrary(gen: &mut G) -> Wi128 { let max = calc_max!(::core::u128::MAX, gen.size(), 16); - let output = - (gen.gen::() as u128) | - ((gen.gen::() as u128) << 64); + let output = (gen.gen::() as u128) + | ((gen.gen::() as u128) << 64); Wi128(output & (max - 1)) } } - #[cfg(byteorder_i128)] impl Arbitrary for Wi128 { fn arbitrary(gen: &mut G) -> Wi128 { let max = calc_max!(::core::i128::MAX, gen.size(), 16); - let output = - (gen.gen::() as i128) | - ((gen.gen::() as i128) << 64); + let output = (gen.gen::() as i128) + | ((gen.gen::() as i128) << 64); Wi128(output & (max - 1)) } } @@ -2488,10 +2448,13 @@ mod test { macro_rules! qc_byte_order { ($name:ident, $ty_int:ty, $max:expr, - $bytes:expr, $read:ident, $write:ident) => ( + $bytes:expr, $read:ident, $write:ident) => { mod $name { - use {BigEndian, ByteOrder, NativeEndian, LittleEndian}; - #[allow(unused_imports)] use super::{ qc_sized, Wi128 }; + #[allow(unused_imports)] + use super::{qc_sized, Wi128}; + use crate::{ + BigEndian, ByteOrder, LittleEndian, NativeEndian, + }; #[test] fn big_endian() { @@ -2523,13 +2486,16 @@ mod test { qc_sized(prop as fn($ty_int) -> bool, $max); } } - ); + }; ($name:ident, $ty_int:ty, $max:expr, - $read:ident, $write:ident) => ( + $read:ident, $write:ident) => { mod $name { + #[allow(unused_imports)] + use super::{qc_sized, Wi128}; + use crate::{ + BigEndian, ByteOrder, LittleEndian, NativeEndian, + }; use core::mem::size_of; - use {BigEndian, ByteOrder, NativeEndian, LittleEndian}; - #[allow(unused_imports)] use super::{ qc_sized, Wi128 }; #[test] fn big_endian() { @@ -2564,159 +2530,484 @@ mod test { qc_sized(prop as fn($ty_int) -> bool, $max - 1); } } - ); + }; } - qc_byte_order!(prop_u16, u16, ::core::u16::MAX as u64, read_u16, write_u16); - qc_byte_order!(prop_i16, i16, ::core::i16::MAX as u64, read_i16, write_i16); - qc_byte_order!(prop_u24, u32, ::test::U24_MAX as u64, read_u24, write_u24); - qc_byte_order!(prop_i24, i32, ::test::I24_MAX as u64, read_i24, write_i24); - qc_byte_order!(prop_u32, u32, ::core::u32::MAX as u64, read_u32, write_u32); - qc_byte_order!(prop_i32, i32, ::core::i32::MAX as u64, read_i32, write_i32); - qc_byte_order!(prop_u48, u64, ::test::U48_MAX as u64, read_u48, write_u48); - qc_byte_order!(prop_i48, i64, ::test::I48_MAX as u64, read_i48, write_i48); - qc_byte_order!(prop_u64, u64, ::core::u64::MAX as u64, read_u64, write_u64); - qc_byte_order!(prop_i64, i64, ::core::i64::MAX as u64, read_i64, write_i64); - qc_byte_order!(prop_f32, f32, ::core::u64::MAX as u64, read_f32, write_f32); - qc_byte_order!(prop_f64, f64, ::core::i64::MAX as u64, read_f64, write_f64); + qc_byte_order!( + prop_u16, + u16, + ::core::u16::MAX as u64, + read_u16, + write_u16 + ); + qc_byte_order!( + prop_i16, + i16, + ::core::i16::MAX as u64, + read_i16, + write_i16 + ); + qc_byte_order!( + prop_u24, + u32, + crate::test::U24_MAX as u64, + read_u24, + write_u24 + ); + qc_byte_order!( + prop_i24, + i32, + crate::test::I24_MAX as u64, + read_i24, + write_i24 + ); + qc_byte_order!( + prop_u32, + u32, + ::core::u32::MAX as u64, + read_u32, + write_u32 + ); + qc_byte_order!( + prop_i32, + i32, + ::core::i32::MAX as u64, + read_i32, + write_i32 + ); + qc_byte_order!( + prop_u48, + u64, + crate::test::U48_MAX as u64, + read_u48, + write_u48 + ); + qc_byte_order!( + prop_i48, + i64, + crate::test::I48_MAX as u64, + read_i48, + write_i48 + ); + qc_byte_order!( + prop_u64, + u64, + ::core::u64::MAX as u64, + read_u64, + write_u64 + ); + qc_byte_order!( + prop_i64, + i64, + ::core::i64::MAX as u64, + read_i64, + write_i64 + ); + qc_byte_order!( + prop_f32, + f32, + ::core::u64::MAX as u64, + read_f32, + write_f32 + ); + qc_byte_order!( + prop_f64, + f64, + ::core::i64::MAX as u64, + read_f64, + write_f64 + ); - #[cfg(byteorder_i128)] qc_byte_order!(prop_u128, Wi128, 16 + 1, read_u128, write_u128); - #[cfg(byteorder_i128)] qc_byte_order!(prop_i128, Wi128, 16 + 1, read_i128, write_i128); - qc_byte_order!(prop_uint_1, - u64, calc_max!(super::U64_MAX, 1), 1, read_uint, write_uint); - qc_byte_order!(prop_uint_2, - u64, calc_max!(super::U64_MAX, 2), 2, read_uint, write_uint); - qc_byte_order!(prop_uint_3, - u64, calc_max!(super::U64_MAX, 3), 3, read_uint, write_uint); - qc_byte_order!(prop_uint_4, - u64, calc_max!(super::U64_MAX, 4), 4, read_uint, write_uint); - qc_byte_order!(prop_uint_5, - u64, calc_max!(super::U64_MAX, 5), 5, read_uint, write_uint); - qc_byte_order!(prop_uint_6, - u64, calc_max!(super::U64_MAX, 6), 6, read_uint, write_uint); - qc_byte_order!(prop_uint_7, - u64, calc_max!(super::U64_MAX, 7), 7, read_uint, write_uint); - qc_byte_order!(prop_uint_8, - u64, calc_max!(super::U64_MAX, 8), 8, read_uint, write_uint); + qc_byte_order!( + prop_uint_1, + u64, + calc_max!(super::U64_MAX, 1), + 1, + read_uint, + write_uint + ); + qc_byte_order!( + prop_uint_2, + u64, + calc_max!(super::U64_MAX, 2), + 2, + read_uint, + write_uint + ); + qc_byte_order!( + prop_uint_3, + u64, + calc_max!(super::U64_MAX, 3), + 3, + read_uint, + write_uint + ); + qc_byte_order!( + prop_uint_4, + u64, + calc_max!(super::U64_MAX, 4), + 4, + read_uint, + write_uint + ); + qc_byte_order!( + prop_uint_5, + u64, + calc_max!(super::U64_MAX, 5), + 5, + read_uint, + write_uint + ); + qc_byte_order!( + prop_uint_6, + u64, + calc_max!(super::U64_MAX, 6), + 6, + read_uint, + write_uint + ); + qc_byte_order!( + prop_uint_7, + u64, + calc_max!(super::U64_MAX, 7), + 7, + read_uint, + write_uint + ); + qc_byte_order!( + prop_uint_8, + u64, + calc_max!(super::U64_MAX, 8), + 8, + read_uint, + write_uint + ); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_uint128_1, - Wi128, 1, 1, read_uint128, write_uint128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_uint128_2, - Wi128, 2, 2, read_uint128, write_uint128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_uint128_3, - Wi128, 3, 3, read_uint128, write_uint128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_uint128_4, - Wi128, 4, 4, read_uint128, write_uint128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_uint128_5, - Wi128, 5, 5, read_uint128, write_uint128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_uint128_6, - Wi128, 6, 6, read_uint128, write_uint128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_uint128_7, - Wi128, 7, 7, read_uint128, write_uint128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_uint128_8, - Wi128, 8, 8, read_uint128, write_uint128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_uint128_9, - Wi128, 9, 9, read_uint128, write_uint128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_uint128_10, - Wi128, 10, 10, read_uint128, write_uint128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_uint128_11, - Wi128, 11, 11, read_uint128, write_uint128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_uint128_12, - Wi128, 12, 12, read_uint128, write_uint128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_uint128_13, - Wi128, 13, 13, read_uint128, write_uint128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_uint128_14, - Wi128, 14, 14, read_uint128, write_uint128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_uint128_15, - Wi128, 15, 15, read_uint128, write_uint128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_uint128_16, - Wi128, 16, 16, read_uint128, write_uint128); + qc_byte_order!( + prop_uint128_1, + Wi128, + 1, + 1, + read_uint128, + write_uint128 + ); + qc_byte_order!( + prop_uint128_2, + Wi128, + 2, + 2, + read_uint128, + write_uint128 + ); + qc_byte_order!( + prop_uint128_3, + Wi128, + 3, + 3, + read_uint128, + write_uint128 + ); + qc_byte_order!( + prop_uint128_4, + Wi128, + 4, + 4, + read_uint128, + write_uint128 + ); + qc_byte_order!( + prop_uint128_5, + Wi128, + 5, + 5, + read_uint128, + write_uint128 + ); + qc_byte_order!( + prop_uint128_6, + Wi128, + 6, + 6, + read_uint128, + write_uint128 + ); + qc_byte_order!( + prop_uint128_7, + Wi128, + 7, + 7, + read_uint128, + write_uint128 + ); + qc_byte_order!( + prop_uint128_8, + Wi128, + 8, + 8, + read_uint128, + write_uint128 + ); + qc_byte_order!( + prop_uint128_9, + Wi128, + 9, + 9, + read_uint128, + write_uint128 + ); + qc_byte_order!( + prop_uint128_10, + Wi128, + 10, + 10, + read_uint128, + write_uint128 + ); + qc_byte_order!( + prop_uint128_11, + Wi128, + 11, + 11, + read_uint128, + write_uint128 + ); + qc_byte_order!( + prop_uint128_12, + Wi128, + 12, + 12, + read_uint128, + write_uint128 + ); + qc_byte_order!( + prop_uint128_13, + Wi128, + 13, + 13, + read_uint128, + write_uint128 + ); + qc_byte_order!( + prop_uint128_14, + Wi128, + 14, + 14, + read_uint128, + write_uint128 + ); + qc_byte_order!( + prop_uint128_15, + Wi128, + 15, + 15, + read_uint128, + write_uint128 + ); + qc_byte_order!( + prop_uint128_16, + Wi128, + 16, + 16, + read_uint128, + write_uint128 + ); - qc_byte_order!(prop_int_1, - i64, calc_max!(super::I64_MAX, 1), 1, read_int, write_int); - qc_byte_order!(prop_int_2, - i64, calc_max!(super::I64_MAX, 2), 2, read_int, write_int); - qc_byte_order!(prop_int_3, - i64, calc_max!(super::I64_MAX, 3), 3, read_int, write_int); - qc_byte_order!(prop_int_4, - i64, calc_max!(super::I64_MAX, 4), 4, read_int, write_int); - qc_byte_order!(prop_int_5, - i64, calc_max!(super::I64_MAX, 5), 5, read_int, write_int); - qc_byte_order!(prop_int_6, - i64, calc_max!(super::I64_MAX, 6), 6, read_int, write_int); - qc_byte_order!(prop_int_7, - i64, calc_max!(super::I64_MAX, 7), 7, read_int, write_int); - qc_byte_order!(prop_int_8, - i64, calc_max!(super::I64_MAX, 8), 8, read_int, write_int); - - #[cfg(byteorder_i128)] - qc_byte_order!(prop_int128_1, - Wi128, 1, 1, read_int128, write_int128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_int128_2, - Wi128, 2, 2, read_int128, write_int128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_int128_3, - Wi128, 3, 3, read_int128, write_int128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_int128_4, - Wi128, 4, 4, read_int128, write_int128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_int128_5, - Wi128, 5, 5, read_int128, write_int128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_int128_6, - Wi128, 6, 6, read_int128, write_int128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_int128_7, - Wi128, 7, 7, read_int128, write_int128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_int128_8, - Wi128, 8, 8, read_int128, write_int128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_int128_9, - Wi128, 9, 9, read_int128, write_int128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_int128_10, - Wi128, 10, 10, read_int128, write_int128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_int128_11, - Wi128, 11, 11, read_int128, write_int128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_int128_12, - Wi128, 12, 12, read_int128, write_int128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_int128_13, - Wi128, 13, 13, read_int128, write_int128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_int128_14, - Wi128, 14, 14, read_int128, write_int128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_int128_15, - Wi128, 15, 15, read_int128, write_int128); - #[cfg(byteorder_i128)] - qc_byte_order!(prop_int128_16, - Wi128, 16, 16, read_int128, write_int128); + qc_byte_order!( + prop_int_1, + i64, + calc_max!(super::I64_MAX, 1), + 1, + read_int, + write_int + ); + qc_byte_order!( + prop_int_2, + i64, + calc_max!(super::I64_MAX, 2), + 2, + read_int, + write_int + ); + qc_byte_order!( + prop_int_3, + i64, + calc_max!(super::I64_MAX, 3), + 3, + read_int, + write_int + ); + qc_byte_order!( + prop_int_4, + i64, + calc_max!(super::I64_MAX, 4), + 4, + read_int, + write_int + ); + qc_byte_order!( + prop_int_5, + i64, + calc_max!(super::I64_MAX, 5), + 5, + read_int, + write_int + ); + qc_byte_order!( + prop_int_6, + i64, + calc_max!(super::I64_MAX, 6), + 6, + read_int, + write_int + ); + qc_byte_order!( + prop_int_7, + i64, + calc_max!(super::I64_MAX, 7), + 7, + read_int, + write_int + ); + qc_byte_order!( + prop_int_8, + i64, + calc_max!(super::I64_MAX, 8), + 8, + read_int, + write_int + ); + qc_byte_order!( + prop_int128_1, + Wi128, + 1, + 1, + read_int128, + write_int128 + ); + qc_byte_order!( + prop_int128_2, + Wi128, + 2, + 2, + read_int128, + write_int128 + ); + qc_byte_order!( + prop_int128_3, + Wi128, + 3, + 3, + read_int128, + write_int128 + ); + qc_byte_order!( + prop_int128_4, + Wi128, + 4, + 4, + read_int128, + write_int128 + ); + qc_byte_order!( + prop_int128_5, + Wi128, + 5, + 5, + read_int128, + write_int128 + ); + qc_byte_order!( + prop_int128_6, + Wi128, + 6, + 6, + read_int128, + write_int128 + ); + qc_byte_order!( + prop_int128_7, + Wi128, + 7, + 7, + read_int128, + write_int128 + ); + qc_byte_order!( + prop_int128_8, + Wi128, + 8, + 8, + read_int128, + write_int128 + ); + qc_byte_order!( + prop_int128_9, + Wi128, + 9, + 9, + read_int128, + write_int128 + ); + qc_byte_order!( + prop_int128_10, + Wi128, + 10, + 10, + read_int128, + write_int128 + ); + qc_byte_order!( + prop_int128_11, + Wi128, + 11, + 11, + read_int128, + write_int128 + ); + qc_byte_order!( + prop_int128_12, + Wi128, + 12, + 12, + read_int128, + write_int128 + ); + qc_byte_order!( + prop_int128_13, + Wi128, + 13, + 13, + read_int128, + write_int128 + ); + qc_byte_order!( + prop_int128_14, + Wi128, + 14, + 14, + read_int128, + write_int128 + ); + qc_byte_order!( + prop_int128_15, + Wi128, + 15, + 15, + read_int128, + write_int128 + ); + qc_byte_order!( + prop_int128_16, + Wi128, + 16, + 16, + read_int128, + write_int128 + ); // Test that all of the byte conversion functions panic when given a // buffer that is too small. @@ -2725,9 +3016,11 @@ mod test { // with a buffer overflow. macro_rules! too_small { ($name:ident, $maximally_small:expr, $zero:expr, - $read:ident, $write:ident) => ( + $read:ident, $write:ident) => { mod $name { - use {BigEndian, ByteOrder, NativeEndian, LittleEndian}; + use crate::{ + BigEndian, ByteOrder, LittleEndian, NativeEndian, + }; #[test] #[should_panic] @@ -2771,10 +3064,12 @@ mod test { NativeEndian::$write(&mut buf, $zero); } } - ); - ($name:ident, $maximally_small:expr, $read:ident) => ( + }; + ($name:ident, $maximally_small:expr, $read:ident) => { mod $name { - use {BigEndian, ByteOrder, NativeEndian, LittleEndian}; + use crate::{ + BigEndian, ByteOrder, LittleEndian, NativeEndian, + }; #[test] #[should_panic] @@ -2797,7 +3092,7 @@ mod test { NativeEndian::$read(&buf, $maximally_small + 1); } } - ); + }; } too_small!(small_u16, 1, 0, read_u16, write_u16); @@ -2808,9 +3103,7 @@ mod test { too_small!(small_i64, 7, 0, read_i64, write_i64); too_small!(small_f32, 3, 0.0, read_f32, write_f32); too_small!(small_f64, 7, 0.0, read_f64, write_f64); - #[cfg(byteorder_i128)] too_small!(small_u128, 15, 0, read_u128, write_u128); - #[cfg(byteorder_i128)] too_small!(small_i128, 15, 0, read_i128, write_i128); too_small!(small_uint_1, 1, read_uint); @@ -2821,35 +3114,20 @@ mod test { too_small!(small_uint_6, 6, read_uint); too_small!(small_uint_7, 7, read_uint); - #[cfg(byteorder_i128)] too_small!(small_uint128_1, 1, read_uint128); - #[cfg(byteorder_i128)] too_small!(small_uint128_2, 2, read_uint128); - #[cfg(byteorder_i128)] too_small!(small_uint128_3, 3, read_uint128); - #[cfg(byteorder_i128)] too_small!(small_uint128_4, 4, read_uint128); - #[cfg(byteorder_i128)] too_small!(small_uint128_5, 5, read_uint128); - #[cfg(byteorder_i128)] too_small!(small_uint128_6, 6, read_uint128); - #[cfg(byteorder_i128)] too_small!(small_uint128_7, 7, read_uint128); - #[cfg(byteorder_i128)] too_small!(small_uint128_8, 8, read_uint128); - #[cfg(byteorder_i128)] too_small!(small_uint128_9, 9, read_uint128); - #[cfg(byteorder_i128)] too_small!(small_uint128_10, 10, read_uint128); - #[cfg(byteorder_i128)] too_small!(small_uint128_11, 11, read_uint128); - #[cfg(byteorder_i128)] too_small!(small_uint128_12, 12, read_uint128); - #[cfg(byteorder_i128)] too_small!(small_uint128_13, 13, read_uint128); - #[cfg(byteorder_i128)] too_small!(small_uint128_14, 14, read_uint128); - #[cfg(byteorder_i128)] too_small!(small_uint128_15, 15, read_uint128); too_small!(small_int_1, 1, read_int); @@ -2860,35 +3138,20 @@ mod test { too_small!(small_int_6, 6, read_int); too_small!(small_int_7, 7, read_int); - #[cfg(byteorder_i128)] too_small!(small_int128_1, 1, read_int128); - #[cfg(byteorder_i128)] too_small!(small_int128_2, 2, read_int128); - #[cfg(byteorder_i128)] too_small!(small_int128_3, 3, read_int128); - #[cfg(byteorder_i128)] too_small!(small_int128_4, 4, read_int128); - #[cfg(byteorder_i128)] too_small!(small_int128_5, 5, read_int128); - #[cfg(byteorder_i128)] too_small!(small_int128_6, 6, read_int128); - #[cfg(byteorder_i128)] too_small!(small_int128_7, 7, read_int128); - #[cfg(byteorder_i128)] too_small!(small_int128_8, 8, read_int128); - #[cfg(byteorder_i128)] too_small!(small_int128_9, 9, read_int128); - #[cfg(byteorder_i128)] too_small!(small_int128_10, 10, read_int128); - #[cfg(byteorder_i128)] too_small!(small_int128_11, 11, read_int128); - #[cfg(byteorder_i128)] too_small!(small_int128_12, 12, read_int128); - #[cfg(byteorder_i128)] too_small!(small_int128_13, 13, read_int128); - #[cfg(byteorder_i128)] too_small!(small_int128_14, 14, read_int128); - #[cfg(byteorder_i128)] too_small!(small_int128_15, 15, read_int128); // Test that reading/writing slices enforces the correct lengths. @@ -2896,7 +3159,9 @@ mod test { ($name:ident, $read:ident, $write:ident, $num_bytes:expr, $numbers:expr) => { mod $name { - use {ByteOrder, BigEndian, NativeEndian, LittleEndian}; + use crate::{ + BigEndian, ByteOrder, LittleEndian, NativeEndian, + }; #[test] #[should_panic] @@ -2946,55 +3211,172 @@ mod test { NativeEndian::$write(&numbers, &mut bytes); } } - } + }; } slice_lengths!( - slice_len_too_small_u16, read_u16_into, write_u16_into, 3, [0, 0]); + slice_len_too_small_u16, + read_u16_into, + write_u16_into, + 3, + [0, 0] + ); slice_lengths!( - slice_len_too_big_u16, read_u16_into, write_u16_into, 5, [0, 0]); + slice_len_too_big_u16, + read_u16_into, + write_u16_into, + 5, + [0, 0] + ); slice_lengths!( - slice_len_too_small_i16, read_i16_into, write_i16_into, 3, [0, 0]); + slice_len_too_small_i16, + read_i16_into, + write_i16_into, + 3, + [0, 0] + ); slice_lengths!( - slice_len_too_big_i16, read_i16_into, write_i16_into, 5, [0, 0]); + slice_len_too_big_i16, + read_i16_into, + write_i16_into, + 5, + [0, 0] + ); slice_lengths!( - slice_len_too_small_u32, read_u32_into, write_u32_into, 7, [0, 0]); + slice_len_too_small_u32, + read_u32_into, + write_u32_into, + 7, + [0, 0] + ); slice_lengths!( - slice_len_too_big_u32, read_u32_into, write_u32_into, 9, [0, 0]); + slice_len_too_big_u32, + read_u32_into, + write_u32_into, + 9, + [0, 0] + ); slice_lengths!( - slice_len_too_small_i32, read_i32_into, write_i32_into, 7, [0, 0]); + slice_len_too_small_i32, + read_i32_into, + write_i32_into, + 7, + [0, 0] + ); slice_lengths!( - slice_len_too_big_i32, read_i32_into, write_i32_into, 9, [0, 0]); + slice_len_too_big_i32, + read_i32_into, + write_i32_into, + 9, + [0, 0] + ); slice_lengths!( - slice_len_too_small_u64, read_u64_into, write_u64_into, 15, [0, 0]); + slice_len_too_small_u64, + read_u64_into, + write_u64_into, + 15, + [0, 0] + ); slice_lengths!( - slice_len_too_big_u64, read_u64_into, write_u64_into, 17, [0, 0]); + slice_len_too_big_u64, + read_u64_into, + write_u64_into, + 17, + [0, 0] + ); slice_lengths!( - slice_len_too_small_i64, read_i64_into, write_i64_into, 15, [0, 0]); + slice_len_too_small_i64, + read_i64_into, + write_i64_into, + 15, + [0, 0] + ); slice_lengths!( - slice_len_too_big_i64, read_i64_into, write_i64_into, 17, [0, 0]); + slice_len_too_big_i64, + read_i64_into, + write_i64_into, + 17, + [0, 0] + ); - #[cfg(byteorder_i128)] slice_lengths!( - slice_len_too_small_u128, read_u128_into, write_u128_into, 31, [0, 0]); - #[cfg(byteorder_i128)] + slice_len_too_small_u128, + read_u128_into, + write_u128_into, + 31, + [0, 0] + ); slice_lengths!( - slice_len_too_big_u128, read_u128_into, write_u128_into, 33, [0, 0]); - #[cfg(byteorder_i128)] + slice_len_too_big_u128, + read_u128_into, + write_u128_into, + 33, + [0, 0] + ); slice_lengths!( - slice_len_too_small_i128, read_i128_into, write_i128_into, 31, [0, 0]); - #[cfg(byteorder_i128)] + slice_len_too_small_i128, + read_i128_into, + write_i128_into, + 31, + [0, 0] + ); slice_lengths!( - slice_len_too_big_i128, read_i128_into, write_i128_into, 33, [0, 0]); + slice_len_too_big_i128, + read_i128_into, + write_i128_into, + 33, + [0, 0] + ); #[test] fn uint_bigger_buffer() { - use {ByteOrder, LittleEndian}; + use crate::{ByteOrder, LittleEndian}; let n = LittleEndian::read_uint(&[1, 2, 3, 4, 5, 6, 7, 8], 5); assert_eq!(n, 0x05_0403_0201); } + + #[test] + fn regression173_array_impl() { + use crate::{BigEndian, ByteOrder, LittleEndian}; + + let xs = [0; 100]; + + let x = BigEndian::read_u16(&xs); + assert_eq!(x, 0); + let x = BigEndian::read_u32(&xs); + assert_eq!(x, 0); + let x = BigEndian::read_u64(&xs); + assert_eq!(x, 0); + let x = BigEndian::read_u128(&xs); + assert_eq!(x, 0); + let x = BigEndian::read_i16(&xs); + assert_eq!(x, 0); + let x = BigEndian::read_i32(&xs); + assert_eq!(x, 0); + let x = BigEndian::read_i64(&xs); + assert_eq!(x, 0); + let x = BigEndian::read_i128(&xs); + assert_eq!(x, 0); + + let x = LittleEndian::read_u16(&xs); + assert_eq!(x, 0); + let x = LittleEndian::read_u32(&xs); + assert_eq!(x, 0); + let x = LittleEndian::read_u64(&xs); + assert_eq!(x, 0); + let x = LittleEndian::read_u128(&xs); + assert_eq!(x, 0); + let x = LittleEndian::read_i16(&xs); + assert_eq!(x, 0); + let x = LittleEndian::read_i32(&xs); + assert_eq!(x, 0); + let x = LittleEndian::read_i64(&xs); + assert_eq!(x, 0); + let x = LittleEndian::read_i128(&xs); + assert_eq!(x, 0); + } } #[cfg(test)] @@ -3007,7 +3389,6 @@ mod stdtests { use self::rand::thread_rng; fn qc_unsized(f: A) { - QuickCheck::new() .gen(StdGen::new(thread_rng(), 16)) .tests(1_00) @@ -3016,19 +3397,22 @@ mod stdtests { } macro_rules! calc_max { - ($max:expr, $bytes:expr) => { ($max - 1) >> (8 * (8 - $bytes)) }; + ($max:expr, $bytes:expr) => { + ($max - 1) >> (8 * (8 - $bytes)) + }; } macro_rules! qc_bytes_ext { ($name:ident, $ty_int:ty, $max:expr, - $bytes:expr, $read:ident, $write:ident) => ( + $bytes:expr, $read:ident, $write:ident) => { mod $name { - use std::io::Cursor; - use { - ReadBytesExt, WriteBytesExt, - BigEndian, NativeEndian, LittleEndian, + #[allow(unused_imports)] + use crate::test::{qc_sized, Wi128}; + use crate::{ + BigEndian, LittleEndian, NativeEndian, ReadBytesExt, + WriteBytesExt, }; - #[allow(unused_imports)] use test::{qc_sized, Wi128}; + use std::io::Cursor; #[test] fn big_endian() { @@ -3069,15 +3453,16 @@ mod stdtests { qc_sized(prop as fn($ty_int) -> bool, $max); } } - ); - ($name:ident, $ty_int:ty, $max:expr, $read:ident, $write:ident) => ( + }; + ($name:ident, $ty_int:ty, $max:expr, $read:ident, $write:ident) => { mod $name { - use std::io::Cursor; - use { - ReadBytesExt, WriteBytesExt, - BigEndian, NativeEndian, LittleEndian, + #[allow(unused_imports)] + use crate::test::{qc_sized, Wi128}; + use crate::{ + BigEndian, LittleEndian, NativeEndian, ReadBytesExt, + WriteBytesExt, }; - #[allow(unused_imports)] use test::{qc_sized, Wi128}; + use std::io::Cursor; #[test] fn big_endian() { @@ -3112,188 +3497,484 @@ mod stdtests { qc_sized(prop as fn($ty_int) -> bool, $max - 1); } } - ); + }; } - qc_bytes_ext!(prop_ext_u16, - u16, ::std::u16::MAX as u64, read_u16, write_u16); - qc_bytes_ext!(prop_ext_i16, - i16, ::std::i16::MAX as u64, read_i16, write_i16); - qc_bytes_ext!(prop_ext_u32, - u32, ::std::u32::MAX as u64, read_u32, write_u32); - qc_bytes_ext!(prop_ext_i32, - i32, ::std::i32::MAX as u64, read_i32, write_i32); - qc_bytes_ext!(prop_ext_u64, - u64, ::std::u64::MAX as u64, read_u64, write_u64); - qc_bytes_ext!(prop_ext_i64, - i64, ::std::i64::MAX as u64, read_i64, write_i64); - qc_bytes_ext!(prop_ext_f32, - f32, ::std::u64::MAX as u64, read_f32, write_f32); - qc_bytes_ext!(prop_ext_f64, - f64, ::std::i64::MAX as u64, read_f64, write_f64); + qc_bytes_ext!( + prop_ext_u16, + u16, + ::std::u16::MAX as u64, + read_u16, + write_u16 + ); + qc_bytes_ext!( + prop_ext_i16, + i16, + ::std::i16::MAX as u64, + read_i16, + write_i16 + ); + qc_bytes_ext!( + prop_ext_u32, + u32, + ::std::u32::MAX as u64, + read_u32, + write_u32 + ); + qc_bytes_ext!( + prop_ext_i32, + i32, + ::std::i32::MAX as u64, + read_i32, + write_i32 + ); + qc_bytes_ext!( + prop_ext_u64, + u64, + ::std::u64::MAX as u64, + read_u64, + write_u64 + ); + qc_bytes_ext!( + prop_ext_i64, + i64, + ::std::i64::MAX as u64, + read_i64, + write_i64 + ); + qc_bytes_ext!( + prop_ext_f32, + f32, + ::std::u64::MAX as u64, + read_f32, + write_f32 + ); + qc_bytes_ext!( + prop_ext_f64, + f64, + ::std::i64::MAX as u64, + read_f64, + write_f64 + ); - #[cfg(byteorder_i128)] qc_bytes_ext!(prop_ext_u128, Wi128, 16 + 1, read_u128, write_u128); - #[cfg(byteorder_i128)] qc_bytes_ext!(prop_ext_i128, Wi128, 16 + 1, read_i128, write_i128); - qc_bytes_ext!(prop_ext_uint_1, - u64, calc_max!(::test::U64_MAX, 1), 1, read_uint, write_u64); - qc_bytes_ext!(prop_ext_uint_2, - u64, calc_max!(::test::U64_MAX, 2), 2, read_uint, write_u64); - qc_bytes_ext!(prop_ext_uint_3, - u64, calc_max!(::test::U64_MAX, 3), 3, read_uint, write_u64); - qc_bytes_ext!(prop_ext_uint_4, - u64, calc_max!(::test::U64_MAX, 4), 4, read_uint, write_u64); - qc_bytes_ext!(prop_ext_uint_5, - u64, calc_max!(::test::U64_MAX, 5), 5, read_uint, write_u64); - qc_bytes_ext!(prop_ext_uint_6, - u64, calc_max!(::test::U64_MAX, 6), 6, read_uint, write_u64); - qc_bytes_ext!(prop_ext_uint_7, - u64, calc_max!(::test::U64_MAX, 7), 7, read_uint, write_u64); - qc_bytes_ext!(prop_ext_uint_8, - u64, calc_max!(::test::U64_MAX, 8), 8, read_uint, write_u64); + qc_bytes_ext!( + prop_ext_uint_1, + u64, + calc_max!(crate::test::U64_MAX, 1), + 1, + read_uint, + write_u64 + ); + qc_bytes_ext!( + prop_ext_uint_2, + u64, + calc_max!(crate::test::U64_MAX, 2), + 2, + read_uint, + write_u64 + ); + qc_bytes_ext!( + prop_ext_uint_3, + u64, + calc_max!(crate::test::U64_MAX, 3), + 3, + read_uint, + write_u64 + ); + qc_bytes_ext!( + prop_ext_uint_4, + u64, + calc_max!(crate::test::U64_MAX, 4), + 4, + read_uint, + write_u64 + ); + qc_bytes_ext!( + prop_ext_uint_5, + u64, + calc_max!(crate::test::U64_MAX, 5), + 5, + read_uint, + write_u64 + ); + qc_bytes_ext!( + prop_ext_uint_6, + u64, + calc_max!(crate::test::U64_MAX, 6), + 6, + read_uint, + write_u64 + ); + qc_bytes_ext!( + prop_ext_uint_7, + u64, + calc_max!(crate::test::U64_MAX, 7), + 7, + read_uint, + write_u64 + ); + qc_bytes_ext!( + prop_ext_uint_8, + u64, + calc_max!(crate::test::U64_MAX, 8), + 8, + read_uint, + write_u64 + ); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_uint128_1, - Wi128, 1, 1, read_uint128, write_u128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_uint128_2, - Wi128, 2, 2, read_uint128, write_u128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_uint128_3, - Wi128, 3, 3, read_uint128, write_u128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_uint128_4, - Wi128, 4, 4, read_uint128, write_u128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_uint128_5, - Wi128, 5, 5, read_uint128, write_u128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_uint128_6, - Wi128, 6, 6, read_uint128, write_u128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_uint128_7, - Wi128, 7, 7, read_uint128, write_u128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_uint128_8, - Wi128, 8, 8, read_uint128, write_u128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_uint128_9, - Wi128, 9, 9, read_uint128, write_u128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_uint128_10, - Wi128, 10, 10, read_uint128, write_u128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_uint128_11, - Wi128, 11, 11, read_uint128, write_u128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_uint128_12, - Wi128, 12, 12, read_uint128, write_u128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_uint128_13, - Wi128, 13, 13, read_uint128, write_u128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_uint128_14, - Wi128, 14, 14, read_uint128, write_u128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_uint128_15, - Wi128, 15, 15, read_uint128, write_u128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_uint128_16, - Wi128, 16, 16, read_uint128, write_u128); + qc_bytes_ext!( + prop_ext_uint128_1, + Wi128, + 1, + 1, + read_uint128, + write_u128 + ); + qc_bytes_ext!( + prop_ext_uint128_2, + Wi128, + 2, + 2, + read_uint128, + write_u128 + ); + qc_bytes_ext!( + prop_ext_uint128_3, + Wi128, + 3, + 3, + read_uint128, + write_u128 + ); + qc_bytes_ext!( + prop_ext_uint128_4, + Wi128, + 4, + 4, + read_uint128, + write_u128 + ); + qc_bytes_ext!( + prop_ext_uint128_5, + Wi128, + 5, + 5, + read_uint128, + write_u128 + ); + qc_bytes_ext!( + prop_ext_uint128_6, + Wi128, + 6, + 6, + read_uint128, + write_u128 + ); + qc_bytes_ext!( + prop_ext_uint128_7, + Wi128, + 7, + 7, + read_uint128, + write_u128 + ); + qc_bytes_ext!( + prop_ext_uint128_8, + Wi128, + 8, + 8, + read_uint128, + write_u128 + ); + qc_bytes_ext!( + prop_ext_uint128_9, + Wi128, + 9, + 9, + read_uint128, + write_u128 + ); + qc_bytes_ext!( + prop_ext_uint128_10, + Wi128, + 10, + 10, + read_uint128, + write_u128 + ); + qc_bytes_ext!( + prop_ext_uint128_11, + Wi128, + 11, + 11, + read_uint128, + write_u128 + ); + qc_bytes_ext!( + prop_ext_uint128_12, + Wi128, + 12, + 12, + read_uint128, + write_u128 + ); + qc_bytes_ext!( + prop_ext_uint128_13, + Wi128, + 13, + 13, + read_uint128, + write_u128 + ); + qc_bytes_ext!( + prop_ext_uint128_14, + Wi128, + 14, + 14, + read_uint128, + write_u128 + ); + qc_bytes_ext!( + prop_ext_uint128_15, + Wi128, + 15, + 15, + read_uint128, + write_u128 + ); + qc_bytes_ext!( + prop_ext_uint128_16, + Wi128, + 16, + 16, + read_uint128, + write_u128 + ); - qc_bytes_ext!(prop_ext_int_1, - i64, calc_max!(::test::I64_MAX, 1), 1, read_int, write_i64); - qc_bytes_ext!(prop_ext_int_2, - i64, calc_max!(::test::I64_MAX, 2), 2, read_int, write_i64); - qc_bytes_ext!(prop_ext_int_3, - i64, calc_max!(::test::I64_MAX, 3), 3, read_int, write_i64); - qc_bytes_ext!(prop_ext_int_4, - i64, calc_max!(::test::I64_MAX, 4), 4, read_int, write_i64); - qc_bytes_ext!(prop_ext_int_5, - i64, calc_max!(::test::I64_MAX, 5), 5, read_int, write_i64); - qc_bytes_ext!(prop_ext_int_6, - i64, calc_max!(::test::I64_MAX, 6), 6, read_int, write_i64); - qc_bytes_ext!(prop_ext_int_7, - i64, calc_max!(::test::I64_MAX, 1), 7, read_int, write_i64); - qc_bytes_ext!(prop_ext_int_8, - i64, calc_max!(::test::I64_MAX, 8), 8, read_int, write_i64); + qc_bytes_ext!( + prop_ext_int_1, + i64, + calc_max!(crate::test::I64_MAX, 1), + 1, + read_int, + write_i64 + ); + qc_bytes_ext!( + prop_ext_int_2, + i64, + calc_max!(crate::test::I64_MAX, 2), + 2, + read_int, + write_i64 + ); + qc_bytes_ext!( + prop_ext_int_3, + i64, + calc_max!(crate::test::I64_MAX, 3), + 3, + read_int, + write_i64 + ); + qc_bytes_ext!( + prop_ext_int_4, + i64, + calc_max!(crate::test::I64_MAX, 4), + 4, + read_int, + write_i64 + ); + qc_bytes_ext!( + prop_ext_int_5, + i64, + calc_max!(crate::test::I64_MAX, 5), + 5, + read_int, + write_i64 + ); + qc_bytes_ext!( + prop_ext_int_6, + i64, + calc_max!(crate::test::I64_MAX, 6), + 6, + read_int, + write_i64 + ); + qc_bytes_ext!( + prop_ext_int_7, + i64, + calc_max!(crate::test::I64_MAX, 1), + 7, + read_int, + write_i64 + ); + qc_bytes_ext!( + prop_ext_int_8, + i64, + calc_max!(crate::test::I64_MAX, 8), + 8, + read_int, + write_i64 + ); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_int128_1, - Wi128, 1, 1, read_int128, write_i128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_int128_2, - Wi128, 2, 2, read_int128, write_i128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_int128_3, - Wi128, 3, 3, read_int128, write_i128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_int128_4, - Wi128, 4, 4, read_int128, write_i128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_int128_5, - Wi128, 5, 5, read_int128, write_i128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_int128_6, - Wi128, 6, 6, read_int128, write_i128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_int128_7, - Wi128, 7, 7, read_int128, write_i128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_int128_8, - Wi128, 8, 8, read_int128, write_i128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_int128_9, - Wi128, 9, 9, read_int128, write_i128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_int128_10, - Wi128, 10, 10, read_int128, write_i128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_int128_11, - Wi128, 11, 11, read_int128, write_i128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_int128_12, - Wi128, 12, 12, read_int128, write_i128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_int128_13, - Wi128, 13, 13, read_int128, write_i128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_int128_14, - Wi128, 14, 14, read_int128, write_i128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_int128_15, - Wi128, 15, 15, read_int128, write_i128); - #[cfg(byteorder_i128)] - qc_bytes_ext!(prop_ext_int128_16, - Wi128, 16, 16, read_int128, write_i128); + qc_bytes_ext!( + prop_ext_int128_1, + Wi128, + 1, + 1, + read_int128, + write_i128 + ); + qc_bytes_ext!( + prop_ext_int128_2, + Wi128, + 2, + 2, + read_int128, + write_i128 + ); + qc_bytes_ext!( + prop_ext_int128_3, + Wi128, + 3, + 3, + read_int128, + write_i128 + ); + qc_bytes_ext!( + prop_ext_int128_4, + Wi128, + 4, + 4, + read_int128, + write_i128 + ); + qc_bytes_ext!( + prop_ext_int128_5, + Wi128, + 5, + 5, + read_int128, + write_i128 + ); + qc_bytes_ext!( + prop_ext_int128_6, + Wi128, + 6, + 6, + read_int128, + write_i128 + ); + qc_bytes_ext!( + prop_ext_int128_7, + Wi128, + 7, + 7, + read_int128, + write_i128 + ); + qc_bytes_ext!( + prop_ext_int128_8, + Wi128, + 8, + 8, + read_int128, + write_i128 + ); + qc_bytes_ext!( + prop_ext_int128_9, + Wi128, + 9, + 9, + read_int128, + write_i128 + ); + qc_bytes_ext!( + prop_ext_int128_10, + Wi128, + 10, + 10, + read_int128, + write_i128 + ); + qc_bytes_ext!( + prop_ext_int128_11, + Wi128, + 11, + 11, + read_int128, + write_i128 + ); + qc_bytes_ext!( + prop_ext_int128_12, + Wi128, + 12, + 12, + read_int128, + write_i128 + ); + qc_bytes_ext!( + prop_ext_int128_13, + Wi128, + 13, + 13, + read_int128, + write_i128 + ); + qc_bytes_ext!( + prop_ext_int128_14, + Wi128, + 14, + 14, + read_int128, + write_i128 + ); + qc_bytes_ext!( + prop_ext_int128_15, + Wi128, + 15, + 15, + read_int128, + write_i128 + ); + qc_bytes_ext!( + prop_ext_int128_16, + Wi128, + 16, + 16, + read_int128, + write_i128 + ); // Test slice serialization/deserialization. macro_rules! qc_slice { ($name:ident, $ty_int:ty, $read:ident, $write:ident, $zero:expr) => { mod $name { - use core::mem::size_of; - use {ByteOrder, BigEndian, NativeEndian, LittleEndian}; use super::qc_unsized; #[allow(unused_imports)] - use test::Wi128; + use crate::test::Wi128; + use crate::{ + BigEndian, ByteOrder, LittleEndian, NativeEndian, + }; + use core::mem::size_of; #[test] fn big_endian() { #[allow(unused_unsafe)] fn prop(numbers: Vec<$ty_int>) -> bool { - let numbers: Vec<_> = numbers - .into_iter() - .map(|x| x.clone()) - .collect(); + let numbers: Vec<_> = + numbers.into_iter().map(|x| x.clone()).collect(); let num_bytes = size_of::<$ty_int>() * numbers.len(); let mut bytes = vec![0; num_bytes]; BigEndian::$write(&numbers, &mut bytes); let mut got = vec![$zero; numbers.len()]; - unsafe { BigEndian::$read(&bytes, &mut got); } + unsafe { + BigEndian::$read(&bytes, &mut got); + } numbers == got } @@ -3304,17 +3985,17 @@ mod stdtests { fn little_endian() { #[allow(unused_unsafe)] fn prop(numbers: Vec<$ty_int>) -> bool { - let numbers: Vec<_> = numbers - .into_iter() - .map(|x| x.clone()) - .collect(); + let numbers: Vec<_> = + numbers.into_iter().map(|x| x.clone()).collect(); let num_bytes = size_of::<$ty_int>() * numbers.len(); let mut bytes = vec![0; num_bytes]; LittleEndian::$write(&numbers, &mut bytes); let mut got = vec![$zero; numbers.len()]; - unsafe { LittleEndian::$read(&bytes, &mut got); } + unsafe { + LittleEndian::$read(&bytes, &mut got); + } numbers == got } @@ -3325,24 +4006,24 @@ mod stdtests { fn native_endian() { #[allow(unused_unsafe)] fn prop(numbers: Vec<$ty_int>) -> bool { - let numbers: Vec<_> = numbers - .into_iter() - .map(|x| x.clone()) - .collect(); + let numbers: Vec<_> = + numbers.into_iter().map(|x| x.clone()).collect(); let num_bytes = size_of::<$ty_int>() * numbers.len(); let mut bytes = vec![0; num_bytes]; NativeEndian::$write(&numbers, &mut bytes); let mut got = vec![$zero; numbers.len()]; - unsafe { NativeEndian::$read(&bytes, &mut got); } + unsafe { + NativeEndian::$read(&bytes, &mut got); + } numbers == got } qc_unsized(prop as fn(_) -> bool); } } - } + }; } qc_slice!(prop_slice_u16, u16, read_u16_into, write_u16_into, 0); @@ -3351,15 +4032,21 @@ mod stdtests { qc_slice!(prop_slice_i32, i32, read_i32_into, write_i32_into, 0); qc_slice!(prop_slice_u64, u64, read_u64_into, write_u64_into, 0); qc_slice!(prop_slice_i64, i64, read_i64_into, write_i64_into, 0); - #[cfg(byteorder_i128)] qc_slice!( - prop_slice_u128, Wi128, read_u128_into, write_u128_into, 0); - #[cfg(byteorder_i128)] + prop_slice_u128, + Wi128, + read_u128_into, + write_u128_into, + 0 + ); qc_slice!( - prop_slice_i128, Wi128, read_i128_into, write_i128_into, 0); + prop_slice_i128, + Wi128, + read_i128_into, + write_i128_into, + 0 + ); - qc_slice!( - prop_slice_f32, f32, read_f32_into, write_f32_into, 0.0); - qc_slice!( - prop_slice_f64, f64, read_f64_into, write_f64_into, 0.0); + qc_slice!(prop_slice_f32, f32, read_f32_into, write_f32_into, 0.0); + qc_slice!(prop_slice_f64, f64, read_f64_into, write_f64_into, 0.0); } diff --git a/third_party/cargo/vendor/calloop-0.6.5/BUILD.bazel b/third_party/cargo/vendor/calloop-0.6.5/BUILD.bazel index 76babfc..b8bfab7 100644 --- a/third_party/cargo/vendor/calloop-0.6.5/BUILD.bazel +++ b/third_party/cargo/vendor/calloop-0.6.5/BUILD.bazel @@ -49,7 +49,7 @@ rust_library( version = "0.6.5", # buildifier: leave-alone deps = [ - "//third_party/cargo/vendor/log-0.4.11:log", + "//third_party/cargo/vendor/log-0.4.14:log", "//third_party/cargo/vendor/nix-0.18.0:nix", ], ) diff --git a/third_party/cargo/vendor/cc-1.0.66/.cargo-checksum.json b/third_party/cargo/vendor/cc-1.0.67/.cargo-checksum.json similarity index 63% rename from third_party/cargo/vendor/cc-1.0.66/.cargo-checksum.json rename to third_party/cargo/vendor/cc-1.0.67/.cargo-checksum.json index 45e9e7c..1709033 100644 --- a/third_party/cargo/vendor/cc-1.0.66/.cargo-checksum.json +++ b/third_party/cargo/vendor/cc-1.0.67/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.lock":"e7f53256b803536940678cee654d7e2318882aa7cd163acbe8be0caa72087b65","Cargo.toml":"ecb8c7e0fccad7f2d42412b5a227bf51f8e53b9fd526e036fc1b8f41c5024a68","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"3055cc70608f92dab0dcd10338264357ef891f01d02219fa64457b4aa016936b","src/bin/gcc-shim.rs":"b77907875029494b6288841c3aed2e4939ed40708c7f597fca5c9e2570490ca6","src/com.rs":"bcdaf1c28b71e6ef889c6b08d1ce9d7c0761344a677f523bc4c3cd297957f804","src/lib.rs":"e1a05e4a092b903dbbc45612ee924c038585d5f680233792afc551000eb6aac5","src/registry.rs":"3cc1b5a50879fa751572878ae1d0afbfc960c11665258492754b2c8bccb0ff5d","src/setup_config.rs":"7014103587d3382eac599cb76f016e2609b8140970861b2237982d1db24af265","src/winapi.rs":"ea8b7edbb9ff87957254f465c2334e714c5d6b3b19a8d757c48ea7ca0881c50c","src/windows_registry.rs":"52afe8554f577c87841c48ddee3ba7ffe70a00129e1d6eeb2ec0efb3d2b9aa11","tests/cc_env.rs":"e02b3b0824ad039b47e4462c5ef6dbe6c824c28e7953af94a0f28f7b5158042e","tests/cflags.rs":"57f06eb5ce1557e5b4a032d0c4673e18fbe6f8d26c1deb153126e368b96b41b3","tests/cxxflags.rs":"c2c6c6d8a0d7146616fa1caed26876ee7bc9fcfffd525eb4743593cade5f3371","tests/support/mod.rs":"16274867f23871e9b07614eda4c7344da13d1751fed63d4f633857e40be86394","tests/test.rs":"65c073e0e2cf4aa0433066102788e9f57442719e6f32f5ad5248aa7132bb4597"},"package":"4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48"} \ No newline at end of file +{"files":{"Cargo.lock":"45b8780aa6c52bb154732a5b8a11c5723dd8328e7f0d01493a2bcd07fdba96c9","Cargo.toml":"3b622b3ea56086289d3b4ddc13a7d11c94c3ff0c729b37aa18a2ddca70201929","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"9916275542d23bfa0815b1f48d4546e514739fadc79775500de6a81cf17aac09","src/bin/gcc-shim.rs":"b77907875029494b6288841c3aed2e4939ed40708c7f597fca5c9e2570490ca6","src/com.rs":"bcdaf1c28b71e6ef889c6b08d1ce9d7c0761344a677f523bc4c3cd297957f804","src/lib.rs":"43bfa26d2bc699d56e063f5608aadb0cc20c297612e1f02cc408e0221923ac88","src/registry.rs":"3cc1b5a50879fa751572878ae1d0afbfc960c11665258492754b2c8bccb0ff5d","src/setup_config.rs":"7014103587d3382eac599cb76f016e2609b8140970861b2237982d1db24af265","src/winapi.rs":"ea8b7edbb9ff87957254f465c2334e714c5d6b3b19a8d757c48ea7ca0881c50c","src/windows_registry.rs":"52afe8554f577c87841c48ddee3ba7ffe70a00129e1d6eeb2ec0efb3d2b9aa11","tests/cc_env.rs":"e02b3b0824ad039b47e4462c5ef6dbe6c824c28e7953af94a0f28f7b5158042e","tests/cflags.rs":"57f06eb5ce1557e5b4a032d0c4673e18fbe6f8d26c1deb153126e368b96b41b3","tests/cxxflags.rs":"c2c6c6d8a0d7146616fa1caed26876ee7bc9fcfffd525eb4743593cade5f3371","tests/support/mod.rs":"16274867f23871e9b07614eda4c7344da13d1751fed63d4f633857e40be86394","tests/test.rs":"65c073e0e2cf4aa0433066102788e9f57442719e6f32f5ad5248aa7132bb4597"},"package":"e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd"} \ No newline at end of file diff --git a/third_party/cargo/vendor/cc-1.0.66/BUILD.bazel b/third_party/cargo/vendor/cc-1.0.67/BUILD.bazel similarity index 97% rename from third_party/cargo/vendor/cc-1.0.66/BUILD.bazel rename to third_party/cargo/vendor/cc-1.0.67/BUILD.bazel index 6aa6336..cfc973b 100644 --- a/third_party/cargo/vendor/cc-1.0.66/BUILD.bazel +++ b/third_party/cargo/vendor/cc-1.0.67/BUILD.bazel @@ -47,7 +47,7 @@ rust_binary( "cargo-raze", "manual", ], - version = "1.0.66", + version = "1.0.67", # buildifier: leave-alone deps = [ # Binaries get an implicit dependency on their crate's lib @@ -71,7 +71,7 @@ rust_library( "cargo-raze", "manual", ], - version = "1.0.66", + version = "1.0.67", # buildifier: leave-alone deps = [ ], diff --git a/third_party/cargo/vendor/cc-1.0.66/Cargo.lock b/third_party/cargo/vendor/cc-1.0.67/Cargo.lock similarity index 99% rename from third_party/cargo/vendor/cc-1.0.66/Cargo.lock rename to third_party/cargo/vendor/cc-1.0.67/Cargo.lock index 19dae76..c217f33 100644 --- a/third_party/cargo/vendor/cc-1.0.66/Cargo.lock +++ b/third_party/cargo/vendor/cc-1.0.67/Cargo.lock @@ -2,7 +2,7 @@ # It is not intended for manual editing. [[package]] name = "cc" -version = "1.0.66" +version = "1.0.67" dependencies = [ "jobserver", "tempfile", diff --git a/third_party/cargo/vendor/cc-1.0.66/Cargo.toml b/third_party/cargo/vendor/cc-1.0.67/Cargo.toml similarity index 98% rename from third_party/cargo/vendor/cc-1.0.66/Cargo.toml rename to third_party/cargo/vendor/cc-1.0.67/Cargo.toml index 4590bc2..be1db1f 100644 --- a/third_party/cargo/vendor/cc-1.0.66/Cargo.toml +++ b/third_party/cargo/vendor/cc-1.0.67/Cargo.toml @@ -13,7 +13,7 @@ [package] edition = "2018" name = "cc" -version = "1.0.66" +version = "1.0.67" authors = ["Alex Crichton "] exclude = ["/.github", "/.travis.yml", "/appveyor.yml"] description = "A build-time dependency for Cargo build scripts to assist in invoking the native\nC compiler to compile native C code into a static archive to be linked into Rust\ncode.\n" diff --git a/third_party/cargo/vendor/cc-1.0.66/LICENSE-APACHE b/third_party/cargo/vendor/cc-1.0.67/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/cc-1.0.66/LICENSE-APACHE rename to third_party/cargo/vendor/cc-1.0.67/LICENSE-APACHE diff --git a/third_party/cargo/vendor/cc-1.0.66/LICENSE-MIT b/third_party/cargo/vendor/cc-1.0.67/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/cc-1.0.66/LICENSE-MIT rename to third_party/cargo/vendor/cc-1.0.67/LICENSE-MIT diff --git a/third_party/cargo/vendor/cc-1.0.66/README.md b/third_party/cargo/vendor/cc-1.0.67/README.md similarity index 92% rename from third_party/cargo/vendor/cc-1.0.66/README.md rename to third_party/cargo/vendor/cc-1.0.67/README.md index af80281..f88455e 100644 --- a/third_party/cargo/vendor/cc-1.0.66/README.md +++ b/third_party/cargo/vendor/cc-1.0.67/README.md @@ -101,7 +101,7 @@ 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]: http://doc.crates.io/build-script.html#inputs-to-the-build-script +[cargo]: https://doc.rust-lang.org/cargo/reference/build-scripts.html#inputs-to-the-build-script ## Optional features @@ -128,7 +128,7 @@ 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 OSX, for example. + 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 `cl.exe` to be available and in `PATH`. This is typically found in standard Visual Studio installations and the `PATH` can be set up by running @@ -138,12 +138,12 @@ required varies per platform, but there are three broad categories: [MinGW-w64](http://mingw-w64.org) distribution, which is using the [Win-builds](http://win-builds.org) installation system. You may also acquire it via - [MSYS2](http://msys2.github.io), as explained [here][msys2-help]. Make sure + [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]: http://github.com/rust-lang/rust#building-on-windows +[msys2-help]: https://github.com/rust-lang/rust#building-on-windows ## C++ support @@ -161,7 +161,7 @@ fn main() { 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 OS X, FreeBSD, and OpenBSD, `libc++_shared` for Android, nothing for MSVC, and `libstdc++` for anything else. It can be changed in one of two ways: +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 @@ -209,9 +209,9 @@ fn main() { 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) + https://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or - http://opensource.org/licenses/MIT) + https://opensource.org/licenses/MIT) at your option. diff --git a/third_party/cargo/vendor/cc-1.0.66/src/bin/gcc-shim.rs b/third_party/cargo/vendor/cc-1.0.67/src/bin/gcc-shim.rs similarity index 100% rename from third_party/cargo/vendor/cc-1.0.66/src/bin/gcc-shim.rs rename to third_party/cargo/vendor/cc-1.0.67/src/bin/gcc-shim.rs diff --git a/third_party/cargo/vendor/cc-1.0.66/src/com.rs b/third_party/cargo/vendor/cc-1.0.67/src/com.rs similarity index 100% rename from third_party/cargo/vendor/cc-1.0.66/src/com.rs rename to third_party/cargo/vendor/cc-1.0.67/src/com.rs diff --git a/third_party/cargo/vendor/cc-1.0.66/src/lib.rs b/third_party/cargo/vendor/cc-1.0.67/src/lib.rs similarity index 98% rename from third_party/cargo/vendor/cc-1.0.66/src/lib.rs rename to third_party/cargo/vendor/cc-1.0.67/src/lib.rs index 9814ea7..5051b29 100644 --- a/third_party/cargo/vendor/cc-1.0.66/src/lib.rs +++ b/third_party/cargo/vendor/cc-1.0.67/src/lib.rs @@ -1414,7 +1414,7 @@ impl Build { cmd.push_opt_unless_duplicate("-DANDROID".into()); } - if !target.contains("-ios") { + if !target.contains("apple-ios") { cmd.push_cc_arg("-ffunction-sections".into()); cmd.push_cc_arg("-fdata-sections".into()); } @@ -1468,6 +1468,20 @@ impl Build { cmd.args .push(format!("--target={}-apple-{}-macabi", arch, ios).into()); } + } else if target.contains("ios-sim") { + if let Some(arch) = + map_darwin_target_from_rust_to_compiler_architecture(target) + { + let deployment_target = env::var("IPHONEOS_DEPLOYMENT_TARGET") + .unwrap_or_else(|_| "7.0".into()); + cmd.args.push( + format!( + "--target={}-apple-ios{}-simulator", + arch, deployment_target + ) + .into(), + ); + } } else { cmd.args.push(format!("--target={}", target).into()); } @@ -1600,7 +1614,7 @@ impl Build { cmd.args.push("-march=i686".into()); } - // Looks like `musl-gcc` makes is hard for `-m32` to make its way + // 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 @@ -1677,14 +1691,17 @@ impl Build { let mut parts = target.split('-'); if let Some(arch) = parts.next() { let arch = &arch[5..]; - cmd.args.push(("-march=rv".to_owned() + arch).into()); if target.contains("linux") && arch.starts_with("64") { + cmd.args.push(("-march=rv64gc").into()); cmd.args.push("-mabi=lp64d".into()); } else if target.contains("linux") && arch.starts_with("32") { + cmd.args.push(("-march=rv32gc").into()); cmd.args.push("-mabi=ilp32d".into()); } else if arch.starts_with("64") { + cmd.args.push(("-march=rv".to_owned() + arch).into()); cmd.args.push("-mabi=lp64".into()); } else { + cmd.args.push(("-march=rv".to_owned() + arch).into()); cmd.args.push("-mabi=ilp32".into()); } cmd.args.push("-mcmodel=medany".into()); @@ -1693,9 +1710,7 @@ impl Build { } } - if target.contains("-ios") { - // FIXME: potential bug. iOS is always compiled with Clang, but Gcc compiler may be - // detected instead. + if target.contains("apple-ios") { self.ios_flags(cmd)?; } @@ -2044,6 +2059,8 @@ impl Build { } else { format!("{}.exe", gnu) } + } else if target.contains("apple-ios") { + clang.to_string() } else if target.contains("android") { autodetect_android_compiler(&target, &host, gnu, clang) } else if target.contains("cloudabi") { @@ -2420,6 +2437,9 @@ impl Build { "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"), "s390x-unknown-linux-gnu" => Some("s390x-linux-gnu"), "sparc-unknown-linux-gnu" => Some("sparc-linux-gnu"), "sparc64-unknown-linux-gnu" => Some("sparc64-linux-gnu"), @@ -2643,11 +2663,7 @@ impl Tool { let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) { if fname.contains("clang-cl") { ToolFamily::Msvc { clang_cl: true } - } else if fname.contains("cl") - && !fname.contains("cloudabi") - && !fname.contains("uclibc") - && !fname.contains("clang") - { + } else if fname.ends_with("cl") || fname == "cl.exe" { ToolFamily::Msvc { clang_cl: false } } else if fname.contains("clang") { match clang_driver { diff --git a/third_party/cargo/vendor/cc-1.0.66/src/registry.rs b/third_party/cargo/vendor/cc-1.0.67/src/registry.rs similarity index 100% rename from third_party/cargo/vendor/cc-1.0.66/src/registry.rs rename to third_party/cargo/vendor/cc-1.0.67/src/registry.rs diff --git a/third_party/cargo/vendor/cc-1.0.66/src/setup_config.rs b/third_party/cargo/vendor/cc-1.0.67/src/setup_config.rs similarity index 100% rename from third_party/cargo/vendor/cc-1.0.66/src/setup_config.rs rename to third_party/cargo/vendor/cc-1.0.67/src/setup_config.rs diff --git a/third_party/cargo/vendor/cc-1.0.66/src/winapi.rs b/third_party/cargo/vendor/cc-1.0.67/src/winapi.rs similarity index 100% rename from third_party/cargo/vendor/cc-1.0.66/src/winapi.rs rename to third_party/cargo/vendor/cc-1.0.67/src/winapi.rs diff --git a/third_party/cargo/vendor/cc-1.0.66/src/windows_registry.rs b/third_party/cargo/vendor/cc-1.0.67/src/windows_registry.rs similarity index 100% rename from third_party/cargo/vendor/cc-1.0.66/src/windows_registry.rs rename to third_party/cargo/vendor/cc-1.0.67/src/windows_registry.rs diff --git a/third_party/cargo/vendor/cc-1.0.66/tests/cc_env.rs b/third_party/cargo/vendor/cc-1.0.67/tests/cc_env.rs similarity index 100% rename from third_party/cargo/vendor/cc-1.0.66/tests/cc_env.rs rename to third_party/cargo/vendor/cc-1.0.67/tests/cc_env.rs diff --git a/third_party/cargo/vendor/cc-1.0.66/tests/cflags.rs b/third_party/cargo/vendor/cc-1.0.67/tests/cflags.rs similarity index 100% rename from third_party/cargo/vendor/cc-1.0.66/tests/cflags.rs rename to third_party/cargo/vendor/cc-1.0.67/tests/cflags.rs diff --git a/third_party/cargo/vendor/cc-1.0.66/tests/cxxflags.rs b/third_party/cargo/vendor/cc-1.0.67/tests/cxxflags.rs similarity index 100% rename from third_party/cargo/vendor/cc-1.0.66/tests/cxxflags.rs rename to third_party/cargo/vendor/cc-1.0.67/tests/cxxflags.rs diff --git a/third_party/cargo/vendor/cc-1.0.66/tests/support/mod.rs b/third_party/cargo/vendor/cc-1.0.67/tests/support/mod.rs similarity index 100% rename from third_party/cargo/vendor/cc-1.0.66/tests/support/mod.rs rename to third_party/cargo/vendor/cc-1.0.67/tests/support/mod.rs diff --git a/third_party/cargo/vendor/cc-1.0.66/tests/test.rs b/third_party/cargo/vendor/cc-1.0.67/tests/test.rs similarity index 100% rename from third_party/cargo/vendor/cc-1.0.66/tests/test.rs rename to third_party/cargo/vendor/cc-1.0.67/tests/test.rs diff --git a/third_party/cargo/vendor/cocoa-0.20.2/BUILD.bazel b/third_party/cargo/vendor/cocoa-0.20.2/BUILD.bazel index e04bec3..d91a1c6 100644 --- a/third_party/cargo/vendor/cocoa-0.20.2/BUILD.bazel +++ b/third_party/cargo/vendor/cocoa-0.20.2/BUILD.bazel @@ -62,7 +62,7 @@ rust_library( "//third_party/cargo/vendor/core-foundation-0.7.0:core_foundation", "//third_party/cargo/vendor/core-graphics-0.19.2:core_graphics", "//third_party/cargo/vendor/foreign-types-0.3.2:foreign_types", - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", "//third_party/cargo/vendor/objc-0.2.7:objc", ], ) diff --git a/third_party/cargo/vendor/cocoa-0.24.0/BUILD.bazel b/third_party/cargo/vendor/cocoa-0.24.0/BUILD.bazel index f655015..e96a791 100644 --- a/third_party/cargo/vendor/cocoa-0.24.0/BUILD.bazel +++ b/third_party/cargo/vendor/cocoa-0.24.0/BUILD.bazel @@ -63,7 +63,7 @@ rust_library( "//third_party/cargo/vendor/core-foundation-0.9.1:core_foundation", "//third_party/cargo/vendor/core-graphics-0.22.2:core_graphics", "//third_party/cargo/vendor/foreign-types-0.3.2:foreign_types", - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", "//third_party/cargo/vendor/objc-0.2.7:objc", ], ) diff --git a/third_party/cargo/vendor/cocoa-foundation-0.1.0/BUILD.bazel b/third_party/cargo/vendor/cocoa-foundation-0.1.0/BUILD.bazel index 4ac7341..a798890 100644 --- a/third_party/cargo/vendor/cocoa-foundation-0.1.0/BUILD.bazel +++ b/third_party/cargo/vendor/cocoa-foundation-0.1.0/BUILD.bazel @@ -54,7 +54,7 @@ rust_library( "//third_party/cargo/vendor/core-foundation-0.9.1:core_foundation", "//third_party/cargo/vendor/core-graphics-types-0.1.1:core_graphics_types", "//third_party/cargo/vendor/foreign-types-0.3.2:foreign_types", - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", "//third_party/cargo/vendor/objc-0.2.7:objc", ], ) diff --git a/third_party/cargo/vendor/const_fn-0.4.5/.cargo-checksum.json b/third_party/cargo/vendor/const_fn-0.4.5/.cargo-checksum.json deleted file mode 100644 index 1891422..0000000 --- a/third_party/cargo/vendor/const_fn-0.4.5/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"CHANGELOG.md":"3d4c8910c720a6467a5576a3ed910d852e3595b0a55a5e412514eefc481ec8d9","Cargo.toml":"9163a47eff7b4bd7d6ed96159d3b8b8452eb39aeb0b8e694309a99e47ddc99a7","LICENSE-APACHE":"0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"e2c098d1b809f792484ca7e4ff21a1992ae83693683ba39d4a0e34ba1be2760f","build.rs":"0095fffab24644ea5b04a6132b0ccb53762435cc637092e6d4c471c4cc66f60b","src/ast.rs":"4d4a1ddb8deefa31c3e798ffe9cb32752f9b5418c61a8e45be32ca0d5f9b63f3","src/error.rs":"9bc6f12801616dc1750346bf4228d1b172bee88777e9c8cb841dd9348fecbcf3","src/iter.rs":"4eccd018075a4f4839adef2e2cf05198780b9b60d6fbfa8188522c2ad8e82cb5","src/lib.rs":"3ad19d38445a06934b60abe94611c77145c0dbcdc28630abb9a5c27c6b6f998f","src/to_tokens.rs":"5e831889f220c5abaf0403e56b485fbbbb1c4516023e82934f69a230d76694bf","src/utils.rs":"b73f44e9260d32d71aa2712b242f8c451317f62ee1523595fca19878ac07dcd4"},"package":"28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6"} \ No newline at end of file diff --git a/third_party/cargo/vendor/const_fn-0.4.5/BUILD.bazel b/third_party/cargo/vendor/const_fn-0.4.5/BUILD.bazel deleted file mode 100644 index 05d35b4..0000000 --- a/third_party/cargo/vendor/const_fn-0.4.5/BUILD.bazel +++ /dev/null @@ -1,55 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -package(default_visibility = [ - # Public for visibility by "@raze__crate__version//" targets. - # - # Prefer access through "//third_party/cargo", which limits external - # visibility to explicit Cargo.toml dependencies. - "//visibility:public", -]) - -licenses([ - "notice", # Apache-2.0 from expression "Apache-2.0 OR MIT" -]) - -# Generated Targets - -# Unsupported target "build-script-build" with type "custom-build" omitted - -rust_library( - name = "const_fn", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "proc-macro", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.4.5", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/third_party/cargo/vendor/const_fn-0.4.5/CHANGELOG.md b/third_party/cargo/vendor/const_fn-0.4.5/CHANGELOG.md deleted file mode 100644 index b46403a..0000000 --- a/third_party/cargo/vendor/const_fn-0.4.5/CHANGELOG.md +++ /dev/null @@ -1,149 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -This project adheres to [Semantic Versioning](https://semver.org). - - - -## [Unreleased] - -## [0.4.5] - 2021-01-05 - -- Exclude unneeded files from crates.io. - -## [0.4.4] - 2020-11-02 - -- [Accept `const_fn` attribute with no arguments and functions without `const` keyword.](https://github.com/taiki-e/const_fn/pull/34) - This allows `const_fn` to be used as an optional dependency. - - ```rust - #[cfg_attr(feature = "...", const_fn::const_fn)] - pub fn func() { - /* ... */ - } - ``` - -## [0.4.3] - 2020-11-02 - -- [`const_fn` no longer fails to compile if unable to determine rustc version. Instead, it now displays a warning.](https://github.com/taiki-e/const_fn/pull/31) - -- [`const_fn` no longer relies on debug print format.](https://github.com/taiki-e/const_fn/pull/30) - -## [0.4.2] - 2020-08-31 - -- [Improve error messages when failed to parse version information.](https://github.com/taiki-e/const_fn/pull/26) - -- [Fix compile failure with cargo installed by yum.](https://github.com/taiki-e/const_fn/pull/26) - -## [0.4.1] - 2020-08-25 - -- [Fix compile failure with non-cargo build systems.](https://github.com/taiki-e/const_fn/pull/23) - -## [0.4.0] - 2020-08-25 - -- [Add support for version-based code generation.](https://github.com/taiki-e/const_fn/pull/17) The following conditions are available: - - ```rust - use const_fn::const_fn; - - // function is `const` on specified version and later compiler (including beta and nightly) - #[const_fn("1.36")] - pub const fn version() { - /* ... */ - } - - // function is `const` on nightly compiler (including dev build) - #[const_fn(nightly)] - pub const fn nightly() { - /* ... */ - } - - // function is `const` if `cfg(...)` is true - #[const_fn(cfg(...))] - pub const fn cfg() { - /* ... */ - } - - // function is `const` if `cfg(feature = "...")` is true - #[const_fn(feature = "...")] - pub const fn feature() { - /* ... */ - } - ``` - -- Improve compile time by removing proc-macro related dependencies ([#18](https://github.com/taiki-e/const_fn/pull/18), [#20](https://github.com/taiki-e/const_fn/pull/20)). - -## [0.3.1] - 2019-12-09 - -- Updated `syn-mid` to 0.5. - -## [0.3.0] - 2019-10-20 - -- `#[const_fn]` attribute may only be used on const functions. - -## [0.2.1] - 2019-08-15 - -- Updated `proc-macro2`, `syn`, and `quote` to 1.0. - -- Updated `syn-mid` to 0.4. - -## [0.2.0] - 2019-06-16 - -- Transition to Rust 2018. With this change, the minimum required version will go up to Rust 1.31. - -## [0.1.7] - 2019-02-18 - -- Update syn-mid version to 0.3 - -## [0.1.6] - 2019-02-15 - -- Reduce compilation time - -## [0.1.5] - 2019-02-15 - -- Revert 0.1.4 - -## [0.1.4] - 2019-02-15 - -**Note: This release has been yanked.** - -- Reduce compilation time - -## [0.1.3] - 2019-01-06 - -- Fix dependencies - -## [0.1.2] - 2018-12-27 - -- Improve error messages - -## [0.1.1] - 2018-12-27 - -- Improve an error message - -## [0.1.0] - 2018-12-25 - -Initial release - -[Unreleased]: https://github.com/taiki-e/const_fn/compare/v0.4.5...HEAD -[0.4.5]: https://github.com/taiki-e/const_fn/compare/v0.4.4...v0.4.5 -[0.4.4]: https://github.com/taiki-e/const_fn/compare/v0.4.3...v0.4.4 -[0.4.3]: https://github.com/taiki-e/const_fn/compare/v0.4.2...v0.4.3 -[0.4.2]: https://github.com/taiki-e/const_fn/compare/v0.4.1...v0.4.2 -[0.4.1]: https://github.com/taiki-e/const_fn/compare/v0.4.0...v0.4.1 -[0.4.0]: https://github.com/taiki-e/const_fn/compare/v0.3.1...v0.4.0 -[0.3.1]: https://github.com/taiki-e/const_fn/compare/v0.3.0...v0.3.1 -[0.3.0]: https://github.com/taiki-e/const_fn/compare/v0.2.1...v0.3.0 -[0.2.1]: https://github.com/taiki-e/const_fn/compare/v0.2.0...v0.2.1 -[0.2.0]: https://github.com/taiki-e/const_fn/compare/v0.1.7...v0.2.0 -[0.1.7]: https://github.com/taiki-e/const_fn/compare/v0.1.6...v0.1.7 -[0.1.6]: https://github.com/taiki-e/const_fn/compare/v0.1.5...v0.1.6 -[0.1.5]: https://github.com/taiki-e/const_fn/compare/v0.1.4...v0.1.5 -[0.1.4]: https://github.com/taiki-e/const_fn/compare/v0.1.3...v0.1.4 -[0.1.3]: https://github.com/taiki-e/const_fn/compare/v0.1.2...v0.1.3 -[0.1.2]: https://github.com/taiki-e/const_fn/compare/v0.1.1...v0.1.2 -[0.1.1]: https://github.com/taiki-e/const_fn/compare/v0.1.0...v0.1.1 -[0.1.0]: https://github.com/taiki-e/const_fn/releases/tag/v0.1.0 diff --git a/third_party/cargo/vendor/const_fn-0.4.5/Cargo.toml b/third_party/cargo/vendor/const_fn-0.4.5/Cargo.toml deleted file mode 100644 index 6017735..0000000 --- a/third_party/cargo/vendor/const_fn-0.4.5/Cargo.toml +++ /dev/null @@ -1,30 +0,0 @@ -# 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 = "const_fn" -version = "0.4.5" -authors = ["Taiki Endo "] -exclude = ["/.github", "/scripts"] -description = "An attribute for easy generation of const functions with conditional compilations.\n" -documentation = "https://docs.rs/const_fn" -readme = "README.md" -keywords = ["macros", "attribute", "const", "static"] -categories = ["rust-patterns", "no-std"] -license = "Apache-2.0 OR MIT" -repository = "https://github.com/taiki-e/const_fn" -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[lib] -proc-macro = true diff --git a/third_party/cargo/vendor/const_fn-0.4.5/LICENSE-APACHE b/third_party/cargo/vendor/const_fn-0.4.5/LICENSE-APACHE deleted file mode 100644 index f433b1a..0000000 --- a/third_party/cargo/vendor/const_fn-0.4.5/LICENSE-APACHE +++ /dev/null @@ -1,177 +0,0 @@ - - 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 --git a/third_party/cargo/vendor/const_fn-0.4.5/README.md b/third_party/cargo/vendor/const_fn-0.4.5/README.md deleted file mode 100644 index 18feabe..0000000 --- a/third_party/cargo/vendor/const_fn-0.4.5/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# \#\[const_fn\] - -[![crates.io](https://img.shields.io/crates/v/const_fn.svg?style=flat-square&logo=rust)](https://crates.io/crates/const_fn) -[![docs.rs](https://img.shields.io/badge/docs.rs-const__fn-blue?style=flat-square)](https://docs.rs/const_fn) -[![license](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue.svg?style=flat-square)](#license) -[![rustc](https://img.shields.io/badge/rustc-1.31+-blue.svg?style=flat-square)](https://www.rust-lang.org) -[![build status](https://img.shields.io/github/workflow/status/taiki-e/const_fn/CI/master?style=flat-square)](https://github.com/taiki-e/const_fn/actions?query=workflow%3ACI+branch%3Amaster) - -An attribute for easy generation of const functions with conditional -compilations. - -## Usage - -Add this to your `Cargo.toml`: - -```toml -[dependencies] -const_fn = "0.4" -``` - -*Compiler support: requires rustc 1.31+* - -## Examples - -```rust -use const_fn::const_fn; - -// function is `const` on specified version and later compiler (including beta and nightly) -#[const_fn("1.36")] -pub const fn version() { - /* ... */ -} - -// function is `const` on nightly compiler (including dev build) -#[const_fn(nightly)] -pub const fn nightly() { - /* ... */ -} - -// function is `const` if `cfg(...)` is true -#[const_fn(cfg(...))] -pub const fn cfg() { - /* ... */ -} - -// function is `const` if `cfg(feature = "...")` is true -#[const_fn(feature = "...")] -pub const fn feature() { - /* ... */ -} -``` - -## Alternatives - -This crate is proc-macro, but is very lightweight, and has no dependencies. - -You can manually define declarative macros with similar functionality (see -[`if_rust_version`](https://github.com/ogoffart/if_rust_version#examples)), -or [you can define the same function twice with different cfg](https://github.com/crossbeam-rs/crossbeam/blob/0b6ea5f69fde8768c1cfac0d3601e0b4325d7997/crossbeam-epoch/src/atomic.rs#L340-L372). -(Note: the former approach requires more macros to be defined depending on the -number of version requirements, the latter approach requires more functions to -be maintained manually) - -## 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 --git a/third_party/cargo/vendor/const_fn-0.4.5/build.rs b/third_party/cargo/vendor/const_fn-0.4.5/build.rs deleted file mode 100644 index 5aa341f..0000000 --- a/third_party/cargo/vendor/const_fn-0.4.5/build.rs +++ /dev/null @@ -1,102 +0,0 @@ -#![forbid(unsafe_code)] -#![warn(rust_2018_idioms, single_use_lifetimes)] - -use std::{ - env, fs, - path::{Path, PathBuf}, - process::Command, - str, -}; - -// The rustc-cfg strings below are *not* public API. Please let us know by -// opening a GitHub issue if your build environment requires some way to enable -// these cfgs other than by executing our build script. -fn main() { - let rustc: PathBuf = env::var_os("RUSTC").unwrap_or_else(|| "rustc".into()).into(); - let version = match Version::from_rustc(&rustc) { - Ok(version) => version.print(), - Err(e) => { - println!( - "cargo:warning={}: unable to determine rustc version: {}", - env!("CARGO_PKG_NAME"), - e - ); - return; - } - }; - - let out_dir: PathBuf = env::var_os("OUT_DIR").expect("OUT_DIR not set").into(); - let out_file = &out_dir.join("version"); - fs::write(out_file, version) - .unwrap_or_else(|e| panic!("failed to write {}: {}", out_file.display(), e)); - - // Mark as build script has been run successfully. - println!("cargo:rustc-cfg=const_fn_has_build_script"); -} - -struct Version { - minor: u32, - nightly: bool, -} - -impl Version { - // Based on https://github.com/cuviper/autocfg/blob/1.0.1/src/version.rs#L25-L59 - // - // TODO: use autocfg if https://github.com/cuviper/autocfg/issues/28 merged - // or https://github.com/taiki-e/const_fn/issues/27 rejected. - fn from_rustc(rustc: &Path) -> Result { - let output = - Command::new(rustc).args(&["--version", "--verbose"]).output().map_err(|e| { - format!("could not execute `{} --version --verbose`: {}", rustc.display(), e) - })?; - if !output.status.success() { - return Err(format!( - "process didn't exit successfully: `{} --version --verbose`", - rustc.display() - )); - } - let output = str::from_utf8(&output.stdout).map_err(|e| { - format!("failed to parse output of `{} --version --verbose`: {}", rustc.display(), e) - })?; - - // Find the release line in the verbose version output. - let release = output - .lines() - .find(|line| line.starts_with("release: ")) - .map(|line| &line["release: ".len()..]) - .ok_or_else(|| { - format!( - "could not find rustc release from output of `{} --version --verbose`: {}", - rustc.display(), - output - ) - })?; - - // Split the version and channel info. - let mut version_channel = release.split('-'); - let version = version_channel.next().unwrap(); - let channel = version_channel.next(); - - let minor = (|| { - // Split the version into semver components. - let mut digits = version.splitn(3, '.'); - let major = digits.next()?; - if major != "1" { - return None; - } - let minor = digits.next()?.parse().ok()?; - let _patch = digits.next()?; - Some(minor) - })() - .ok_or_else(|| { - format!("unexpected output from `{} --version --verbose`: {}", rustc.display(), output) - })?; - - let nightly = channel.map_or(false, |c| c == "dev" || c == "nightly"); - Ok(Self { minor, nightly }) - } - - fn print(&self) -> String { - format!("Version {{ minor: {}, nightly: {} }}\n", self.minor, self.nightly) - } -} diff --git a/third_party/cargo/vendor/const_fn-0.4.5/src/ast.rs b/third_party/cargo/vendor/const_fn-0.4.5/src/ast.rs deleted file mode 100644 index 3622a2f..0000000 --- a/third_party/cargo/vendor/const_fn-0.4.5/src/ast.rs +++ /dev/null @@ -1,141 +0,0 @@ -use proc_macro::{Delimiter, Ident, Literal, Span, TokenStream, TokenTree}; - -use crate::{ - iter::TokenIter, - to_tokens::ToTokens, - utils::{parse_as_empty, tt_span}, - Result, -}; - -pub(crate) struct Func { - pub(crate) attrs: Vec, - pub(crate) sig: Vec, - pub(crate) body: TokenTree, - pub(crate) print_const: bool, -} - -pub(crate) fn parse_input(input: TokenStream) -> Result { - let mut input = TokenIter::new(input); - - let attrs = parse_attrs(&mut input)?; - let sig = parse_signature(&mut input); - let body = input.next(); - parse_as_empty(input)?; - - if body.is_none() - || !sig - .iter() - .any(|tt| if let TokenTree::Ident(i) = tt { i.to_string() == "fn" } else { false }) - { - return Err(error!( - Span::call_site(), - "#[const_fn] attribute may only be used on functions" - )); - } - - Ok(Func { attrs, sig, body: body.unwrap(), print_const: true }) -} - -impl ToTokens for Func { - fn to_tokens(&self, tokens: &mut TokenStream) { - self.attrs.iter().for_each(|attr| attr.to_tokens(tokens)); - if self.print_const { - self.sig.iter().for_each(|attr| attr.to_tokens(tokens)); - } else { - self.sig - .iter() - .filter( - |tt| if let TokenTree::Ident(i) = tt { i.to_string() != "const" } else { true }, - ) - .for_each(|tt| tt.to_tokens(tokens)); - } - self.body.to_tokens(tokens); - } -} - -fn parse_signature(input: &mut TokenIter) -> Vec { - let mut sig = Vec::new(); - let mut has_const = false; - loop { - match input.peek() { - Some(TokenTree::Group(group)) if group.delimiter() == Delimiter::Brace => break, - None => break, - Some(TokenTree::Ident(i)) if !has_const => { - match &*i.to_string() { - "const" => has_const = true, - "async" | "unsafe" | "extern" | "fn" => { - sig.push(TokenTree::Ident(Ident::new("const", i.span()))); - has_const = true; - } - _ => {} - } - sig.push(input.next().unwrap()); - } - Some(_) => sig.push(input.next().unwrap()), - } - } - sig -} - -fn parse_attrs(input: &mut TokenIter) -> Result> { - let mut attrs = Vec::new(); - loop { - let pound_token = match input.peek() { - Some(TokenTree::Punct(p)) if p.as_char() == '#' => input.next().unwrap(), - _ => break, - }; - let group = match input.peek() { - Some(TokenTree::Group(g)) if g.delimiter() == Delimiter::Bracket => { - input.next().unwrap() - } - tt => return Err(error!(tt_span(tt), "expected `[`")), - }; - attrs.push(Attribute { pound_token, group }); - } - Ok(attrs) -} - -pub(crate) struct Attribute { - // `#` - pub(crate) pound_token: TokenTree, - // `[...]` - pub(crate) group: TokenTree, -} - -impl ToTokens for Attribute { - fn to_tokens(&self, tokens: &mut TokenStream) { - self.pound_token.to_tokens(tokens); - self.group.to_tokens(tokens); - } -} - -pub(crate) struct LitStr { - pub(crate) token: Literal, - value: String, -} - -impl LitStr { - pub(crate) fn new(token: Literal) -> Result { - let value = token.to_string(); - // unlike `syn::LitStr`, only accepts `"..."` - if value.starts_with('"') && value.ends_with('"') { - Ok(Self { token, value }) - } else { - Err(error!(token.span(), "expected string literal")) - } - } - - pub(crate) fn value(&self) -> &str { - &self.value[1..self.value.len() - 1] - } - - pub(crate) fn span(&self) -> Span { - self.token.span() - } -} - -impl ToTokens for LitStr { - fn to_tokens(&self, tokens: &mut TokenStream) { - self.token.to_tokens(tokens); - } -} diff --git a/third_party/cargo/vendor/const_fn-0.4.5/src/error.rs b/third_party/cargo/vendor/const_fn-0.4.5/src/error.rs deleted file mode 100644 index b572d5a..0000000 --- a/third_party/cargo/vendor/const_fn-0.4.5/src/error.rs +++ /dev/null @@ -1,37 +0,0 @@ -use proc_macro::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree}; -use std::iter::FromIterator; - -pub(crate) struct Error { - span: Span, - msg: String, -} - -impl Error { - pub(crate) fn new(span: Span, msg: impl Into) -> Self { - Self { span, msg: msg.into() } - } - - // https://github.com/dtolnay/syn/blob/1.0.39/src/error.rs#L218-L237 - pub(crate) fn to_compile_error(&self) -> TokenStream { - // compile_error!($msg) - TokenStream::from_iter(vec![ - TokenTree::Ident(Ident::new("compile_error", self.span)), - TokenTree::Punct({ - let mut punct = Punct::new('!', Spacing::Alone); - punct.set_span(self.span); - 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.span); - string - })]) - }); - group.set_span(self.span); - group - }), - ]) - } -} diff --git a/third_party/cargo/vendor/const_fn-0.4.5/src/iter.rs b/third_party/cargo/vendor/const_fn-0.4.5/src/iter.rs deleted file mode 100644 index f998dce..0000000 --- a/third_party/cargo/vendor/const_fn-0.4.5/src/iter.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Based on https://github.com/dtolnay/proc-macro-hack/blob/0.5.18/src/iter.rs - -use proc_macro::{token_stream, Delimiter, TokenStream, TokenTree}; - -pub(crate) struct TokenIter { - stack: Vec, - peeked: Option, -} - -impl TokenIter { - pub(crate) fn new(tokens: TokenStream) -> Self { - Self { stack: vec![tokens.into_iter()], peeked: None } - } - - pub(crate) fn peek(&mut self) -> Option<&TokenTree> { - self.peeked = self.next(); - self.peeked.as_ref() - } -} - -impl Iterator for TokenIter { - type Item = TokenTree; - - fn next(&mut self) -> Option { - if let Some(tt) = self.peeked.take() { - return Some(tt); - } - loop { - let top = self.stack.last_mut()?; - match top.next() { - None => drop(self.stack.pop()), - Some(TokenTree::Group(ref group)) if group.delimiter() == Delimiter::None => { - self.stack.push(group.stream().into_iter()); - } - Some(tt) => return Some(tt), - } - } - } -} diff --git a/third_party/cargo/vendor/const_fn-0.4.5/src/lib.rs b/third_party/cargo/vendor/const_fn-0.4.5/src/lib.rs deleted file mode 100644 index cd8e3e8..0000000 --- a/third_party/cargo/vendor/const_fn-0.4.5/src/lib.rs +++ /dev/null @@ -1,233 +0,0 @@ -//! An attribute for easy generation of const functions with conditional -//! compilations. -//! -//! # Examples -//! -//! ```rust -//! use const_fn::const_fn; -//! -//! // function is `const` on specified version and later compiler (including beta and nightly) -//! #[const_fn("1.36")] -//! pub const fn version() { -//! /* ... */ -//! } -//! -//! // function is `const` on nightly compiler (including dev build) -//! #[const_fn(nightly)] -//! pub const fn nightly() { -//! /* ... */ -//! } -//! -//! // function is `const` if `cfg(...)` is true -//! # #[cfg(any())] -//! #[const_fn(cfg(...))] -//! # pub fn _cfg() { unimplemented!() } -//! pub const fn cfg() { -//! /* ... */ -//! } -//! -//! // function is `const` if `cfg(feature = "...")` is true -//! #[const_fn(feature = "...")] -//! pub const fn feature() { -//! /* ... */ -//! } -//! ``` -//! -//! # Alternatives -//! -//! This crate is proc-macro, but is very lightweight, and has no dependencies. -//! -//! You can manually define declarative macros with similar functionality (see [`if_rust_version`](https://github.com/ogoffart/if_rust_version#examples)), or [you can define the same function twice with different cfg](https://github.com/crossbeam-rs/crossbeam/blob/0b6ea5f69fde8768c1cfac0d3601e0b4325d7997/crossbeam-epoch/src/atomic.rs#L340-L372). -//! (Note: the former approach requires more macros to be defined depending on the number of version requirements, the latter approach requires more functions to be maintained manually) - -#![doc(test( - no_crate_inject, - attr( - deny(warnings, rust_2018_idioms, single_use_lifetimes), - allow(dead_code, unused_variables) - ) -))] -#![forbid(unsafe_code)] -#![warn(future_incompatible, rust_2018_idioms, single_use_lifetimes, unreachable_pub)] -#![warn(clippy::all, clippy::default_trait_access)] - -// older compilers require explicit `extern crate`. -#[allow(unused_extern_crates)] -extern crate proc_macro; - -#[macro_use] -mod utils; - -mod ast; -mod error; -mod iter; -mod to_tokens; - -use proc_macro::{Delimiter, TokenStream, TokenTree}; -use std::str::FromStr; - -use crate::{ - ast::{Func, LitStr}, - error::Error, - to_tokens::ToTokens, - utils::{cfg_attrs, parse_as_empty, tt_span}, -}; - -type Result = std::result::Result; - -/// An attribute for easy generation of const functions with conditional compilations. -/// -/// See crate level documentation for details. -#[proc_macro_attribute] -pub fn const_fn(args: TokenStream, input: TokenStream) -> TokenStream { - let arg = match parse_arg(args) { - Ok(arg) => arg, - Err(e) => return e.to_compile_error(), - }; - let func = match ast::parse_input(input) { - Ok(func) => func, - Err(e) => return e.to_compile_error(), - }; - - expand(arg, func) -} - -fn expand(arg: Arg, mut func: Func) -> TokenStream { - match arg { - Arg::Cfg(cfg) => { - let (mut tokens, cfg_not) = cfg_attrs(cfg); - tokens.extend(func.to_token_stream()); - tokens.extend(cfg_not); - func.print_const = false; - tokens.extend(func.to_token_stream()); - tokens - } - Arg::Feature(feat) => { - let (mut tokens, cfg_not) = cfg_attrs(feat); - tokens.extend(func.to_token_stream()); - tokens.extend(cfg_not); - func.print_const = false; - tokens.extend(func.to_token_stream()); - tokens - } - Arg::Version(req) => { - if req.major > 1 || req.minor > VERSION.minor { - func.print_const = false; - } - func.to_token_stream() - } - Arg::Nightly => { - func.print_const = VERSION.nightly; - func.to_token_stream() - } - Arg::Always => func.to_token_stream(), - } -} - -enum Arg { - // `const_fn("...")` - Version(VersionReq), - // `const_fn(nightly)` - Nightly, - // `const_fn(cfg(...))` - Cfg(TokenStream), - // `const_fn(feature = "...")` - Feature(TokenStream), - // `const_fn` - Always, -} - -fn parse_arg(tokens: TokenStream) -> Result { - let mut iter = tokens.into_iter(); - - let next = iter.next(); - let next_span = tt_span(next.as_ref()); - match next { - None => return Ok(Arg::Always), - Some(TokenTree::Ident(i)) => match &*i.to_string() { - "nightly" => { - parse_as_empty(iter)?; - return Ok(Arg::Nightly); - } - "cfg" => { - return match iter.next().as_ref() { - Some(TokenTree::Group(g)) if g.delimiter() == Delimiter::Parenthesis => { - parse_as_empty(iter)?; - Ok(Arg::Cfg(g.stream())) - } - tt => Err(error!(tt_span(tt), "expected `(`")), - }; - } - "feature" => { - let next = iter.next(); - return match next.as_ref() { - Some(TokenTree::Punct(p)) if p.as_char() == '=' => match iter.next() { - Some(TokenTree::Literal(l)) => { - let l = LitStr::new(l)?; - parse_as_empty(iter)?; - Ok(Arg::Feature( - vec![TokenTree::Ident(i), next.unwrap(), l.token.into()] - .into_iter() - .collect(), - )) - } - tt => Err(error!(tt_span(tt.as_ref()), "expected string literal")), - }, - tt => Err(error!(tt_span(tt), "expected `=`")), - }; - } - _ => {} - }, - Some(TokenTree::Literal(l)) => { - if let Ok(l) = LitStr::new(l) { - parse_as_empty(iter)?; - return match l.value().parse::() { - Ok(req) => Ok(Arg::Version(req)), - Err(e) => Err(error!(l.span(), "{}", e)), - }; - } - } - Some(_) => {} - } - - Err(error!(next_span, "expected one of: `nightly`, `cfg`, `feature`, string literal")) -} - -struct VersionReq { - major: u32, - minor: u32, -} - -impl FromStr for VersionReq { - type Err = String; - - fn from_str(s: &str) -> Result { - let mut pieces = s.split('.'); - let major = pieces - .next() - .ok_or("need to specify the major version")? - .parse::() - .map_err(|e| e.to_string())?; - let minor = pieces - .next() - .ok_or("need to specify the minor version")? - .parse::() - .map_err(|e| e.to_string())?; - if let Some(s) = pieces.next() { - Err(format!("unexpected input: .{}", s)) - } else { - Ok(Self { major, minor }) - } - } -} - -struct Version { - minor: u32, - nightly: bool, -} - -#[cfg(const_fn_has_build_script)] -const VERSION: Version = include!(concat!(env!("OUT_DIR"), "/version")); -// If build script has not run or unable to determine version, it is considered as Rust 1.0. -#[cfg(not(const_fn_has_build_script))] -const VERSION: Version = Version { minor: 0, nightly: false }; diff --git a/third_party/cargo/vendor/const_fn-0.4.5/src/to_tokens.rs b/third_party/cargo/vendor/const_fn-0.4.5/src/to_tokens.rs deleted file mode 100644 index 771c7f6..0000000 --- a/third_party/cargo/vendor/const_fn-0.4.5/src/to_tokens.rs +++ /dev/null @@ -1,36 +0,0 @@ -use proc_macro::{Ident, Literal, TokenStream, TokenTree}; -use std::iter; - -pub(crate) trait ToTokens { - fn to_tokens(&self, tokens: &mut TokenStream); - - fn to_token_stream(&self) -> TokenStream { - let mut tokens = TokenStream::new(); - self.to_tokens(&mut tokens); - tokens - } -} - -impl ToTokens for Ident { - fn to_tokens(&self, tokens: &mut TokenStream) { - tokens.extend(iter::once(TokenTree::Ident(self.clone()))); - } -} - -impl ToTokens for Literal { - fn to_tokens(&self, tokens: &mut TokenStream) { - tokens.extend(iter::once(TokenTree::Literal(self.clone()))); - } -} - -impl ToTokens for TokenTree { - fn to_tokens(&self, tokens: &mut TokenStream) { - tokens.extend(iter::once(self.clone())); - } -} - -impl ToTokens for TokenStream { - fn to_tokens(&self, tokens: &mut TokenStream) { - tokens.extend(self.clone()); - } -} diff --git a/third_party/cargo/vendor/const_fn-0.4.5/src/utils.rs b/third_party/cargo/vendor/const_fn-0.4.5/src/utils.rs deleted file mode 100644 index e557ea5..0000000 --- a/third_party/cargo/vendor/const_fn-0.4.5/src/utils.rs +++ /dev/null @@ -1,46 +0,0 @@ -use proc_macro::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream, TokenTree}; -use std::iter::FromIterator; - -use crate::Result; - -macro_rules! error { - ($span:expr, $msg:expr) => {{ - crate::error::Error::new($span, $msg) - }}; - ($span:expr, $($tt:tt)*) => { - error!($span, format!($($tt)*)) - }; -} - -pub(crate) fn tt_span(tt: Option<&TokenTree>) -> Span { - tt.map_or_else(Span::call_site, TokenTree::span) -} - -pub(crate) fn parse_as_empty(mut tokens: impl Iterator) -> Result<()> { - match tokens.next() { - Some(tt) => Err(error!(tt.span(), "unexpected token: {}", tt)), - None => Ok(()), - } -} - -// (`#[cfg()]`, `#[cfg(not())]`) -pub(crate) fn cfg_attrs(tokens: TokenStream) -> (TokenStream, TokenStream) { - let f = |tokens| { - let tokens = TokenStream::from_iter(vec![ - TokenTree::Ident(Ident::new("cfg", Span::call_site())), - TokenTree::Group(Group::new(Delimiter::Parenthesis, tokens)), - ]); - TokenStream::from_iter(vec![ - TokenTree::Punct(Punct::new('#', Spacing::Alone)), - TokenTree::Group(Group::new(Delimiter::Bracket, tokens)), - ]) - }; - - let cfg_not = TokenTree::Group(Group::new(Delimiter::Parenthesis, tokens.clone())); - let cfg_not = TokenStream::from_iter(vec![ - TokenTree::Ident(Ident::new("not", Span::call_site())), - cfg_not, - ]); - - (f(tokens), f(cfg_not)) -} diff --git a/third_party/cargo/vendor/core-foundation-0.7.0/BUILD.bazel b/third_party/cargo/vendor/core-foundation-0.7.0/BUILD.bazel index aefb48d..5ee9cad 100644 --- a/third_party/cargo/vendor/core-foundation-0.7.0/BUILD.bazel +++ b/third_party/cargo/vendor/core-foundation-0.7.0/BUILD.bazel @@ -50,7 +50,7 @@ rust_library( # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/core-foundation-sys-0.7.0:core_foundation_sys", - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ], ) diff --git a/third_party/cargo/vendor/core-foundation-0.9.1/BUILD.bazel b/third_party/cargo/vendor/core-foundation-0.9.1/BUILD.bazel index ecb47cd..5103601 100644 --- a/third_party/cargo/vendor/core-foundation-0.9.1/BUILD.bazel +++ b/third_party/cargo/vendor/core-foundation-0.9.1/BUILD.bazel @@ -50,7 +50,7 @@ rust_library( # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/core-foundation-sys-0.8.2:core_foundation_sys", - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ], ) diff --git a/third_party/cargo/vendor/core-graphics-0.19.2/BUILD.bazel b/third_party/cargo/vendor/core-graphics-0.19.2/BUILD.bazel index fe1a68a..6d64c01 100644 --- a/third_party/cargo/vendor/core-graphics-0.19.2/BUILD.bazel +++ b/third_party/cargo/vendor/core-graphics-0.19.2/BUILD.bazel @@ -53,6 +53,6 @@ rust_library( "//third_party/cargo/vendor/bitflags-1.2.1:bitflags", "//third_party/cargo/vendor/core-foundation-0.7.0:core_foundation", "//third_party/cargo/vendor/foreign-types-0.3.2:foreign_types", - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ], ) diff --git a/third_party/cargo/vendor/core-graphics-0.22.2/BUILD.bazel b/third_party/cargo/vendor/core-graphics-0.22.2/BUILD.bazel index cbca1d4..e91519d 100644 --- a/third_party/cargo/vendor/core-graphics-0.22.2/BUILD.bazel +++ b/third_party/cargo/vendor/core-graphics-0.22.2/BUILD.bazel @@ -54,6 +54,6 @@ rust_library( "//third_party/cargo/vendor/core-foundation-0.9.1:core_foundation", "//third_party/cargo/vendor/core-graphics-types-0.1.1:core_graphics_types", "//third_party/cargo/vendor/foreign-types-0.3.2:foreign_types", - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ], ) diff --git a/third_party/cargo/vendor/core-graphics-types-0.1.1/BUILD.bazel b/third_party/cargo/vendor/core-graphics-types-0.1.1/BUILD.bazel index 9d84395..19651f3 100644 --- a/third_party/cargo/vendor/core-graphics-types-0.1.1/BUILD.bazel +++ b/third_party/cargo/vendor/core-graphics-types-0.1.1/BUILD.bazel @@ -52,6 +52,6 @@ rust_library( "//third_party/cargo/vendor/bitflags-1.2.1:bitflags", "//third_party/cargo/vendor/core-foundation-0.9.1:core_foundation", "//third_party/cargo/vendor/foreign-types-0.3.2:foreign_types", - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ], ) diff --git a/third_party/cargo/vendor/core-video-sys-0.1.4/BUILD.bazel b/third_party/cargo/vendor/core-video-sys-0.1.4/BUILD.bazel index 089c8b2..43fd558 100644 --- a/third_party/cargo/vendor/core-video-sys-0.1.4/BUILD.bazel +++ b/third_party/cargo/vendor/core-video-sys-0.1.4/BUILD.bazel @@ -55,7 +55,7 @@ rust_library( "//third_party/cargo/vendor/cfg-if-0.1.10:cfg_if", "//third_party/cargo/vendor/core-foundation-sys-0.7.0:core_foundation_sys", "//third_party/cargo/vendor/core-graphics-0.19.2:core_graphics", - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", "//third_party/cargo/vendor/objc-0.2.7:objc", ], ) diff --git a/third_party/cargo/vendor/crossbeam-channel-0.5.0/BUILD.bazel b/third_party/cargo/vendor/crossbeam-channel-0.5.0/BUILD.bazel index 24a5bc2..29be54f 100644 --- a/third_party/cargo/vendor/crossbeam-channel-0.5.0/BUILD.bazel +++ b/third_party/cargo/vendor/crossbeam-channel-0.5.0/BUILD.bazel @@ -61,7 +61,7 @@ rust_library( # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/cfg-if-1.0.0:cfg_if", - "//third_party/cargo/vendor/crossbeam-utils-0.8.1:crossbeam_utils", + "//third_party/cargo/vendor/crossbeam-utils-0.8.3:crossbeam_utils", ], ) diff --git a/third_party/cargo/vendor/crossbeam-deque-0.8.0/BUILD.bazel b/third_party/cargo/vendor/crossbeam-deque-0.8.0/BUILD.bazel index f1d56d8..519f7df 100644 --- a/third_party/cargo/vendor/crossbeam-deque-0.8.0/BUILD.bazel +++ b/third_party/cargo/vendor/crossbeam-deque-0.8.0/BUILD.bazel @@ -54,8 +54,8 @@ rust_library( # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/cfg-if-1.0.0:cfg_if", - "//third_party/cargo/vendor/crossbeam-epoch-0.9.1:crossbeam_epoch", - "//third_party/cargo/vendor/crossbeam-utils-0.8.1:crossbeam_utils", + "//third_party/cargo/vendor/crossbeam-epoch-0.9.3:crossbeam_epoch", + "//third_party/cargo/vendor/crossbeam-utils-0.8.3:crossbeam_utils", ], ) diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/.cargo-checksum.json b/third_party/cargo/vendor/crossbeam-epoch-0.9.1/.cargo-checksum.json deleted file mode 100644 index ebdb01f..0000000 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"CHANGELOG.md":"be05797b229bfb486c7b0432093aedc6be1129543979aad352f3e2c8b6ecb0e1","Cargo.lock":"701958899c3aeb45c5a8e46c7478f8899b85649c7f66ce63d0e6a5c3209f1ec1","Cargo.toml":"91e77f6969e25d10b83e69dc1274321329045712c7e7d389be20bc250b4409c1","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","README.md":"dbab340cd33d900cf38d5bdee509e09ef7ec3c490c7b47931e840cefec1f1d53","benches/defer.rs":"c330b704d96b2ad1aed29f72c37a99da534adef8cb06a3976d5f93bf567abb20","benches/flush.rs":"0389ac6c473632f0e93c962f223404cc360257f6699b4ec90b9b3be16bb6d74f","benches/pin.rs":"80f9e65ba04a2ddec7a330172d0b0fbc698e20c221b3d8cdc70cc42e3b9099d1","examples/sanitize.rs":"30001550746a54d6a377f8913fa41c72bf85140d7e8777e07c38491a4e31664b","examples/treiber_stack.rs":"ce4a5f8da67f8497ab0321aaa1aed032ae343c0d36500f2e55a24e76230dedcb","src/atomic.rs":"b92192024336203b865496c8c398ce53ec15bd401eb98c85fa3634bcbd126f86","src/collector.rs":"c310be652b837f73048663c08e872bc14f64b4ae9030c34fe737e6fe0e2d768b","src/default.rs":"b2c9a86b392dc3d687b01abee61b479a6043c5c654a22b79e880f4226dcf65ae","src/deferred.rs":"1df28c99dad1e22ecad7515e829b78ba54bdbbce07ad0b7b122db22b7b215a1e","src/epoch.rs":"76dd63356d5bc52e741883d39abb636e4ccb04d20499fb2a0ce797bb81aa4e91","src/guard.rs":"55c56ca1b2fbc067ae21108f0f7de4be91e5b41df2492055b635ed436782dd52","src/internal.rs":"c6f0a79fb8bccbcc58c5db1135a9bc8a6fc69affaf346c5afb69aa725b46e2b7","src/lib.rs":"a4655d14fce9c4c028d9dd0c5d8ea56064eec1dbc0aef400a236d4ace3f49c7c","src/sync/list.rs":"b16e6dc7c2f94c8682926ea8627352f49ab2b464245b241cfc77b72fa1878dd3","src/sync/mod.rs":"2da979ca3a2293f7626a2e6a9ab2fad758d92e3d2bed6cc712ef59eeeea87eab","src/sync/queue.rs":"225d4878142c245226262346c18434436ffc35f14f15a600a3006758449cccb0"},"package":"a1aaa739f95311c2c7887a76863f500026092fb1dce0161dab577e559ef3569d"} \ No newline at end of file diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/Cargo.lock b/third_party/cargo/vendor/crossbeam-epoch-0.9.1/Cargo.lock deleted file mode 100644 index baebea0..0000000 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/Cargo.lock +++ /dev/null @@ -1,140 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -[[package]] -name = "autocfg" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "const_fn" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c478836e029dcef17fb47c89023448c64f781a046e0300e257ad8225ae59afab" - -[[package]] -name = "crossbeam-epoch" -version = "0.9.1" -dependencies = [ - "cfg-if 1.0.0", - "const_fn", - "crossbeam-utils", - "lazy_static", - "memoffset", - "rand", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d" -dependencies = [ - "autocfg", - "cfg-if 1.0.0", - "lazy_static", -] - -[[package]] -name = "getrandom" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "wasi", -] - -[[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.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614" - -[[package]] -name = "memoffset" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" -dependencies = [ - "autocfg", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom", - "libc", - "rand_chacha", - "rand_core", - "rand_hc", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/examples/treiber_stack.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.1/examples/treiber_stack.rs deleted file mode 100644 index a2c3c16..0000000 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/examples/treiber_stack.rs +++ /dev/null @@ -1,107 +0,0 @@ -use std::mem::ManuallyDrop; -use std::ptr; -use std::sync::atomic::Ordering::{Acquire, Relaxed, Release}; - -use crossbeam_epoch::{self as epoch, Atomic, Owned}; -use crossbeam_utils::thread::scope; - -/// Treiber's lock-free stack. -/// -/// Usable with any number of producers and consumers. -#[derive(Debug)] -pub struct TreiberStack { - head: Atomic>, -} - -#[derive(Debug)] -struct Node { - data: ManuallyDrop, - next: Atomic>, -} - -impl TreiberStack { - /// Creates a new, empty stack. - pub fn new() -> TreiberStack { - TreiberStack { - head: Atomic::null(), - } - } - - /// Pushes a value on top of the stack. - pub fn push(&self, t: T) { - let mut n = Owned::new(Node { - data: ManuallyDrop::new(t), - next: Atomic::null(), - }); - - let guard = epoch::pin(); - - loop { - let head = self.head.load(Relaxed, &guard); - n.next.store(head, Relaxed); - - match self.head.compare_and_set(head, n, Release, &guard) { - Ok(_) => break, - Err(e) => n = e.new, - } - } - } - - /// Attempts to pop the top element from the stack. - /// - /// Returns `None` if the stack is empty. - pub fn pop(&self) -> Option { - let guard = epoch::pin(); - loop { - let head = self.head.load(Acquire, &guard); - - match unsafe { head.as_ref() } { - Some(h) => { - let next = h.next.load(Relaxed, &guard); - - if self - .head - .compare_and_set(head, next, Relaxed, &guard) - .is_ok() - { - unsafe { - guard.defer_destroy(head); - return Some(ManuallyDrop::into_inner(ptr::read(&(*h).data))); - } - } - } - None => return None, - } - } - } - - /// Returns `true` if the stack is empty. - pub fn is_empty(&self) -> bool { - let guard = epoch::pin(); - self.head.load(Acquire, &guard).is_null() - } -} - -impl Drop for TreiberStack { - fn drop(&mut self) { - while self.pop().is_some() {} - } -} - -fn main() { - let stack = TreiberStack::new(); - - scope(|scope| { - for _ in 0..10 { - scope.spawn(|_| { - for i in 0..10_000 { - stack.push(i); - assert!(stack.pop().is_some()); - } - }); - } - }) - .unwrap(); - - assert!(stack.pop().is_none()); -} diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/lib.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/lib.rs deleted file mode 100644 index f64d16c..0000000 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/lib.rs +++ /dev/null @@ -1,91 +0,0 @@ -//! Epoch-based memory reclamation. -//! -//! An interesting problem concurrent collections deal with comes from the remove operation. -//! Suppose that a thread removes an element from a lock-free map, while another thread is reading -//! that same element at the same time. The first thread must wait until the second thread stops -//! reading the element. Only then it is safe to destruct it. -//! -//! Programming languages that come with garbage collectors solve this problem trivially. The -//! garbage collector will destruct the removed element when no thread can hold a reference to it -//! anymore. -//! -//! This crate implements a basic memory reclamation mechanism, which is based on epochs. When an -//! element gets removed from a concurrent collection, it is inserted into a pile of garbage and -//! marked with the current epoch. Every time a thread accesses a collection, it checks the current -//! epoch, attempts to increment it, and destructs some garbage that became so old that no thread -//! can be referencing it anymore. -//! -//! That is the general mechanism behind epoch-based memory reclamation, but the details are a bit -//! more complicated. Anyhow, memory reclamation is designed to be fully automatic and something -//! users of concurrent collections don't have to worry much about. -//! -//! # Pointers -//! -//! Concurrent collections are built using atomic pointers. This module provides [`Atomic`], which -//! is just a shared atomic pointer to a heap-allocated object. Loading an [`Atomic`] yields a -//! [`Shared`], which is an epoch-protected pointer through which the loaded object can be safely -//! read. -//! -//! # Pinning -//! -//! Before an [`Atomic`] can be loaded, a participant must be [`pin`]ned. By pinning a participant -//! we declare that any object that gets removed from now on must not be destructed just -//! yet. Garbage collection of newly removed objects is suspended until the participant gets -//! unpinned. -//! -//! # Garbage -//! -//! Objects that get removed from concurrent collections must be stashed away until all currently -//! pinned participants get unpinned. Such objects can be stored into a thread-local or global -//! storage, where they are kept until the right time for their destruction comes. -//! -//! There is a global shared instance of garbage queue. You can [`defer`](Guard::defer) the execution of an -//! arbitrary function until the global epoch is advanced enough. Most notably, concurrent data -//! structures may defer the deallocation of an object. -//! -//! # APIs -//! -//! For majority of use cases, just use the default garbage collector by invoking [`pin`]. If you -//! want to create your own garbage collector, use the [`Collector`] API. - -#![doc(test( - no_crate_inject, - attr( - deny(warnings, rust_2018_idioms), - allow(dead_code, unused_assignments, unused_variables) - ) -))] -#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)] -#![cfg_attr(not(feature = "std"), no_std)] -#![cfg_attr(feature = "nightly", feature(cfg_target_has_atomic))] -#![cfg_attr(feature = "nightly", feature(const_fn))] -// matches! requires Rust 1.42 -#![allow(clippy::match_like_matches_macro)] - -use cfg_if::cfg_if; - -#[cfg_attr(feature = "nightly", cfg(target_has_atomic = "ptr"))] -cfg_if! { - if #[cfg(feature = "alloc")] { - extern crate alloc; - - mod atomic; - mod collector; - mod deferred; - mod epoch; - mod guard; - mod internal; - mod sync; - - pub use self::atomic::{Pointable, Atomic, CompareAndSetError, CompareAndSetOrdering, Owned, Pointer, Shared}; - pub use self::collector::{Collector, LocalHandle}; - pub use self::guard::{unprotected, Guard}; - } -} - -cfg_if! { - if #[cfg(feature = "std")] { - mod default; - pub use self::default::{default_collector, is_pinned, pin}; - } -} diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/sync/mod.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/sync/mod.rs deleted file mode 100644 index f8eb259..0000000 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/sync/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -//! Synchronization primitives. - -pub mod list; -pub mod queue; diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.3/.cargo-checksum.json b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/.cargo-checksum.json new file mode 100644 index 0000000..978750d --- /dev/null +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"3ae06fc468a9975b0ed3da7cd1f93a51edea60a18bc7fe467cf3a07563c90485","Cargo.lock":"e00b7ed9777b1e2d7f09fcac026a3be2bc6d656f1525bc04aa6bd2c0397d918a","Cargo.toml":"6774e7951c84503066df48b29371d62f77fe528e26f3d189c9d10dd8f1de088d","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","README.md":"51a445c566bc8226b09e74e3b02a333771f301fcc503f4e5cca90b852da8e904","benches/defer.rs":"c330b704d96b2ad1aed29f72c37a99da534adef8cb06a3976d5f93bf567abb20","benches/flush.rs":"0389ac6c473632f0e93c962f223404cc360257f6699b4ec90b9b3be16bb6d74f","benches/pin.rs":"80f9e65ba04a2ddec7a330172d0b0fbc698e20c221b3d8cdc70cc42e3b9099d1","examples/sanitize.rs":"a39d1635fa61e643e59192d7a63becc97ff81f03c1f4e03d38cedefb1525026a","src/atomic.rs":"9e563bf42df63421478cc9e49ff4b7137fd4fd34a2053692b9dcd40c7958550b","src/collector.rs":"7d636f3f96fafd033298d1c2ab126205438a46deb84895d8e28bea9eef67798a","src/default.rs":"e1449bd6e61d7c19e9cbdf183f81c67c3487775fcc55572947874ca535d3d54f","src/deferred.rs":"1ee67bd3200d3891076aac8cfc9767abdddc194602f2084d11455484096005ea","src/epoch.rs":"d31e66d8fe62299928e25867336d96391b26a4fe890a1cae0885dfcf36d6835b","src/guard.rs":"55c56ca1b2fbc067ae21108f0f7de4be91e5b41df2492055b635ed436782dd52","src/internal.rs":"f3f8131819b2a4ec4d1a6d392c734688324f3ae708bac6745e88f2930657eba1","src/lib.rs":"b3ca8101d9dffd3da057794fd1a56495cc225adc1f5fff477c5d4706ce0aae3f","src/sync/list.rs":"10aa4c59845ab9ff1d8bcb6f594b70bbe23c320fa7a2b125fdf85df88b9d61e2","src/sync/mod.rs":"cbc6334460d73761c3dea7f99ed2ccbf267d5da3bc76c812e94f85c9f4565c6a","src/sync/queue.rs":"262e0d8f343e97df9e2a738461e4255e339710e81c479e484f9efe517ae47135","tests/loom.rs":"db772f4478966de6ec98774ca4093171dc942da635822a0d2d3257d31188cb9b"},"package":"2584f639eb95fea8c798496315b297cf81b9b58b6d30ab066a75455333cf4b12"} \ No newline at end of file diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/BUILD.bazel b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/BUILD.bazel similarity index 82% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/BUILD.bazel rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/BUILD.bazel index faf53be..c16871e 100644 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/BUILD.bazel +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/BUILD.bazel @@ -38,8 +38,6 @@ licenses([ # Unsupported target "sanitize" with type "example" omitted -# Unsupported target "treiber_stack" with type "example" omitted - rust_library( name = "crossbeam_epoch", srcs = glob(["**/*.rs"]), @@ -52,9 +50,6 @@ rust_library( crate_type = "lib", data = [], edition = "2018", - proc_macro_deps = [ - "//third_party/cargo/vendor/const_fn-0.4.5:const_fn", - ], rustc_flags = [ "--cap-lints=allow", ], @@ -62,13 +57,15 @@ rust_library( "cargo-raze", "manual", ], - version = "0.9.1", + version = "0.9.3", # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/cfg-if-1.0.0:cfg_if", - "//third_party/cargo/vendor/crossbeam-utils-0.8.1:crossbeam_utils", + "//third_party/cargo/vendor/crossbeam-utils-0.8.3:crossbeam_utils", "//third_party/cargo/vendor/lazy_static-1.4.0:lazy_static", - "//third_party/cargo/vendor/memoffset-0.6.1:memoffset", + "//third_party/cargo/vendor/memoffset-0.6.3:memoffset", "//third_party/cargo/vendor/scopeguard-1.1.0:scopeguard", ], ) + +# Unsupported target "loom" with type "test" omitted diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/CHANGELOG.md b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/CHANGELOG.md similarity index 86% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/CHANGELOG.md rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/CHANGELOG.md index 0e154a6..0f30b70 100644 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/CHANGELOG.md +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/CHANGELOG.md @@ -1,3 +1,14 @@ +# Version 0.9.3 + +- Make `loom` dependency optional. (#666) + +# Version 0.9.2 + +- Add `Atomic::compare_exchange` and `Atomic::compare_exchange_weak`. (#628) +- Deprecate `Atomic::compare_and_set` and `Atomic::compare_and_set_weak`. Use `Atomic::compare_exchange` or `Atomic::compare_exchange_weak` instead. (#628) +- Make `const_fn` dependency optional. (#611) +- Add unstable support for `loom`. (#487) + # Version 0.9.1 - Bump `memoffset` dependency to version 0.6. (#592) diff --git a/third_party/cargo/vendor/regex-1.4.2/Cargo.lock b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/Cargo.lock similarity index 50% rename from third_party/cargo/vendor/regex-1.4.2/Cargo.lock rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/Cargo.lock index 186763b..fd37e90 100644 --- a/third_party/cargo/vendor/regex-1.4.2/Cargo.lock +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/Cargo.lock @@ -1,40 +1,80 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -[[package]] -name = "aho-corasick" -version = "0.7.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b476ce7103678b0c6d3d395dbbae31d48ff910bd28be979ba5d48c6351131d0d" -dependencies = [ - "memchr", -] +version = 3 [[package]] name = "autocfg" -version = "0.1.7" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] -name = "bitflags" -version = "1.2.1" +name = "cc" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" [[package]] -name = "cloudabi" -version = "0.0.3" +name = "cfg-if" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const_fn" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6" + +[[package]] +name = "crossbeam-epoch" +version = "0.9.3" dependencies = [ - "bitflags", + "cfg-if", + "const_fn", + "crossbeam-utils", + "lazy_static", + "loom", + "memoffset", + "rand", + "scopeguard", ] [[package]] -name = "fuchsia-cprng" -version = "0.1.1" +name = "crossbeam-utils" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" +dependencies = [ + "autocfg", + "cfg-if", + "lazy_static", + "loom", +] + +[[package]] +name = "generator" +version = "0.6.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9fed24fd1e18827652b4d55652899a1e9da8e54d91624dc3437a5bc3a9f9a9c" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "winapi", +] + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] [[package]] name = "lazy_static" @@ -44,168 +84,108 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.80" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" [[package]] -name = "memchr" -version = "2.3.4" +name = "log" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" - -[[package]] -name = "quickcheck" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c35d9c36a562f37eca96e79f66d5fd56eefbc22560dacc4a864cabd2d277456" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "rand", - "rand_core 0.4.2", + "cfg-if", ] [[package]] -name = "rand" -version = "0.6.5" +name = "loom" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +checksum = "d44c73b4636e497b4917eb21c33539efa3816741a2d3ff26c6316f1b529481a4" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", +] + +[[package]] +name = "memoffset" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" dependencies = [ "autocfg", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "rand" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +dependencies = [ "libc", "rand_chacha", - "rand_core 0.4.2", + "rand_core", "rand_hc", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg", - "rand_xorshift", - "winapi", ] [[package]] name = "rand_chacha" -version = "0.1.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" dependencies = [ - "autocfg", - "rand_core 0.3.1", + "ppv-lite86", + "rand_core", ] [[package]] name = "rand_core" -version = "0.3.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" dependencies = [ - "rand_core 0.4.2", + "getrandom", ] -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - [[package]] name = "rand_hc" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" dependencies = [ - "rand_core 0.3.1", + "rand_core", ] [[package]] -name = "rand_isaac" -version = "0.1.1" +name = "rustversion" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] +checksum = "cb5d2a036dc6d2d8fd16fde3498b04306e29bd193bf306a57427019b823d5acd" [[package]] -name = "rand_jitter" -version = "0.1.4" +name = "scoped-tls" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi", -] +checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" [[package]] -name = "rand_os" -version = "0.1.3" +name = "scopeguard" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi", -] +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] -name = "rand_pcg" -version = "0.1.2" +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg", - "rand_core 0.4.2", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "regex" -version = "1.4.2" -dependencies = [ - "aho-corasick", - "lazy_static", - "memchr", - "quickcheck", - "rand", - "regex-syntax", - "thread_local", -] - -[[package]] -name = "regex-syntax" -version = "0.6.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" - -[[package]] -name = "thread_local" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" -dependencies = [ - "lazy_static", -] +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "winapi" diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/Cargo.toml b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/Cargo.toml similarity index 85% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/Cargo.toml rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/Cargo.toml index e14da07..2d7eb00 100644 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/Cargo.toml +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/Cargo.toml @@ -13,12 +13,11 @@ [package] edition = "2018" name = "crossbeam-epoch" -version = "0.9.1" +version = "0.9.3" authors = ["The Crossbeam Project Developers"] description = "Epoch-based garbage collection" homepage = "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-epoch" documentation = "https://docs.rs/crossbeam-epoch" -readme = "README.md" keywords = ["lock-free", "rcu", "atomic", "garbage"] categories = ["concurrency", "memory-management", "no-std"] license = "MIT OR Apache-2.0" @@ -27,10 +26,11 @@ repository = "https://github.com/crossbeam-rs/crossbeam" version = "1" [dependencies.const_fn] -version = "0.4" +version = "0.4.4" +optional = true [dependencies.crossbeam-utils] -version = "0.8" +version = "0.8.3" default-features = false [dependencies.lazy_static] @@ -44,11 +44,15 @@ version = "0.6" version = "1.1.0" default-features = false [dev-dependencies.rand] -version = "0.7.3" +version = "0.8" [features] alloc = [] default = ["std"] -nightly = ["crossbeam-utils/nightly"] -sanitize = [] +loom = ["loom-crate", "crossbeam-utils/loom"] +nightly = ["crossbeam-utils/nightly", "const_fn"] std = ["alloc", "crossbeam-utils/std", "lazy_static"] +[target."cfg(crossbeam_loom)".dependencies.loom-crate] +version = "0.4" +optional = true +package = "loom" diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/LICENSE-APACHE b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/LICENSE-APACHE rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/LICENSE-APACHE diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/LICENSE-MIT b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/LICENSE-MIT rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/LICENSE-MIT diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/README.md b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/README.md similarity index 93% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/README.md rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/README.md index 7e3d3a9..c8ebd87 100644 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/README.md +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/README.md @@ -2,7 +2,7 @@ [![Build Status](https://github.com/crossbeam-rs/crossbeam/workflows/CI/badge.svg)]( https://github.com/crossbeam-rs/crossbeam/actions) -[![License](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)]( +[![License](https://img.shields.io/badge/license-MIT_OR_Apache--2.0-blue.svg)]( https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-epoch#license) [![Cargo](https://img.shields.io/crates/v/crossbeam-epoch.svg)]( https://crates.io/crates/crossbeam-epoch) @@ -20,7 +20,7 @@ immediately. Epoch-based GC is an efficient mechanism for deferring destruction shared objects until no pointers to them can exist. Everything in this crate except the global GC can be used in `no_std` environments, provided that -features `alloc` and `nightly` are enabled. +`alloc` feature is enabled. ## Usage diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/benches/defer.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/benches/defer.rs similarity index 100% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/benches/defer.rs rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/benches/defer.rs diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/benches/flush.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/benches/flush.rs similarity index 100% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/benches/flush.rs rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/benches/flush.rs diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/benches/pin.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/benches/pin.rs similarity index 100% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/benches/pin.rs rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/benches/pin.rs diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/examples/sanitize.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/examples/sanitize.rs similarity index 96% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/examples/sanitize.rs rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/examples/sanitize.rs index 5110f8a..4109c34 100644 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/examples/sanitize.rs +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/examples/sanitize.rs @@ -14,7 +14,7 @@ fn worker(a: Arc>, handle: LocalHandle) -> usize { if rng.gen() { thread::sleep(Duration::from_millis(1)); } - let timeout = Duration::from_millis(rng.gen_range(0, 10)); + let timeout = Duration::from_millis(rng.gen_range(0..10)); let now = Instant::now(); while now.elapsed() < timeout { diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/atomic.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/atomic.rs similarity index 84% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/atomic.rs rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/atomic.rs index 5177187..e4ca23f 100644 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/atomic.rs +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/atomic.rs @@ -5,12 +5,12 @@ use core::marker::PhantomData; use core::mem::{self, MaybeUninit}; use core::ops::{Deref, DerefMut}; use core::slice; -use core::sync::atomic::{AtomicUsize, Ordering}; +use core::sync::atomic::Ordering; use crate::alloc::alloc; use crate::alloc::boxed::Box; use crate::guard::Guard; -use const_fn::const_fn; +use crate::primitive::sync::atomic::AtomicUsize; use crossbeam_utils::atomic::AtomicConsume; /// Given ordering for the success case in a compare-exchange operation, returns the strongest @@ -26,7 +26,12 @@ fn strongest_failure_ordering(ord: Ordering) -> Ordering { } /// The error returned on failed compare-and-set operation. -pub struct CompareAndSetError<'g, T: ?Sized + Pointable, P: Pointer> { +// TODO: remove in the next major version. +#[deprecated(note = "Use `CompareExchangeError` instead")] +pub type CompareAndSetError<'g, T, P> = CompareExchangeError<'g, T, P>; + +/// The error returned on failed compare-and-swap operation. +pub struct CompareExchangeError<'g, T: ?Sized + Pointable, P: Pointer> { /// The value in the atomic pointer at the time of the failed operation. pub current: Shared<'g, T>, @@ -34,9 +39,9 @@ pub struct CompareAndSetError<'g, T: ?Sized + Pointable, P: Pointer> { pub new: P, } -impl<'g, T: 'g, P: Pointer + fmt::Debug> fmt::Debug for CompareAndSetError<'g, T, P> { +impl + fmt::Debug> fmt::Debug for CompareExchangeError<'_, T, P> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("CompareAndSetError") + f.debug_struct("CompareExchangeError") .field("current", &self.current) .field("new", &self.new) .finish() @@ -54,6 +59,11 @@ impl<'g, T: 'g, P: Pointer + fmt::Debug> fmt::Debug for CompareAndSetError<'g /// ordering is chosen. /// 2. A pair of `Ordering`s. The first one is for the success case, while the second one is /// for the failure case. +// TODO: remove in the next major version. +#[deprecated( + note = "`compare_and_set` and `compare_and_set_weak` that use this trait are deprecated, \ + use `compare_exchange` or `compare_exchange_weak instead`" +)] pub trait CompareAndSetOrdering { /// The ordering of the operation when it succeeds. fn success(&self) -> Ordering; @@ -65,6 +75,7 @@ pub trait CompareAndSetOrdering { fn failure(&self) -> Ordering; } +#[allow(deprecated)] impl CompareAndSetOrdering for Ordering { #[inline] fn success(&self) -> Ordering { @@ -77,6 +88,7 @@ impl CompareAndSetOrdering for Ordering { } } +#[allow(deprecated)] impl CompareAndSetOrdering for (Ordering, Ordering) { #[inline] fn success(&self) -> Ordering { @@ -327,8 +339,8 @@ impl Atomic { /// let a = Atomic::::null(); /// ``` /// - #[const_fn(feature = "nightly")] - pub const fn null() -> Atomic { + #[cfg_attr(all(feature = "nightly", not(crossbeam_loom)), const_fn::const_fn)] + pub fn null() -> Atomic { Self { data: AtomicUsize::new(0), _marker: PhantomData, @@ -426,8 +438,14 @@ impl Atomic { /// pointer that was written is returned. On failure the actual current value and `new` are /// returned. /// - /// This method takes a [`CompareAndSetOrdering`] argument which describes the memory - /// ordering of this operation. + /// This method 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` + /// and must be equivalent to or weaker than the success ordering. /// /// # Examples /// @@ -439,30 +457,160 @@ impl Atomic { /// /// let guard = &epoch::pin(); /// let curr = a.load(SeqCst, guard); + /// let res1 = a.compare_exchange(curr, Shared::null(), SeqCst, SeqCst, guard); + /// let res2 = a.compare_exchange(curr, Owned::new(5678), SeqCst, SeqCst, guard); + /// ``` + pub fn compare_exchange<'g, P>( + &self, + current: Shared<'_, T>, + new: P, + success: Ordering, + failure: Ordering, + _: &'g Guard, + ) -> Result, CompareExchangeError<'g, T, P>> + where + P: Pointer, + { + let new = new.into_usize(); + self.data + .compare_exchange(current.into_usize(), new, success, failure) + .map(|_| unsafe { Shared::from_usize(new) }) + .map_err(|current| unsafe { + CompareExchangeError { + current: Shared::from_usize(current), + new: P::from_usize(new), + } + }) + } + + /// Stores the pointer `new` (either `Shared` or `Owned`) into the atomic pointer if the current + /// value is the same as `current`. The tag is also taken into account, so two pointers to the + /// same object, but with different tags, will not be considered equal. + /// + /// Unlike [`compare_exchange`], this method is allowed to spuriously fail even when comparison + /// succeeds, which can result in more efficient code on some platforms. The return value is a + /// result indicating whether the new pointer was written. On success the pointer that was + /// written is returned. On failure the actual current value and `new` are returned. + /// + /// This method 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` + /// and must be equivalent to or weaker than the success ordering. + /// + /// [`compare_exchange`]: Atomic::compare_exchange + /// + /// # Examples + /// + /// ``` + /// use crossbeam_epoch::{self as epoch, Atomic, Owned, Shared}; + /// use std::sync::atomic::Ordering::SeqCst; + /// + /// let a = Atomic::new(1234); + /// let guard = &epoch::pin(); + /// + /// let mut new = Owned::new(5678); + /// let mut ptr = a.load(SeqCst, guard); + /// loop { + /// match a.compare_exchange_weak(ptr, new, SeqCst, SeqCst, guard) { + /// Ok(p) => { + /// ptr = p; + /// break; + /// } + /// Err(err) => { + /// ptr = err.current; + /// new = err.new; + /// } + /// } + /// } + /// + /// let mut curr = a.load(SeqCst, guard); + /// loop { + /// match a.compare_exchange_weak(curr, Shared::null(), SeqCst, SeqCst, guard) { + /// Ok(_) => break, + /// Err(err) => curr = err.current, + /// } + /// } + /// ``` + pub fn compare_exchange_weak<'g, P>( + &self, + current: Shared<'_, T>, + new: P, + success: Ordering, + failure: Ordering, + _: &'g Guard, + ) -> Result, CompareExchangeError<'g, T, P>> + where + P: Pointer, + { + let new = new.into_usize(); + self.data + .compare_exchange_weak(current.into_usize(), new, success, failure) + .map(|_| unsafe { Shared::from_usize(new) }) + .map_err(|current| unsafe { + CompareExchangeError { + current: Shared::from_usize(current), + new: P::from_usize(new), + } + }) + } + + /// Stores the pointer `new` (either `Shared` or `Owned`) into the atomic pointer if the current + /// value is the same as `current`. The tag is also taken into account, so two pointers to the + /// same object, but with different tags, will not be considered equal. + /// + /// The return value is a result indicating whether the new pointer was written. On success the + /// pointer that was written is returned. On failure the actual current value and `new` are + /// returned. + /// + /// This method takes a [`CompareAndSetOrdering`] argument which describes the memory + /// ordering of this operation. + /// + /// # Migrating to `compare_exchange` + /// + /// `compare_and_set` is equivalent to `compare_exchange` with the following mapping for + /// memory orderings: + /// + /// Original | Success | Failure + /// -------- | ------- | ------- + /// Relaxed | Relaxed | Relaxed + /// Acquire | Acquire | Acquire + /// Release | Release | Relaxed + /// AcqRel | AcqRel | Acquire + /// SeqCst | SeqCst | SeqCst + /// + /// # Examples + /// + /// ``` + /// # #![allow(deprecated)] + /// use crossbeam_epoch::{self as epoch, Atomic, Owned, Shared}; + /// use std::sync::atomic::Ordering::SeqCst; + /// + /// let a = Atomic::new(1234); + /// + /// let guard = &epoch::pin(); + /// let curr = a.load(SeqCst, guard); /// let res1 = a.compare_and_set(curr, Shared::null(), SeqCst, guard); /// let res2 = a.compare_and_set(curr, Owned::new(5678), SeqCst, guard); /// ``` + // TODO: remove in the next major version. + #[allow(deprecated)] + #[deprecated(note = "Use `compare_exchange` instead")] pub fn compare_and_set<'g, O, P>( &self, current: Shared<'_, T>, new: P, ord: O, - _: &'g Guard, + guard: &'g Guard, ) -> Result, CompareAndSetError<'g, T, P>> where O: CompareAndSetOrdering, P: Pointer, { - let new = new.into_usize(); - self.data - .compare_exchange(current.into_usize(), new, ord.success(), ord.failure()) - .map(|_| unsafe { Shared::from_usize(new) }) - .map_err(|current| unsafe { - CompareAndSetError { - current: Shared::from_usize(current), - new: P::from_usize(new), - } - }) + self.compare_exchange(current, new, ord.success(), ord.failure(), guard) } /// Stores the pointer `new` (either `Shared` or `Owned`) into the atomic pointer if the current @@ -479,9 +627,23 @@ impl Atomic { /// /// [`compare_and_set`]: Atomic::compare_and_set /// + /// # Migrating to `compare_exchange_weak` + /// + /// `compare_and_set_weak` is equivalent to `compare_exchange_weak` with the following mapping for + /// memory orderings: + /// + /// Original | Success | Failure + /// -------- | ------- | ------- + /// Relaxed | Relaxed | Relaxed + /// Acquire | Acquire | Acquire + /// Release | Release | Relaxed + /// AcqRel | AcqRel | Acquire + /// SeqCst | SeqCst | SeqCst + /// /// # Examples /// /// ``` + /// # #![allow(deprecated)] /// use crossbeam_epoch::{self as epoch, Atomic, Owned, Shared}; /// use std::sync::atomic::Ordering::SeqCst; /// @@ -511,27 +673,21 @@ impl Atomic { /// } /// } /// ``` + // TODO: remove in the next major version. + #[allow(deprecated)] + #[deprecated(note = "Use `compare_exchange_weak` instead")] pub fn compare_and_set_weak<'g, O, P>( &self, current: Shared<'_, T>, new: P, ord: O, - _: &'g Guard, + guard: &'g Guard, ) -> Result, CompareAndSetError<'g, T, P>> where O: CompareAndSetOrdering, P: Pointer, { - let new = new.into_usize(); - self.data - .compare_exchange_weak(current.into_usize(), new, ord.success(), ord.failure()) - .map(|_| unsafe { Shared::from_usize(new) }) - .map_err(|current| unsafe { - CompareAndSetError { - current: Shared::from_usize(current), - new: P::from_usize(new), - } - }) + self.compare_exchange_weak(current, new, ord.success(), ord.failure(), guard) } /// Bitwise "and" with the current tag. @@ -638,7 +794,17 @@ impl Atomic { /// } /// ``` pub unsafe fn into_owned(self) -> Owned { - Owned::from_usize(self.data.into_inner()) + #[cfg(crossbeam_loom)] + { + // FIXME: loom does not yet support into_inner, so we use unsync_load for now, + // which should have the same synchronization properties: + // https://github.com/tokio-rs/loom/issues/117 + Owned::from_usize(self.data.unsync_load()) + } + #[cfg(not(crossbeam_loom))] + { + Owned::from_usize(self.data.into_inner()) + } } } @@ -1358,7 +1524,7 @@ impl Default for Shared<'_, T> { } } -#[cfg(test)] +#[cfg(all(test, not(crossbeam_loom)))] mod tests { use super::Shared; @@ -1371,4 +1537,11 @@ mod tests { fn valid_tag_i64() { Shared::::null().with_tag(7); } + + #[cfg(feature = "nightly")] + #[test] + fn const_atomic_null() { + use super::Atomic; + const _: Atomic = Atomic::::null(); + } } diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/collector.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/collector.rs similarity index 96% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/collector.rs rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/collector.rs index 8224e11..7cfb819 100644 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/collector.rs +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/collector.rs @@ -14,9 +14,9 @@ /// ``` use core::fmt; -use crate::alloc::sync::Arc; use crate::guard::Guard; use crate::internal::{Global, Local}; +use crate::primitive::sync::Arc; /// An epoch-based garbage collector. pub struct Collector { @@ -109,7 +109,7 @@ impl fmt::Debug for LocalHandle { } } -#[cfg(test)] +#[cfg(all(test, not(crossbeam_loom)))] mod tests { use std::mem; use std::sync::atomic::{AtomicUsize, Ordering}; @@ -151,9 +151,9 @@ mod tests { let a = Owned::new(7).into_shared(guard); guard.defer_destroy(a); - assert!(!(*(*guard.local).bag.get()).is_empty()); + assert!(!(*guard.local).bag.with(|b| (*b).is_empty())); - while !(*(*guard.local).bag.get()).is_empty() { + while !(*guard.local).bag.with(|b| (*b).is_empty()) { guard.flush(); } } @@ -172,7 +172,7 @@ mod tests { let a = Owned::new(7).into_shared(guard); guard.defer_destroy(a); } - assert!(!(*(*guard.local).bag.get()).is_empty()); + assert!(!(*guard.local).bag.with(|b| (*b).is_empty())); } } @@ -199,6 +199,7 @@ mod tests { .unwrap(); } + #[cfg(not(crossbeam_sanitize))] // TODO: assertions failed due to `cfg(crossbeam_sanitize)` reduce `internal::MAX_OBJECTS` #[test] fn incremental() { const COUNT: usize = 100_000; diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/default.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/default.rs similarity index 95% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/default.rs rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/default.rs index 1deac21..b7797ce 100644 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/default.rs +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/default.rs @@ -6,7 +6,7 @@ use crate::collector::{Collector, LocalHandle}; use crate::guard::Guard; -use lazy_static::lazy_static; +use crate::primitive::{lazy_static, thread_local}; lazy_static! { /// The global data for the default garbage collector. @@ -45,7 +45,7 @@ where .unwrap_or_else(|_| f(&COLLECTOR.register())) } -#[cfg(test)] +#[cfg(all(test, not(crossbeam_loom)))] mod tests { use crossbeam_utils::thread; diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/deferred.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/deferred.rs similarity index 96% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/deferred.rs rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/deferred.rs index 9f4869b..d953c46 100644 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/deferred.rs +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/deferred.rs @@ -16,7 +16,7 @@ type Data = [usize; DATA_WORDS]; /// A `FnOnce()` that is stored inline if small, or otherwise boxed on the heap. /// /// This is a handy way of keeping an unsized `FnOnce()` within a sized structure. -pub struct Deferred { +pub(crate) struct Deferred { call: unsafe fn(*mut u8), data: Data, _marker: PhantomData<*mut ()>, // !Send + !Sync @@ -30,7 +30,7 @@ impl fmt::Debug for Deferred { impl Deferred { /// Constructs a new `Deferred` from a `FnOnce()`. - pub fn new(f: F) -> Self { + pub(crate) fn new(f: F) -> Self { let size = mem::size_of::(); let align = mem::align_of::(); @@ -73,13 +73,13 @@ impl Deferred { /// Calls the function. #[inline] - pub fn call(mut self) { + pub(crate) fn call(mut self) { let call = self.call; unsafe { call(&mut self.data as *mut Data as *mut u8) }; } } -#[cfg(test)] +#[cfg(all(test, not(crossbeam_loom)))] mod tests { use super::Deferred; use std::cell::Cell; diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/epoch.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/epoch.rs similarity index 61% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/epoch.rs rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/epoch.rs index e7759d9..663508b 100644 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/epoch.rs +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/epoch.rs @@ -7,14 +7,15 @@ //! If an object became garbage in some epoch, then we can be sure that after two advancements no //! participant will hold a reference to it. That is the crux of safe memory reclamation. -use core::sync::atomic::{AtomicUsize, Ordering}; +use crate::primitive::sync::atomic::AtomicUsize; +use core::sync::atomic::Ordering; /// An epoch that can be marked as pinned or unpinned. /// /// Internally, the epoch is represented as an integer that wraps around at some unspecified point /// and a flag that represents whether it is pinned or unpinned. #[derive(Copy, Clone, Default, Debug, Eq, PartialEq)] -pub struct Epoch { +pub(crate) struct Epoch { /// The least significant bit is set if pinned. The rest of the bits hold the epoch. data: usize, } @@ -22,7 +23,7 @@ pub struct Epoch { impl Epoch { /// Returns the starting epoch in unpinned state. #[inline] - pub fn starting() -> Self { + pub(crate) fn starting() -> Self { Self::default() } @@ -30,7 +31,7 @@ impl Epoch { /// /// Internally, epochs are represented as numbers in the range `(isize::MIN / 2) .. (isize::MAX /// / 2)`, so the returned distance will be in the same interval. - pub fn wrapping_sub(self, rhs: Self) -> isize { + pub(crate) fn wrapping_sub(self, rhs: Self) -> isize { // The result is the same with `(self.data & !1).wrapping_sub(rhs.data & !1) as isize >> 1`, // because the possible difference of LSB in `(self.data & !1).wrapping_sub(rhs.data & !1)` // will be ignored in the shift operation. @@ -39,13 +40,13 @@ impl Epoch { /// Returns `true` if the epoch is marked as pinned. #[inline] - pub fn is_pinned(self) -> bool { + pub(crate) fn is_pinned(self) -> bool { (self.data & 1) == 1 } /// Returns the same epoch, but marked as pinned. #[inline] - pub fn pinned(self) -> Epoch { + pub(crate) fn pinned(self) -> Epoch { Epoch { data: self.data | 1, } @@ -53,7 +54,7 @@ impl Epoch { /// Returns the same epoch, but marked as unpinned. #[inline] - pub fn unpinned(self) -> Epoch { + pub(crate) fn unpinned(self) -> Epoch { Epoch { data: self.data & !1, } @@ -63,7 +64,7 @@ impl Epoch { /// /// The returned epoch will be marked as pinned only if the previous one was as well. #[inline] - pub fn successor(self) -> Epoch { + pub(crate) fn successor(self) -> Epoch { Epoch { data: self.data.wrapping_add(2), } @@ -72,7 +73,7 @@ impl Epoch { /// An atomic value that holds an `Epoch`. #[derive(Default, Debug)] -pub struct AtomicEpoch { +pub(crate) struct AtomicEpoch { /// Since `Epoch` is just a wrapper around `usize`, an `AtomicEpoch` is similarly represented /// using an `AtomicUsize`. data: AtomicUsize, @@ -81,14 +82,14 @@ pub struct AtomicEpoch { impl AtomicEpoch { /// Creates a new atomic epoch. #[inline] - pub fn new(epoch: Epoch) -> Self { + pub(crate) fn new(epoch: Epoch) -> Self { let data = AtomicUsize::new(epoch.data); AtomicEpoch { data } } /// Loads a value from the atomic epoch. #[inline] - pub fn load(&self, ord: Ordering) -> Epoch { + pub(crate) fn load(&self, ord: Ordering) -> Epoch { Epoch { data: self.data.load(ord), } @@ -96,19 +97,37 @@ impl AtomicEpoch { /// Stores a value into the atomic epoch. #[inline] - pub fn store(&self, epoch: Epoch, ord: Ordering) { + pub(crate) fn store(&self, epoch: Epoch, ord: Ordering) { self.data.store(epoch.data, ord); } /// Stores a value into the atomic epoch if the current value is the same as `current`. /// - /// The return value is always the previous value. If it is equal to `current`, then the value - /// is updated. + /// 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`. /// - /// The `Ordering` argument describes the memory ordering of this operation. + /// This method 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` + /// and must be equivalent to or weaker than the success ordering. #[inline] - pub fn compare_and_swap(&self, current: Epoch, new: Epoch, ord: Ordering) -> Epoch { - let data = self.data.compare_and_swap(current.data, new.data, ord); - Epoch { data } + pub(crate) fn compare_exchange( + &self, + current: Epoch, + new: Epoch, + success: Ordering, + failure: Ordering, + ) -> Result { + match self + .data + .compare_exchange(current.data, new.data, success, failure) + { + Ok(data) => Ok(Epoch { data }), + Err(data) => Err(Epoch { data }), + } } } diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/guard.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/guard.rs similarity index 100% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/guard.rs rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/guard.rs diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/internal.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/internal.rs similarity index 90% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/internal.rs rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/internal.rs index bf2dfb8..966bceb 100644 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/internal.rs +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/internal.rs @@ -35,10 +35,11 @@ //! Ideally each instance of concurrent data structure may have its own queue that gets fully //! destroyed as soon as the data structure gets dropped. -use core::cell::{Cell, UnsafeCell}; +use crate::primitive::cell::UnsafeCell; +use crate::primitive::sync::atomic; +use core::cell::Cell; use core::mem::{self, ManuallyDrop}; use core::num::Wrapping; -use core::sync::atomic; use core::sync::atomic::Ordering; use core::{fmt, ptr}; @@ -54,13 +55,13 @@ use crate::sync::list::{Entry, IsElement, IterError, List}; use crate::sync::queue::Queue; /// Maximum number of objects a bag can contain. -#[cfg(not(feature = "sanitize"))] +#[cfg(not(crossbeam_sanitize))] const MAX_OBJECTS: usize = 62; -#[cfg(feature = "sanitize")] +#[cfg(crossbeam_sanitize)] const MAX_OBJECTS: usize = 4; /// A bag of deferred functions. -pub struct Bag { +pub(crate) struct Bag { /// Stashed objects. deferreds: [Deferred; MAX_OBJECTS], len: usize, @@ -71,12 +72,12 @@ unsafe impl Send for Bag {} impl Bag { /// Returns a new, empty bag. - pub fn new() -> Self { + pub(crate) fn new() -> Self { Self::default() } /// Returns `true` if the bag is empty. - pub fn is_empty(&self) -> bool { + pub(crate) fn is_empty(&self) -> bool { self.len == 0 } @@ -88,7 +89,7 @@ impl Bag { /// # Safety /// /// It should be safe for another thread to execute the given function. - pub unsafe fn try_push(&mut self, deferred: Deferred) -> Result<(), Deferred> { + pub(crate) unsafe fn try_push(&mut self, deferred: Deferred) -> Result<(), Deferred> { if self.len < MAX_OBJECTS { self.deferreds[self.len] = deferred; self.len += 1; @@ -108,7 +109,7 @@ impl Default for Bag { #[rustfmt::skip] fn default() -> Self { // TODO: [no_op; MAX_OBJECTS] syntax blocked by https://github.com/rust-lang/rust/issues/49147 - #[cfg(not(feature = "sanitize"))] + #[cfg(not(crossbeam_sanitize))] return Bag { len: 0, deferreds: [ @@ -176,7 +177,7 @@ impl Default for Bag { Deferred::new(no_op_func), ], }; - #[cfg(feature = "sanitize")] + #[cfg(crossbeam_sanitize)] return Bag { len: 0, deferreds: [ @@ -231,7 +232,7 @@ impl SealedBag { } /// The global data for a garbage collector. -pub struct Global { +pub(crate) struct Global { /// The intrusive linked list of `Local`s. locals: List, @@ -248,7 +249,7 @@ impl Global { /// Creates a new global data for garbage collection. #[inline] - pub fn new() -> Self { + pub(crate) fn new() -> Self { Self { locals: List::new(), queue: Queue::new(), @@ -257,7 +258,7 @@ impl Global { } /// Pushes the bag into the global queue and replaces the bag with a new empty bag. - pub fn push_bag(&self, bag: &mut Bag, guard: &Guard) { + pub(crate) fn push_bag(&self, bag: &mut Bag, guard: &Guard) { let bag = mem::replace(bag, Bag::new()); atomic::fence(Ordering::SeqCst); @@ -274,10 +275,10 @@ impl Global { /// path. In other words, we want the compiler to optimize branching for the case when /// `collect()` is not called. #[cold] - pub fn collect(&self, guard: &Guard) { + pub(crate) fn collect(&self, guard: &Guard) { let global_epoch = self.try_advance(guard); - let steps = if cfg!(feature = "sanitize") { + let steps = if cfg!(crossbeam_sanitize) { usize::max_value() } else { Self::COLLECT_STEPS @@ -303,7 +304,7 @@ impl Global { /// /// `try_advance()` is annotated `#[cold]` because it is rarely called. #[cold] - pub fn try_advance(&self, guard: &Guard) -> Epoch { + pub(crate) fn try_advance(&self, guard: &Guard) -> Epoch { let global_epoch = self.epoch.load(Ordering::Relaxed); atomic::fence(Ordering::SeqCst); @@ -345,7 +346,7 @@ impl Global { } /// Participant for garbage collection. -pub struct Local { +pub(crate) struct Local { /// A node in the intrusive linked list of `Local`s. entry: Entry, @@ -374,9 +375,13 @@ pub struct Local { // Make sure `Local` is less than or equal to 2048 bytes. // https://github.com/crossbeam-rs/crossbeam/issues/551 +#[cfg(not(crossbeam_sanitize))] // `crossbeam_sanitize` reduces the size of `Local` #[test] fn local_size() { - assert!(core::mem::size_of::() <= 2048, "An allocation of `Local` should be <= 2048 bytes."); + assert!( + core::mem::size_of::() <= 2048, + "An allocation of `Local` should be <= 2048 bytes." + ); } impl Local { @@ -385,7 +390,7 @@ impl Local { const PINNINGS_BETWEEN_COLLECT: usize = 128; /// Registers a new `Local` in the provided `Global`. - pub fn register(collector: &Collector) -> LocalHandle { + pub(crate) fn register(collector: &Collector) -> LocalHandle { unsafe { // Since we dereference no pointers in this block, it is safe to use `unprotected`. @@ -408,19 +413,19 @@ impl Local { /// Returns a reference to the `Global` in which this `Local` resides. #[inline] - pub fn global(&self) -> &Global { + pub(crate) fn global(&self) -> &Global { &self.collector().global } /// Returns a reference to the `Collector` in which this `Local` resides. #[inline] - pub fn collector(&self) -> &Collector { - unsafe { &**self.collector.get() } + pub(crate) fn collector(&self) -> &Collector { + self.collector.with(|c| unsafe { &**c }) } /// Returns `true` if the current participant is pinned. #[inline] - pub fn is_pinned(&self) -> bool { + pub(crate) fn is_pinned(&self) -> bool { self.guard_count.get() > 0 } @@ -429,8 +434,8 @@ impl Local { /// # Safety /// /// It should be safe for another thread to execute the given function. - pub unsafe fn defer(&self, mut deferred: Deferred, guard: &Guard) { - let bag = &mut *self.bag.get(); + pub(crate) unsafe fn defer(&self, mut deferred: Deferred, guard: &Guard) { + let bag = self.bag.with_mut(|b| &mut *b); while let Err(d) = bag.try_push(deferred) { self.global().push_bag(bag, guard); @@ -438,8 +443,8 @@ impl Local { } } - pub fn flush(&self, guard: &Guard) { - let bag = unsafe { &mut *self.bag.get() }; + pub(crate) fn flush(&self, guard: &Guard) { + let bag = self.bag.with_mut(|b| unsafe { &mut *b }); if !bag.is_empty() { self.global().push_bag(bag, guard); @@ -450,7 +455,7 @@ impl Local { /// Pins the `Local`. #[inline] - pub fn pin(&self) -> Guard { + pub(crate) fn pin(&self) -> Guard { let guard = Guard { local: self }; let guard_count = self.guard_count.get(); @@ -468,7 +473,7 @@ impl Local { // a `SeqCst` fence. // // 1. `atomic::fence(SeqCst)`, which compiles into a `mfence` instruction. - // 2. `_.compare_and_swap(_, _, SeqCst)`, which compiles into a `lock cmpxchg` + // 2. `_.compare_exchange(_, _, SeqCst, SeqCst)`, which compiles into a `lock cmpxchg` // instruction. // // Both instructions have the effect of a full barrier, but benchmarks have shown @@ -478,10 +483,13 @@ impl Local { // works fine. Using inline assembly would be a viable (and correct) alternative, // but alas, that is not possible on stable Rust. let current = Epoch::starting(); - let previous = self - .epoch - .compare_and_swap(current, new_epoch, Ordering::SeqCst); - debug_assert_eq!(current, previous, "participant was expected to be unpinned"); + let res = self.epoch.compare_exchange( + current, + new_epoch, + Ordering::SeqCst, + Ordering::SeqCst, + ); + debug_assert!(res.is_ok(), "participant was expected to be unpinned"); // We add a compiler fence to make it less likely for LLVM to do something wrong // here. Formally, this is not enough to get rid of data races; practically, // it should go a long way. @@ -507,7 +515,7 @@ impl Local { /// Unpins the `Local`. #[inline] - pub fn unpin(&self) { + pub(crate) fn unpin(&self) { let guard_count = self.guard_count.get(); self.guard_count.set(guard_count - 1); @@ -522,7 +530,7 @@ impl Local { /// Unpins and then pins the `Local`. #[inline] - pub fn repin(&self) { + pub(crate) fn repin(&self) { let guard_count = self.guard_count.get(); // Update the local epoch only if there's only one guard. @@ -545,7 +553,7 @@ impl Local { /// Increments the handle count. #[inline] - pub fn acquire_handle(&self) { + pub(crate) fn acquire_handle(&self) { let handle_count = self.handle_count.get(); debug_assert!(handle_count >= 1); self.handle_count.set(handle_count + 1); @@ -553,7 +561,7 @@ impl Local { /// Decrements the handle count. #[inline] - pub fn release_handle(&self) { + pub(crate) fn release_handle(&self) { let guard_count = self.guard_count.get(); let handle_count = self.handle_count.get(); debug_assert!(handle_count >= 1); @@ -577,7 +585,8 @@ impl Local { // Pin and move the local bag into the global queue. It's important that `push_bag` // doesn't defer destruction on any new garbage. let guard = &self.pin(); - self.global().push_bag(&mut *self.bag.get(), guard); + self.global() + .push_bag(self.bag.with_mut(|b| &mut *b), guard); } // Revert the handle count back to zero. self.handle_count.set(0); @@ -586,7 +595,7 @@ impl Local { // Take the reference to the `Global` out of this `Local`. Since we're not protected // by a guard at this time, it's crucial that the reference is read before marking the // `Local` as deleted. - let collector: Collector = ptr::read(&*(*self.collector.get())); + let collector: Collector = ptr::read(self.collector.with(|c| &*(*c))); // Mark this node in the linked list as deleted. self.entry.delete(unprotected()); @@ -617,7 +626,7 @@ impl IsElement for Local { } } -#[cfg(test)] +#[cfg(all(test, not(crossbeam_loom)))] mod tests { use std::sync::atomic::{AtomicUsize, Ordering}; diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/lib.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/lib.rs new file mode 100644 index 0000000..99da911 --- /dev/null +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/lib.rs @@ -0,0 +1,187 @@ +//! Epoch-based memory reclamation. +//! +//! An interesting problem concurrent collections deal with comes from the remove operation. +//! Suppose that a thread removes an element from a lock-free map, while another thread is reading +//! that same element at the same time. The first thread must wait until the second thread stops +//! reading the element. Only then it is safe to destruct it. +//! +//! Programming languages that come with garbage collectors solve this problem trivially. The +//! garbage collector will destruct the removed element when no thread can hold a reference to it +//! anymore. +//! +//! This crate implements a basic memory reclamation mechanism, which is based on epochs. When an +//! element gets removed from a concurrent collection, it is inserted into a pile of garbage and +//! marked with the current epoch. Every time a thread accesses a collection, it checks the current +//! epoch, attempts to increment it, and destructs some garbage that became so old that no thread +//! can be referencing it anymore. +//! +//! That is the general mechanism behind epoch-based memory reclamation, but the details are a bit +//! more complicated. Anyhow, memory reclamation is designed to be fully automatic and something +//! users of concurrent collections don't have to worry much about. +//! +//! # Pointers +//! +//! Concurrent collections are built using atomic pointers. This module provides [`Atomic`], which +//! is just a shared atomic pointer to a heap-allocated object. Loading an [`Atomic`] yields a +//! [`Shared`], which is an epoch-protected pointer through which the loaded object can be safely +//! read. +//! +//! # Pinning +//! +//! Before an [`Atomic`] can be loaded, a participant must be [`pin`]ned. By pinning a participant +//! we declare that any object that gets removed from now on must not be destructed just +//! yet. Garbage collection of newly removed objects is suspended until the participant gets +//! unpinned. +//! +//! # Garbage +//! +//! Objects that get removed from concurrent collections must be stashed away until all currently +//! pinned participants get unpinned. Such objects can be stored into a thread-local or global +//! storage, where they are kept until the right time for their destruction comes. +//! +//! There is a global shared instance of garbage queue. You can [`defer`](Guard::defer) the execution of an +//! arbitrary function until the global epoch is advanced enough. Most notably, concurrent data +//! structures may defer the deallocation of an object. +//! +//! # APIs +//! +//! For majority of use cases, just use the default garbage collector by invoking [`pin`]. If you +//! want to create your own garbage collector, use the [`Collector`] API. + +#![doc(test( + no_crate_inject, + attr( + deny(warnings, rust_2018_idioms), + allow(dead_code, unused_assignments, unused_variables) + ) +))] +#![warn( + missing_docs, + missing_debug_implementations, + rust_2018_idioms, + unreachable_pub +)] +#![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(feature = "nightly", feature(cfg_target_has_atomic))] +#![cfg_attr(feature = "nightly", feature(const_fn))] + +#[cfg(crossbeam_loom)] +extern crate loom_crate as loom; + +use cfg_if::cfg_if; + +#[cfg(crossbeam_loom)] +#[allow(unused_imports, dead_code)] +mod primitive { + pub(crate) mod cell { + pub(crate) use loom::cell::UnsafeCell; + } + pub(crate) mod sync { + pub(crate) mod atomic { + use core::sync::atomic::Ordering; + pub(crate) use loom::sync::atomic::AtomicUsize; + pub(crate) fn fence(ord: Ordering) { + if let Ordering::Acquire = ord { + } else { + // FIXME: loom only supports acquire fences at the moment. + // https://github.com/tokio-rs/loom/issues/117 + // let's at least not panic... + // this may generate some false positives (`SeqCst` is stronger than `Acquire` + // for example), and some false negatives (`Relaxed` is weaker than `Acquire`), + // but it's the best we can do for the time being. + } + loom::sync::atomic::fence(Ordering::Acquire) + } + + // FIXME: loom does not support compiler_fence at the moment. + // https://github.com/tokio-rs/loom/issues/117 + // we use fence as a stand-in for compiler_fence for the time being. + // this may miss some races since fence is stronger than compiler_fence, + // but it's the best we can do for the time being. + pub(crate) use self::fence as compiler_fence; + } + pub(crate) use loom::sync::Arc; + } + pub(crate) use loom::lazy_static; + pub(crate) use loom::thread_local; +} +#[cfg(not(crossbeam_loom))] +#[allow(unused_imports, dead_code)] +mod primitive { + #[cfg(any(feature = "alloc", feature = "std"))] + pub(crate) mod cell { + #[derive(Debug)] + #[repr(transparent)] + pub(crate) struct UnsafeCell(::core::cell::UnsafeCell); + + // loom's UnsafeCell has a slightly different API than the standard library UnsafeCell. + // Since we want the rest of the code to be agnostic to whether it's running under loom or + // not, we write this small wrapper that provides the loom-supported API for the standard + // library UnsafeCell. This is also what the loom documentation recommends: + // https://github.com/tokio-rs/loom#handling-loom-api-differences + impl UnsafeCell { + #[inline] + pub(crate) fn new(data: T) -> UnsafeCell { + UnsafeCell(::core::cell::UnsafeCell::new(data)) + } + + #[inline] + pub(crate) fn with(&self, f: impl FnOnce(*const T) -> R) -> R { + f(self.0.get()) + } + + #[inline] + pub(crate) fn with_mut(&self, f: impl FnOnce(*mut T) -> R) -> R { + f(self.0.get()) + } + } + } + #[cfg(any(feature = "alloc", feature = "std"))] + pub(crate) mod sync { + pub(crate) mod atomic { + pub(crate) use core::sync::atomic::compiler_fence; + pub(crate) use core::sync::atomic::fence; + pub(crate) use core::sync::atomic::AtomicUsize; + } + #[cfg_attr(feature = "nightly", cfg(target_has_atomic = "ptr"))] + pub(crate) use alloc::sync::Arc; + } + + #[cfg(feature = "std")] + pub(crate) use std::thread_local; + + #[cfg(feature = "std")] + pub(crate) use lazy_static::lazy_static; +} + +#[cfg_attr(feature = "nightly", cfg(target_has_atomic = "ptr"))] +cfg_if! { + if #[cfg(feature = "alloc")] { + extern crate alloc; + + mod atomic; + mod collector; + mod deferred; + mod epoch; + mod guard; + mod internal; + mod sync; + + pub use self::atomic::{ + Pointable, Atomic, CompareExchangeError, + Owned, Pointer, Shared, + }; + pub use self::collector::{Collector, LocalHandle}; + pub use self::guard::{unprotected, Guard}; + + #[allow(deprecated)] + pub use self::atomic::{CompareAndSetError, CompareAndSetOrdering}; + } +} + +cfg_if! { + if #[cfg(feature = "std")] { + mod default; + pub use self::default::{default_collector, is_pinned, pin}; + } +} diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/sync/list.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/sync/list.rs similarity index 95% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/sync/list.rs rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/sync/list.rs index 656e2a8..52ffd6f 100644 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/sync/list.rs +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/sync/list.rs @@ -13,7 +13,7 @@ use crate::{unprotected, Atomic, Guard, Shared}; /// An Entry is accessed from multiple threads, so it would be beneficial to put it in a different /// cache-line than thread-local data in terms of performance. #[derive(Debug)] -pub struct Entry { +pub(crate) struct Entry { /// The next entry in the linked list. /// If the tag is 1, this entry is marked as deleted. next: Atomic, @@ -64,7 +64,7 @@ pub struct Entry { /// } /// ``` /// -pub trait IsElement { +pub(crate) trait IsElement { /// Returns a reference to this element's `Entry`. fn entry_of(_: &T) -> &Entry; @@ -93,7 +93,7 @@ pub trait IsElement { /// A lock-free, intrusive linked list of type `T`. #[derive(Debug)] -pub struct List = T> { +pub(crate) struct List = T> { /// The head of the linked list. head: Atomic, @@ -102,7 +102,7 @@ pub struct List = T> { } /// An iterator used for retrieving values from the list. -pub struct Iter<'g, T, C: IsElement> { +pub(crate) struct Iter<'g, T, C: IsElement> { /// The guard that protects the iteration. guard: &'g Guard, @@ -122,7 +122,7 @@ pub struct Iter<'g, T, C: IsElement> { /// An error that occurs during iteration over the list. #[derive(PartialEq, Debug)] -pub enum IterError { +pub(crate) enum IterError { /// A concurrent thread modified the state of the list at the same place that this iterator /// was inspecting. Subsequent iteration will restart from the beginning of the list. Stalled, @@ -145,14 +145,14 @@ impl Entry { /// The entry should be a member of a linked list, and it should not have been deleted. /// It should be safe to call `C::finalize` on the entry after the `guard` is dropped, where `C` /// is the associated helper for the linked list. - pub unsafe fn delete(&self, guard: &Guard) { + pub(crate) unsafe fn delete(&self, guard: &Guard) { self.next.fetch_or(1, Release, guard); } } impl> List { /// Returns a new, empty linked list. - pub fn new() -> Self { + pub(crate) fn new() -> Self { Self { head: Atomic::null(), _marker: PhantomData, @@ -169,7 +169,7 @@ impl> List { /// - `container` is immovable, e.g. inside an `Owned` /// - the same `Entry` is not inserted more than once /// - the inserted object will be removed before the list is dropped - pub unsafe fn insert<'g>(&'g self, container: Shared<'g, T>, guard: &'g Guard) { + pub(crate) unsafe fn insert<'g>(&'g self, container: Shared<'g, T>, guard: &'g Guard) { // Insert right after head, i.e. at the beginning of the list. let to = &self.head; // Get the intrusively stored Entry of the new element to insert. @@ -183,7 +183,7 @@ impl> List { // Set the Entry of the to-be-inserted element to point to the previous successor of // `to`. entry.next.store(next, Relaxed); - match to.compare_and_set_weak(next, entry_ptr, Release, guard) { + match to.compare_exchange_weak(next, entry_ptr, Release, Relaxed, guard) { Ok(_) => break, // We lost the race or weak CAS failed spuriously. Update the successor and try // again. @@ -204,7 +204,7 @@ impl> List { /// 2. If an object is deleted during iteration, it may or may not be returned. /// 3. The iteration may be aborted when it lost in a race condition. In this case, the winning /// thread will continue to iterate over the same list. - pub fn iter<'g>(&'g self, guard: &'g Guard) -> Iter<'g, T, C> { + pub(crate) fn iter<'g>(&'g self, guard: &'g Guard) -> Iter<'g, T, C> { Iter { guard, pred: &self.head, @@ -250,7 +250,7 @@ impl<'g, T: 'g, C: IsElement> Iterator for Iter<'g, T, C> { // Try to unlink `curr` from the list, and get the new value of `self.pred`. let succ = match self .pred - .compare_and_set(self.curr, succ, Acquire, self.guard) + .compare_exchange(self.curr, succ, Acquire, Acquire, self.guard) { Ok(_) => { // We succeeded in unlinking `curr`, so we have to schedule @@ -295,7 +295,7 @@ impl<'g, T: 'g, C: IsElement> Iterator for Iter<'g, T, C> { } } -#[cfg(test)] +#[cfg(all(test, not(crossbeam_loom)))] mod tests { use super::*; use crate::{Collector, Owned}; diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/sync/mod.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/sync/mod.rs new file mode 100644 index 0000000..5c06e76 --- /dev/null +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/sync/mod.rs @@ -0,0 +1,4 @@ +//! Synchronization primitives. + +pub(crate) mod list; +pub(crate) mod queue; diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/sync/queue.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/sync/queue.rs similarity index 90% rename from third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/sync/queue.rs rename to third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/sync/queue.rs index 71ea1bc..67c228d 100644 --- a/third_party/cargo/vendor/crossbeam-epoch-0.9.1/src/sync/queue.rs +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/src/sync/queue.rs @@ -19,7 +19,7 @@ use crate::{unprotected, Atomic, Guard, Owned, Shared}; // the `tail` pointer may lag behind the actual tail. Non-sentinel nodes are either all `Data` or // all `Blocked` (requests for data from blocked threads). #[derive(Debug)] -pub struct Queue { +pub(crate) struct Queue { head: CachePadded>>, tail: CachePadded>>, } @@ -42,7 +42,7 @@ unsafe impl Send for Queue {} impl Queue { /// Create a new, empty queue. - pub fn new() -> Queue { + pub(crate) fn new() -> Queue { let q = Queue { head: CachePadded::new(Atomic::null()), tail: CachePadded::new(Atomic::null()), @@ -74,24 +74,28 @@ impl Queue { let next = o.next.load(Acquire, guard); if unsafe { next.as_ref().is_some() } { // if not, try to "help" by moving the tail pointer forward - let _ = self.tail.compare_and_set(onto, next, Release, guard); + let _ = self + .tail + .compare_exchange(onto, next, Release, Relaxed, guard); false } else { // looks like the actual tail; attempt to link in `n` let result = o .next - .compare_and_set(Shared::null(), new, Release, guard) + .compare_exchange(Shared::null(), new, Release, Relaxed, guard) .is_ok(); if result { // try to move the tail pointer forward - let _ = self.tail.compare_and_set(onto, new, Release, guard); + let _ = self + .tail + .compare_exchange(onto, new, Release, Relaxed, guard); } result } } /// Adds `t` to the back of the queue, possibly waking up threads blocked on `pop`. - pub fn push(&self, t: T, guard: &Guard) { + pub(crate) fn push(&self, t: T, guard: &Guard) { let new = Owned::new(Node { data: MaybeUninit::new(t), next: Atomic::null(), @@ -118,12 +122,14 @@ impl Queue { match unsafe { next.as_ref() } { Some(n) => unsafe { self.head - .compare_and_set(head, next, Release, guard) + .compare_exchange(head, next, Release, Relaxed, guard) .map(|_| { let tail = self.tail.load(Relaxed, guard); // Advance the tail so that we don't retire a pointer to a reachable node. if head == tail { - let _ = self.tail.compare_and_set(tail, next, Release, guard); + let _ = self + .tail + .compare_exchange(tail, next, Release, Relaxed, guard); } guard.defer_destroy(head); // TODO: Replace with MaybeUninit::read when api is stable @@ -149,12 +155,14 @@ impl Queue { match unsafe { next.as_ref() } { Some(n) if condition(unsafe { &*n.data.as_ptr() }) => unsafe { self.head - .compare_and_set(head, next, Release, guard) + .compare_exchange(head, next, Release, Relaxed, guard) .map(|_| { let tail = self.tail.load(Relaxed, guard); // Advance the tail so that we don't retire a pointer to a reachable node. if head == tail { - let _ = self.tail.compare_and_set(tail, next, Release, guard); + let _ = self + .tail + .compare_exchange(tail, next, Release, Relaxed, guard); } guard.defer_destroy(head); Some(n.data.as_ptr().read()) @@ -168,7 +176,7 @@ impl Queue { /// Attempts to dequeue from the front. /// /// Returns `None` if the queue is observed to be empty. - pub fn try_pop(&self, guard: &Guard) -> Option { + pub(crate) fn try_pop(&self, guard: &Guard) -> Option { loop { if let Ok(head) = self.pop_internal(guard) { return head; @@ -180,7 +188,7 @@ impl Queue { /// /// Returns `None` if the queue is observed to be empty, or the head does not satisfy the given /// condition. - pub fn try_pop_if(&self, condition: F, guard: &Guard) -> Option + pub(crate) fn try_pop_if(&self, condition: F, guard: &Guard) -> Option where T: Sync, F: Fn(&T) -> bool, @@ -207,7 +215,7 @@ impl Drop for Queue { } } -#[cfg(test)] +#[cfg(all(test, not(crossbeam_loom)))] mod test { use super::*; use crate::pin; @@ -218,30 +226,30 @@ mod test { } impl Queue { - pub fn new() -> Queue { + pub(crate) fn new() -> Queue { Queue { queue: super::Queue::new(), } } - pub fn push(&self, t: T) { + pub(crate) fn push(&self, t: T) { let guard = &pin(); self.queue.push(t, guard); } - pub fn is_empty(&self) -> bool { + pub(crate) fn is_empty(&self) -> bool { let guard = &pin(); let head = self.queue.head.load(Acquire, guard); let h = unsafe { head.deref() }; h.next.load(Acquire, guard).is_null() } - pub fn try_pop(&self) -> Option { + pub(crate) fn try_pop(&self) -> Option { let guard = &pin(); self.queue.try_pop(guard) } - pub fn pop(&self) -> T { + pub(crate) fn pop(&self) -> T { loop { match self.try_pop() { None => continue, diff --git a/third_party/cargo/vendor/crossbeam-epoch-0.9.3/tests/loom.rs b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/tests/loom.rs new file mode 100644 index 0000000..4e56acd --- /dev/null +++ b/third_party/cargo/vendor/crossbeam-epoch-0.9.3/tests/loom.rs @@ -0,0 +1,157 @@ +#![cfg(crossbeam_loom)] + +use crossbeam_epoch as epoch; +use loom_crate as loom; + +use epoch::*; +use epoch::{Atomic, Owned}; +use loom::sync::atomic::Ordering::{self, Acquire, Relaxed, Release}; +use loom::sync::Arc; +use loom::thread::spawn; +use std::mem::ManuallyDrop; +use std::ptr; + +#[test] +fn it_works() { + loom::model(|| { + let collector = Collector::new(); + let item: Atomic = Atomic::from(Owned::new(String::from("boom"))); + let item2 = item.clone(); + let collector2 = collector.clone(); + let guard = collector.register().pin(); + + let jh = loom::thread::spawn(move || { + let guard = collector2.register().pin(); + guard.defer(move || { + // this isn't really safe, since other threads may still have pointers to the + // value, but in this limited test scenario it's okay, since we know the test won't + // access item after all the pins are released. + let mut item = unsafe { item2.into_owned() }; + // mutate it as a second measure to make sure the assert_eq below would fail + item.retain(|c| c == 'o'); + drop(item); + }); + }); + + let item = item.load(Ordering::SeqCst, &guard); + // we pinned strictly before the call to defer_destroy, + // so item cannot have been dropped yet + assert_eq!(*unsafe { item.deref() }, "boom"); + drop(guard); + + jh.join().unwrap(); + + drop(collector); + }) +} + +#[test] +fn treiber_stack() { + /// Treiber's lock-free stack. + /// + /// Usable with any number of producers and consumers. + #[derive(Debug)] + pub struct TreiberStack { + head: Atomic>, + } + + #[derive(Debug)] + struct Node { + data: ManuallyDrop, + next: Atomic>, + } + + impl TreiberStack { + /// Creates a new, empty stack. + pub fn new() -> TreiberStack { + TreiberStack { + head: Atomic::null(), + } + } + + /// Pushes a value on top of the stack. + pub fn push(&self, t: T) { + let mut n = Owned::new(Node { + data: ManuallyDrop::new(t), + next: Atomic::null(), + }); + + let guard = epoch::pin(); + + loop { + let head = self.head.load(Relaxed, &guard); + n.next.store(head, Relaxed); + + match self + .head + .compare_exchange(head, n, Release, Relaxed, &guard) + { + Ok(_) => break, + Err(e) => n = e.new, + } + } + } + + /// Attempts to pop the top element from the stack. + /// + /// Returns `None` if the stack is empty. + pub fn pop(&self) -> Option { + let guard = epoch::pin(); + loop { + let head = self.head.load(Acquire, &guard); + + match unsafe { head.as_ref() } { + Some(h) => { + let next = h.next.load(Relaxed, &guard); + + if self + .head + .compare_exchange(head, next, Relaxed, Relaxed, &guard) + .is_ok() + { + unsafe { + guard.defer_destroy(head); + return Some(ManuallyDrop::into_inner(ptr::read(&(*h).data))); + } + } + } + None => return None, + } + } + } + + /// Returns `true` if the stack is empty. + pub fn is_empty(&self) -> bool { + let guard = epoch::pin(); + self.head.load(Acquire, &guard).is_null() + } + } + + impl Drop for TreiberStack { + fn drop(&mut self) { + while self.pop().is_some() {} + } + } + + loom::model(|| { + let stack1 = Arc::new(TreiberStack::new()); + let stack2 = Arc::clone(&stack1); + + // use 5 since it's greater than the 4 used for the sanitize feature + let jh = spawn(move || { + for i in 0..5 { + stack2.push(i); + assert!(stack2.pop().is_some()); + } + }); + + for i in 0..5 { + stack1.push(i); + assert!(stack1.pop().is_some()); + } + + jh.join().unwrap(); + assert!(stack1.pop().is_none()); + assert!(stack1.is_empty()); + }); +} diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/.cargo-checksum.json b/third_party/cargo/vendor/crossbeam-utils-0.8.1/.cargo-checksum.json deleted file mode 100644 index 9a26461..0000000 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"CHANGELOG.md":"36557d1a612004b5108ed46be3716bb2e06368d5bb0cd9e7ea4b6bcc4d81c07a","Cargo.toml":"648a34c3609f0cb729929fd5c6d1288475232a4daeb79363e629ecadcc5d3a4f","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","README.md":"5bbcf23ea854d44870790a316dbcdb8d7b0c2e0f17a521e8d4fbffdd9dd5b464","benches/atomic_cell.rs":"de327015cf811fb74b7a624719f678ba0677025dc703d56cbd2094a3c92da23b","build.rs":"f927f9796b0cbae832f458e82833b24c7ced9f27f4f1e76de9d11ad30d21c88a","src/atomic/atomic_cell.rs":"4b86367084da93176c335650524220ef7b3df4df09b6535d0b55a03446dee7e0","src/atomic/consume.rs":"1ee5de160b6e3755c02940c24fa90f85f3ef2f7afb971e9e9c6f481609bbc7b7","src/atomic/mod.rs":"c84d068944388c1385d6fec9211b6be26c777a21fc04e7231d1f3b564de62708","src/atomic/seq_lock.rs":"ee50097cd582cfe6e28ebc54935fc6488f52e2fed19d4b26bafd5eab5c229291","src/atomic/seq_lock_wide.rs":"f03ee779c2ebebcfb0df8baac49be7d38e920876260c8da9dff0fc894068c35d","src/backoff.rs":"98d1daee75bbd6243bc0784c92c56086e57658baff93a2a1f0729426901c03ee","src/cache_padded.rs":"5671f3a02f6e407f1dc562d4fb17e4659f18d1e5206b8566b38d2e447e5f6fa4","src/lib.rs":"61c6bc2b43d87550c4547693f3eacfe126581560a8884b32b23f01a7e2c6d833","src/sync/mod.rs":"e5f4087c4e63b0e6e0b291f3946a224aa9d2a4a0c299c23014b822d6346f6986","src/sync/parker.rs":"6137fccce8c03045440cbc3166721e4e4b5f73013165c9c260cff904cfcab6f3","src/sync/sharded_lock.rs":"14be659744918d0b27db24c56b41c618b0f0484b6761da46561023d96c4c120f","src/sync/wait_group.rs":"932e11753764b238f764892978a6b70fb288111faf7fae7766e603bed4e5b444","src/thread.rs":"6c44bf4c4515a769b8ccd0c9d9b80f5b46bd4768ec323a909773301d375033fb","tests/atomic_cell.rs":"5efe71777d7687ee01e387d5ca20436c3e8171e1e879a63074d1f79ccc88ff5e","tests/cache_padded.rs":"6ba6ad1b3060bfb2f7bf0a1d006f949d91c49e506564b0d28e4f06129b94665d","tests/parker.rs":"a1f63cf99b3524bfc91d0797133d0b75165445ecbaa92f78bd8101fa7cc828ec","tests/sharded_lock.rs":"c7d9f7185900b3ff84d00f5252793d5d28c47374678b8e6f758a67fa32c71fca","tests/thread.rs":"9a7d7d3028c552fd834c68598b04a1cc252a816bc20ab62cec060d6cd09cab10","tests/wait_group.rs":"ad8f0cdfed31f9594a2e0737234d418f8b924d784a4db8d7e469deab8c95f5f8"},"package":"02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d"} \ No newline at end of file diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/lib.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/lib.rs deleted file mode 100644 index f2bd460..0000000 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/lib.rs +++ /dev/null @@ -1,56 +0,0 @@ -//! Miscellaneous tools for concurrent programming. -//! -//! ## Atomics -//! -//! * [`AtomicCell`], a thread-safe mutable memory location. -//! * [`AtomicConsume`], for reading from primitive atomic types with "consume" ordering. -//! -//! ## Thread synchronization -//! -//! * [`Parker`], a thread parking primitive. -//! * [`ShardedLock`], a sharded reader-writer lock with fast concurrent reads. -//! * [`WaitGroup`], for synchronizing the beginning or end of some computation. -//! -//! ## Utilities -//! -//! * [`Backoff`], for exponential backoff in spin loops. -//! * [`CachePadded`], for padding and aligning a value to the length of a cache line. -//! * [`scope`], for spawning threads that borrow local variables from the stack. -//! -//! [`AtomicCell`]: atomic::AtomicCell -//! [`AtomicConsume`]: atomic::AtomicConsume -//! [`Parker`]: sync::Parker -//! [`ShardedLock`]: sync::ShardedLock -//! [`WaitGroup`]: sync::WaitGroup -//! [`scope`]: thread::scope - -#![doc(test( - no_crate_inject, - attr( - deny(warnings, rust_2018_idioms), - allow(dead_code, unused_assignments, unused_variables) - ) -))] -#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)] -#![cfg_attr(not(feature = "std"), no_std)] -#![cfg_attr(feature = "nightly", feature(cfg_target_has_atomic))] -// matches! requires Rust 1.42 -#![allow(clippy::match_like_matches_macro)] - -#[cfg_attr(feature = "nightly", cfg(target_has_atomic = "ptr"))] -pub mod atomic; - -mod cache_padded; -pub use crate::cache_padded::CachePadded; - -mod backoff; -pub use crate::backoff::Backoff; - -use cfg_if::cfg_if; - -cfg_if! { - if #[cfg(feature = "std")] { - pub mod sync; - pub mod thread; - } -} diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.3/.cargo-checksum.json b/third_party/cargo/vendor/crossbeam-utils-0.8.3/.cargo-checksum.json new file mode 100644 index 0000000..d022333 --- /dev/null +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"0eda77e259133b1ce0d9ed4089bc422ab942d5a9ef1413326d30a87bd0b06f0d","Cargo.toml":"200cdcf1e3579090f07c5e40ea81c92c38f49ea1e7de8e59d1aa77be534ae0d7","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","README.md":"345ae455556e8d9add2a255bacd051779103ab70edb81672b5e340b1e287e7f4","benches/atomic_cell.rs":"c927eb3cd1e5ecc4b91adbc3bde98af15ffab4086190792ba64d5cde0e24df3d","build.rs":"f927f9796b0cbae832f458e82833b24c7ced9f27f4f1e76de9d11ad30d21c88a","src/atomic/atomic_cell.rs":"a558620164f111454e431a2ddba054b2506a19c5775dd276be9d4530bf6c25e1","src/atomic/consume.rs":"e0db40dd4ce173eb0297e632518b669fecea70baa3810a976125f18f9d119ecf","src/atomic/mod.rs":"8448d19b3d4472be151c5bd8e0560101d90665f867c1d27907ee118c6151bb62","src/atomic/seq_lock.rs":"27182e6b87a9db73c5f6831759f8625f9fcdec3c2828204c444aef04f427735a","src/atomic/seq_lock_wide.rs":"9888dd03116bb89ca36d4ab8d5a0b5032107a2983a7eb8024454263b09080088","src/backoff.rs":"7cc7754e15f69b52e92a70d4f49d1bc274693455a0933a2d7eb0605806566af3","src/cache_padded.rs":"6a512698115ad0d5a5b163dbd7a83247e1f1c146c4a30f3fc74b952e3b767b59","src/lib.rs":"e55bfb4bf865342a35c657ea72d4f2123555b77d005ac770ef0db40489181af4","src/sync/mod.rs":"59986f559a8f170a4b3247ab2eea2460b09809d87c8110ed88e4e7103d3519dc","src/sync/parker.rs":"ba8f75bff31b8be9275808e8f393e71cc682dfc1109ceccb12f69a3700cff5be","src/sync/sharded_lock.rs":"14be659744918d0b27db24c56b41c618b0f0484b6761da46561023d96c4c120f","src/sync/wait_group.rs":"32e946a7581c55f8aa9904527b92b177c538fa0cf7cbcfa1d1f25990582cb6ea","src/thread.rs":"0eb5ec1d3c1b40600d88eb70539d14276e32307f5bed2b679f50f6a20777a01e","tests/atomic_cell.rs":"5efe71777d7687ee01e387d5ca20436c3e8171e1e879a63074d1f79ccc88ff5e","tests/cache_padded.rs":"1ac7095656f8010b68a16135841090209a6aeffdd988937d19d2dfd799e5e9c4","tests/parker.rs":"6def4721287d9d70b1cfd63ebb34e1c83fbb3376edbad2bc8aac6ef69dd99d20","tests/sharded_lock.rs":"56950ab68f9efb0d16ff28b30f5959d00c094880016685c375b4e1742dc4eb09","tests/thread.rs":"9a7d7d3028c552fd834c68598b04a1cc252a816bc20ab62cec060d6cd09cab10","tests/wait_group.rs":"ad8f0cdfed31f9594a2e0737234d418f8b924d784a4db8d7e469deab8c95f5f8"},"package":"e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49"} \ No newline at end of file diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/BUILD.bazel b/third_party/cargo/vendor/crossbeam-utils-0.8.3/BUILD.bazel similarity index 98% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/BUILD.bazel rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/BUILD.bazel index c0650ae..2392f96 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/BUILD.bazel +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/BUILD.bazel @@ -53,7 +53,7 @@ rust_library( "cargo-raze", "manual", ], - version = "0.8.1", + version = "0.8.3", # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/cfg-if-1.0.0:cfg_if", diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/CHANGELOG.md b/third_party/cargo/vendor/crossbeam-utils-0.8.3/CHANGELOG.md similarity index 91% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/CHANGELOG.md rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/CHANGELOG.md index a17c6e6..c4a92bf 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/CHANGELOG.md +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/CHANGELOG.md @@ -1,3 +1,14 @@ +# Version 0.8.3 + +- Make `loom` dependency optional. (#666) + +# Version 0.8.2 + +- Deprecate `AtomicCell::compare_and_swap`. Use `AtomicCell::compare_exchange` instead. (#619) +- Add `Parker::park_deadline`. (#563) +- Improve implementation of `CachePadded`. (#636) +- Add unstable support for `loom`. (#487) + # Version 0.8.1 - Make `AtomicCell::is_lock_free` always const fn. (#600) @@ -8,7 +19,7 @@ # Version 0.8.0 - Bump the minimum supported Rust version to 1.36. -- Remove deprecated `AtomicCell::get_mut()` and `Backoff::is_complete()` methods +- Remove deprecated `AtomicCell::get_mut()` and `Backoff::is_complete()` methods. - Remove `alloc` feature. - Make `CachePadded::new()` const function. - Make `AtomicCell::is_lock_free()` const function at 1.46+. diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/Cargo.toml b/third_party/cargo/vendor/crossbeam-utils-0.8.3/Cargo.toml similarity index 91% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/Cargo.toml rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/Cargo.toml index edb08f9..a7d694c 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/Cargo.toml +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/Cargo.toml @@ -13,12 +13,11 @@ [package] edition = "2018" name = "crossbeam-utils" -version = "0.8.1" +version = "0.8.3" authors = ["The Crossbeam Project Developers"] description = "Utilities for concurrent programming" homepage = "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-utils" documentation = "https://docs.rs/crossbeam-utils" -readme = "README.md" keywords = ["scoped", "thread", "atomic", "cache"] categories = ["algorithms", "concurrency", "data-structures", "no-std"] license = "MIT OR Apache-2.0" @@ -30,7 +29,7 @@ version = "1" version = "1.4.0" optional = true [dev-dependencies.rand] -version = "0.7.3" +version = "0.8" [build-dependencies.autocfg] version = "1.0.0" @@ -38,3 +37,6 @@ version = "1.0.0" default = ["std"] nightly = [] std = ["lazy_static"] +[target."cfg(crossbeam_loom)".dependencies.loom] +version = "0.4" +optional = true diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/LICENSE-APACHE b/third_party/cargo/vendor/crossbeam-utils-0.8.3/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/LICENSE-APACHE rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/LICENSE-APACHE diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/LICENSE-MIT b/third_party/cargo/vendor/crossbeam-utils-0.8.3/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/LICENSE-MIT rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/LICENSE-MIT diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/README.md b/third_party/cargo/vendor/crossbeam-utils-0.8.3/README.md similarity index 97% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/README.md rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/README.md index 7e95829..fd0943b 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/README.md +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/README.md @@ -2,7 +2,7 @@ [![Build Status](https://github.com/crossbeam-rs/crossbeam/workflows/CI/badge.svg)]( https://github.com/crossbeam-rs/crossbeam/actions) -[![License](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)]( +[![License](https://img.shields.io/badge/license-MIT_OR_Apache--2.0-blue.svg)]( https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-utils#license) [![Cargo](https://img.shields.io/crates/v/crossbeam-utils.svg)]( https://crates.io/crates/crossbeam-utils) diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/benches/atomic_cell.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/benches/atomic_cell.rs similarity index 93% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/benches/atomic_cell.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/benches/atomic_cell.rs index 938a8fe..844f7c0 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/benches/atomic_cell.rs +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/benches/atomic_cell.rs @@ -28,11 +28,11 @@ fn fetch_add_u8(b: &mut test::Bencher) { } #[bench] -fn compare_and_swap_u8(b: &mut test::Bencher) { +fn compare_exchange_u8(b: &mut test::Bencher) { let a = AtomicCell::new(0u8); let mut i = 0; b.iter(|| { - a.compare_and_swap(i, i.wrapping_add(1)); + let _ = a.compare_exchange(i, i.wrapping_add(1)); i = i.wrapping_add(1); }); } @@ -102,11 +102,11 @@ fn fetch_add_usize(b: &mut test::Bencher) { } #[bench] -fn compare_and_swap_usize(b: &mut test::Bencher) { +fn compare_exchange_usize(b: &mut test::Bencher) { let a = AtomicCell::new(0usize); let mut i = 0; b.iter(|| { - a.compare_and_swap(i, i.wrapping_add(1)); + let _ = a.compare_exchange(i, i.wrapping_add(1)); i = i.wrapping_add(1); }); } diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/build.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/build.rs similarity index 100% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/build.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/build.rs diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/atomic/atomic_cell.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/atomic/atomic_cell.rs similarity index 97% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/src/atomic/atomic_cell.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/src/atomic/atomic_cell.rs index e8f6804..ad094b2 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/atomic/atomic_cell.rs +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/atomic/atomic_cell.rs @@ -2,15 +2,19 @@ #![allow(clippy::unit_arg)] #![allow(clippy::let_unit_value)] +use crate::primitive::sync::atomic::{self, AtomicBool}; use core::cell::UnsafeCell; use core::fmt; use core::mem; +use core::sync::atomic::Ordering; + +#[cfg(not(crossbeam_loom))] use core::ptr; -use core::sync::atomic::{self, AtomicBool, Ordering}; #[cfg(feature = "std")] use std::panic::{RefUnwindSafe, UnwindSafe}; +#[cfg(not(crossbeam_loom))] use super::seq_lock::SeqLock; /// A thread-safe mutable memory location. @@ -213,6 +217,7 @@ impl AtomicCell { /// # Examples /// /// ``` + /// # #![allow(deprecated)] /// use crossbeam_utils::atomic::AtomicCell; /// /// let a = AtomicCell::new(1); @@ -223,6 +228,8 @@ impl AtomicCell { /// assert_eq!(a.compare_and_swap(1, 2), 1); /// assert_eq!(a.load(), 2); /// ``` + // TODO: remove in the next major version. + #[deprecated(note = "Use `compare_exchange` instead")] pub fn compare_and_swap(&self, current: T, new: T) -> T { match self.compare_exchange(current, new) { Ok(v) => v, @@ -492,23 +499,23 @@ macro_rules! impl_arithmetic { #[cfg(has_atomic_u8)] impl_arithmetic!(u8, atomic::AtomicU8, "let a = AtomicCell::new(7u8);"); -#[cfg(has_atomic_u8)] +#[cfg(all(has_atomic_u8, not(crossbeam_loom)))] impl_arithmetic!(i8, atomic::AtomicI8, "let a = AtomicCell::new(7i8);"); #[cfg(has_atomic_u16)] impl_arithmetic!(u16, atomic::AtomicU16, "let a = AtomicCell::new(7u16);"); -#[cfg(has_atomic_u16)] +#[cfg(all(has_atomic_u16, not(crossbeam_loom)))] impl_arithmetic!(i16, atomic::AtomicI16, "let a = AtomicCell::new(7i16);"); #[cfg(has_atomic_u32)] impl_arithmetic!(u32, atomic::AtomicU32, "let a = AtomicCell::new(7u32);"); -#[cfg(has_atomic_u32)] +#[cfg(all(has_atomic_u32, not(crossbeam_loom)))] impl_arithmetic!(i32, atomic::AtomicI32, "let a = AtomicCell::new(7i32);"); #[cfg(has_atomic_u64)] impl_arithmetic!(u64, atomic::AtomicU64, "let a = AtomicCell::new(7u64);"); -#[cfg(has_atomic_u64)] +#[cfg(all(has_atomic_u64, not(crossbeam_loom)))] impl_arithmetic!(i64, atomic::AtomicI64, "let a = AtomicCell::new(7i64);"); -#[cfg(has_atomic_u128)] +#[cfg(all(has_atomic_u128, not(crossbeam_loom)))] impl_arithmetic!(u128, atomic::AtomicU128, "let a = AtomicCell::new(7u128);"); -#[cfg(has_atomic_u128)] +#[cfg(all(has_atomic_u128, not(crossbeam_loom)))] impl_arithmetic!(i128, atomic::AtomicI128, "let a = AtomicCell::new(7i128);"); impl_arithmetic!( @@ -516,6 +523,7 @@ impl_arithmetic!( atomic::AtomicUsize, "let a = AtomicCell::new(7usize);" ); +#[cfg(not(crossbeam_loom))] impl_arithmetic!( isize, atomic::AtomicIsize, @@ -624,6 +632,7 @@ const fn can_transmute() -> bool { /// scalability. #[inline] #[must_use] +#[cfg(not(crossbeam_loom))] 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. @@ -769,6 +778,7 @@ impl AtomicUnit { #[inline] fn swap(&self, _val: (), _order: Ordering) {} + #[allow(clippy::unnecessary_wraps)] // This is intentional. #[inline] fn compare_exchange_weak( &self, @@ -810,6 +820,9 @@ macro_rules! atomic { #[cfg(has_atomic_u128)] atomic!(@check, $t, atomic::AtomicU128, $a, $atomic_op); + #[cfg(crossbeam_loom)] + unimplemented!("loom does not support non-atomic atomic ops"); + #[cfg(not(crossbeam_loom))] break $fallback_op; } }; diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/atomic/consume.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/atomic/consume.rs similarity index 86% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/src/atomic/consume.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/src/atomic/consume.rs index 584fc34..0fbd93e 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/atomic/consume.rs +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/atomic/consume.rs @@ -1,5 +1,5 @@ #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] -use core::sync::atomic::compiler_fence; +use crate::primitive::sync::atomic::compiler_fence; use core::sync::atomic::Ordering; /// Trait which allows reading from primitive atomic types with "consume" ordering. @@ -53,11 +53,17 @@ macro_rules! impl_atomic { type Val = $val; impl_consume!(); } + #[cfg(crossbeam_loom)] + impl AtomicConsume for ::loom::sync::atomic::$atomic { + type Val = $val; + impl_consume!(); + } }; } impl_atomic!(AtomicBool, bool); impl_atomic!(AtomicUsize, usize); +#[cfg(not(crossbeam_loom))] impl_atomic!(AtomicIsize, isize); #[cfg(has_atomic_u8)] impl_atomic!(AtomicU8, u8); @@ -80,3 +86,9 @@ impl AtomicConsume for ::core::sync::atomic::AtomicPtr { type Val = *mut T; impl_consume!(); } + +#[cfg(crossbeam_loom)] +impl AtomicConsume for ::loom::sync::atomic::AtomicPtr { + type Val = *mut T; + impl_consume!(); +} diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/atomic/mod.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/atomic/mod.rs similarity index 80% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/src/atomic/mod.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/src/atomic/mod.rs index 7309c16..874eaf2 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/atomic/mod.rs +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/atomic/mod.rs @@ -1,7 +1,12 @@ //! Atomic types. +//! +//! * [`AtomicCell`], a thread-safe mutable memory location. +//! * [`AtomicConsume`], for reading from primitive atomic types with "consume" ordering. +#[cfg(not(crossbeam_loom))] use cfg_if::cfg_if; +#[cfg(not(crossbeam_loom))] cfg_if! { // Use "wide" sequence lock if the pointer width <= 32 for preventing its counter against wrap // around. diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/atomic/seq_lock.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/atomic/seq_lock.rs similarity index 89% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/src/atomic/seq_lock.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/src/atomic/seq_lock.rs index a423bc0..ff8defd 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/atomic/seq_lock.rs +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/atomic/seq_lock.rs @@ -4,7 +4,7 @@ use core::sync::atomic::{self, AtomicUsize, Ordering}; use crate::Backoff; /// A simple stamped lock. -pub struct SeqLock { +pub(crate) struct SeqLock { /// The current state of the lock. /// /// All bits except the least significant one hold the current stamp. When locked, the state @@ -13,7 +13,7 @@ pub struct SeqLock { } impl SeqLock { - pub const fn new() -> Self { + pub(crate) const fn new() -> Self { Self { state: AtomicUsize::new(0), } @@ -23,7 +23,7 @@ impl SeqLock { /// /// This method should be called before optimistic reads. #[inline] - pub fn optimistic_read(&self) -> Option { + pub(crate) fn optimistic_read(&self) -> Option { let state = self.state.load(Ordering::Acquire); if state == 1 { None @@ -37,14 +37,14 @@ impl SeqLock { /// 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 fn validate_read(&self, stamp: usize) -> bool { + pub(crate) fn validate_read(&self, stamp: usize) -> bool { atomic::fence(Ordering::Acquire); self.state.load(Ordering::Relaxed) == stamp } /// Grabs the lock for writing. #[inline] - pub fn write(&'static self) -> SeqLockWriteGuard { + pub(crate) fn write(&'static self) -> SeqLockWriteGuard { let backoff = Backoff::new(); loop { let previous = self.state.swap(1, Ordering::Acquire); @@ -64,7 +64,7 @@ impl SeqLock { } /// An RAII guard that releases the lock and increments the stamp when dropped. -pub struct SeqLockWriteGuard { +pub(crate) struct SeqLockWriteGuard { /// The parent lock. lock: &'static SeqLock, @@ -75,7 +75,7 @@ pub struct SeqLockWriteGuard { impl SeqLockWriteGuard { /// Releases the lock without incrementing the stamp. #[inline] - pub fn abort(self) { + pub(crate) fn abort(self) { self.lock.state.store(self.state, Ordering::Release); // We specifically don't want to call drop(), since that's diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/atomic/seq_lock_wide.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/atomic/seq_lock_wide.rs similarity index 93% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/src/atomic/seq_lock_wide.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/src/atomic/seq_lock_wide.rs index 871a93d..ef5d94a 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/atomic/seq_lock_wide.rs +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/atomic/seq_lock_wide.rs @@ -7,7 +7,7 @@ use crate::Backoff; /// /// The state is represented as two `AtomicUsize`: `state_hi` for high bits and `state_lo` for low /// bits. -pub struct SeqLock { +pub(crate) struct SeqLock { /// The high bits of the current state of the lock. state_hi: AtomicUsize, @@ -19,7 +19,7 @@ pub struct SeqLock { } impl SeqLock { - pub const fn new() -> Self { + pub(crate) const fn new() -> Self { Self { state_hi: AtomicUsize::new(0), state_lo: AtomicUsize::new(0), @@ -30,7 +30,7 @@ impl SeqLock { /// /// This method should be called before optimistic reads. #[inline] - pub fn optimistic_read(&self) -> Option<(usize, usize)> { + pub(crate) fn optimistic_read(&self) -> Option<(usize, usize)> { // The acquire loads from `state_hi` and `state_lo` synchronize with the release stores in // `SeqLockWriteGuard::drop`. // @@ -51,7 +51,7 @@ impl SeqLock { /// 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 fn validate_read(&self, stamp: (usize, usize)) -> bool { + pub(crate) 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 `(a, b)`, then the critical section's write of 1 to state_lo should be // visible. @@ -76,7 +76,7 @@ impl SeqLock { /// Grabs the lock for writing. #[inline] - pub fn write(&'static self) -> SeqLockWriteGuard { + pub(crate) fn write(&'static self) -> SeqLockWriteGuard { let backoff = Backoff::new(); loop { let previous = self.state_lo.swap(1, Ordering::Acquire); @@ -98,7 +98,7 @@ impl SeqLock { } /// An RAII guard that releases the lock and increments the stamp when dropped. -pub struct SeqLockWriteGuard { +pub(crate) struct SeqLockWriteGuard { /// The parent lock. lock: &'static SeqLock, @@ -109,7 +109,7 @@ pub struct SeqLockWriteGuard { impl SeqLockWriteGuard { /// Releases the lock without incrementing the stamp. #[inline] - pub fn abort(self) { + pub(crate) fn abort(self) { self.lock.state_lo.store(self.state_lo, Ordering::Release); mem::forget(self); } diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/backoff.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/backoff.rs similarity index 91% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/src/backoff.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/src/backoff.rs index 2391dd1..1012f06 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/backoff.rs +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/backoff.rs @@ -1,6 +1,6 @@ +use crate::primitive::sync::atomic; use core::cell::Cell; use core::fmt; -use core::sync::atomic; const SPIN_LIMIT: u32 = 6; const YIELD_LIMIT: u32 = 10; @@ -27,7 +27,7 @@ const YIELD_LIMIT: u32 = 10; /// let backoff = Backoff::new(); /// loop { /// let val = a.load(SeqCst); -/// if a.compare_and_swap(val, val.wrapping_mul(b), SeqCst) == val { +/// if a.compare_exchange(val, val.wrapping_mul(b), SeqCst, SeqCst).is_ok() { /// return val; /// } /// backoff.spin(); @@ -131,7 +131,7 @@ impl Backoff { /// let backoff = Backoff::new(); /// loop { /// let val = a.load(SeqCst); - /// if a.compare_and_swap(val, val.wrapping_mul(b), SeqCst) == val { + /// if a.compare_exchange(val, val.wrapping_mul(b), SeqCst, SeqCst).is_ok() { /// return val; /// } /// backoff.spin(); @@ -145,6 +145,9 @@ impl Backoff { #[inline] pub fn spin(&self) { for _ in 0..1 << self.step.get().min(SPIN_LIMIT) { + // TODO(taiki-e): once we bump the minimum required Rust version to 1.49+, + // use [`core::hint::spin_loop`] instead. + #[allow(deprecated)] atomic::spin_loop_hint(); } @@ -205,11 +208,17 @@ impl Backoff { pub fn snooze(&self) { if self.step.get() <= SPIN_LIMIT { for _ in 0..1 << self.step.get() { + // TODO(taiki-e): once we bump the minimum required Rust version to 1.49+, + // use [`core::hint::spin_loop`] instead. + #[allow(deprecated)] atomic::spin_loop_hint(); } } else { #[cfg(not(feature = "std"))] for _ in 0..1 << self.step.get() { + // TODO(taiki-e): once we bump the minimum required Rust version to 1.49+, + // use [`core::hint::spin_loop`] instead. + #[allow(deprecated)] atomic::spin_loop_hint(); } diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/cache_padded.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/cache_padded.rs similarity index 65% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/src/cache_padded.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/src/cache_padded.rs index 62c686b..822e831 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/cache_padded.rs +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/cache_padded.rs @@ -13,7 +13,9 @@ use core::ops::{Deref, DerefMut}; /// /// Cache lines are assumed to be N bytes long, depending on the architecture: /// -/// * On x86-64 and aarch64, N = 128. +/// * On x86-64, aarch64, and powerpc64, N = 128. +/// * On arm, mips, mips64, and riscv64, N = 32. +/// * On s390x, N = 256. /// * On all others, N = 64. /// /// Note that N is just a reasonable guess and is not guaranteed to match the actual cache line @@ -64,13 +66,63 @@ use core::ops::{Deref, DerefMut}; // - 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 +// 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/ // -#[cfg_attr(any(target_arch = "x86_64", target_arch = "aarch64"), repr(align(128)))] +// powerpc64 has 128-byte cache line size. +// +// Sources: +// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_ppc64x.go#L9 #[cfg_attr( - not(any(target_arch = "x86_64", target_arch = "aarch64")), + any( + target_arch = "x86_64", + target_arch = "aarch64", + target_arch = "powerpc64", + ), + repr(align(128)) +)] +// arm, mips, mips64, and riscv64 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/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_riscv64.go#L7 +#[cfg_attr( + any( + target_arch = "arm", + target_arch = "mips", + target_arch = "mips64", + target_arch = "riscv64", + ), + repr(align(32)) +)] +// s390x has 256-byte cache line size. +// +// Sources: +// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_s390x.go#L7 +#[cfg_attr(target_arch = "s390x", repr(align(256)))] +// x86 and wasm 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 +// +// 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 = "mips64", + target_arch = "riscv64", + target_arch = "s390x", + )), repr(align(64)) )] pub struct CachePadded { diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/lib.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/lib.rs new file mode 100644 index 0000000..880d37e --- /dev/null +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/lib.rs @@ -0,0 +1,115 @@ +//! Miscellaneous tools for concurrent programming. +//! +//! ## Atomics +//! +//! * [`AtomicCell`], a thread-safe mutable memory location. +//! * [`AtomicConsume`], for reading from primitive atomic types with "consume" ordering. +//! +//! ## Thread synchronization +//! +//! * [`Parker`], a thread parking primitive. +//! * [`ShardedLock`], a sharded reader-writer lock with fast concurrent reads. +//! * [`WaitGroup`], for synchronizing the beginning or end of some computation. +//! +//! ## Utilities +//! +//! * [`Backoff`], for exponential backoff in spin loops. +//! * [`CachePadded`], for padding and aligning a value to the length of a cache line. +//! * [`scope`], for spawning threads that borrow local variables from the stack. +//! +//! [`AtomicCell`]: atomic::AtomicCell +//! [`AtomicConsume`]: atomic::AtomicConsume +//! [`Parker`]: sync::Parker +//! [`ShardedLock`]: sync::ShardedLock +//! [`WaitGroup`]: sync::WaitGroup +//! [`scope`]: thread::scope + +#![doc(test( + no_crate_inject, + attr( + deny(warnings, rust_2018_idioms), + allow(dead_code, unused_assignments, unused_variables) + ) +))] +#![warn( + missing_docs, + missing_debug_implementations, + rust_2018_idioms, + unreachable_pub +)] +#![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(feature = "nightly", feature(cfg_target_has_atomic))] + +#[cfg(crossbeam_loom)] +#[allow(unused_imports)] +mod primitive { + pub(crate) mod sync { + pub(crate) mod atomic { + pub(crate) use loom::sync::atomic::spin_loop_hint; + pub(crate) use loom::sync::atomic::{ + AtomicBool, AtomicU16, AtomicU32, AtomicU64, AtomicU8, AtomicUsize, + }; + + // FIXME: loom does not support compiler_fence at the moment. + // https://github.com/tokio-rs/loom/issues/117 + // we use fence as a stand-in for compiler_fence for the time being. + // this may miss some races since fence is stronger than compiler_fence, + // but it's the best we can do for the time being. + pub(crate) use loom::sync::atomic::fence as compiler_fence; + } + pub(crate) use loom::sync::{Arc, Condvar, Mutex}; + } +} +#[cfg(not(crossbeam_loom))] +#[allow(unused_imports)] +mod primitive { + pub(crate) mod sync { + pub(crate) mod atomic { + pub(crate) use core::sync::atomic::compiler_fence; + // TODO(taiki-e): once we bump the minimum required Rust version to 1.49+, + // use [`core::hint::spin_loop`] instead. + #[allow(deprecated)] + pub(crate) use core::sync::atomic::spin_loop_hint; + pub(crate) use core::sync::atomic::{AtomicBool, AtomicIsize, AtomicUsize}; + #[cfg(has_atomic_u16)] + pub(crate) use core::sync::atomic::{AtomicI16, AtomicU16}; + #[cfg(has_atomic_u32)] + pub(crate) use core::sync::atomic::{AtomicI32, AtomicU32}; + #[cfg(has_atomic_u64)] + pub(crate) use core::sync::atomic::{AtomicI64, AtomicU64}; + #[cfg(has_atomic_u8)] + pub(crate) use core::sync::atomic::{AtomicI8, AtomicU8}; + } + + #[cfg(feature = "std")] + pub(crate) use std::sync::{Arc, Condvar, Mutex}; + } +} + +cfg_if! { + if #[cfg(feature = "alloc")] { + extern crate alloc; + } else if #[cfg(feature = "std")] { + extern crate std as alloc; + } +} + +#[cfg_attr(feature = "nightly", cfg(target_has_atomic = "ptr"))] +pub mod atomic; + +mod cache_padded; +pub use crate::cache_padded::CachePadded; + +mod backoff; +pub use crate::backoff::Backoff; + +use cfg_if::cfg_if; + +cfg_if! { + if #[cfg(feature = "std")] { + pub mod sync; + + #[cfg(not(crossbeam_loom))] + pub mod thread; + } +} diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/sync/mod.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/sync/mod.rs similarity index 89% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/src/sync/mod.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/src/sync/mod.rs index fd400d7..eeb740c 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/sync/mod.rs +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/sync/mod.rs @@ -5,9 +5,11 @@ //! * [`WaitGroup`], for synchronizing the beginning or end of some computation. mod parker; +#[cfg(not(crossbeam_loom))] mod sharded_lock; mod wait_group; pub use self::parker::{Parker, Unparker}; +#[cfg(not(crossbeam_loom))] pub use self::sharded_lock::{ShardedLock, ShardedLockReadGuard, ShardedLockWriteGuard}; pub use self::wait_group::WaitGroup; diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/sync/parker.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/sync/parker.rs similarity index 78% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/src/sync/parker.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/src/sync/parker.rs index fc13d2e..aefa515 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/sync/parker.rs +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/sync/parker.rs @@ -1,20 +1,19 @@ +use crate::primitive::sync::atomic::AtomicUsize; +use crate::primitive::sync::{Arc, Condvar, Mutex}; +use core::sync::atomic::Ordering::SeqCst; use std::fmt; use std::marker::PhantomData; -use std::sync::atomic::AtomicUsize; -use std::sync::atomic::Ordering::SeqCst; -use std::sync::{Arc, Condvar, Mutex}; -use std::time::Duration; +use std::time::{Duration, Instant}; /// A thread parking primitive. /// /// Conceptually, each `Parker` has an associated token which is initially not present: /// /// * The [`park`] method blocks the current thread unless or until the token is available, at -/// which point it automatically consumes the token. It may also return *spuriously*, without -/// consuming the token. +/// which point it automatically consumes the token. /// -/// * The [`park_timeout`] method works the same as [`park`], but blocks for a specified maximum -/// time. +/// * The [`park_timeout`] and [`park_deadline`] methods work the same as [`park`], but block for +/// a specified maximum time. /// /// * The [`unpark`] method atomically makes the token available if it wasn't already. Because the /// token is initially absent, [`unpark`] followed by [`park`] will result in the second call @@ -43,13 +42,13 @@ use std::time::Duration; /// u.unpark(); /// }); /// -/// // Wakes up when `u.unpark()` provides the token, but may also wake up -/// // spuriously before that without consuming the token. +/// // Wakes up when `u.unpark()` provides the token. /// p.park(); /// ``` /// /// [`park`]: Parker::park /// [`park_timeout`]: Parker::park_timeout +/// [`park_deadline`]: Parker::park_deadline /// [`unpark`]: Unparker::unpark pub struct Parker { unparker: Unparker, @@ -90,9 +89,6 @@ impl Parker { /// Blocks the current thread until the token is made available. /// - /// A call to `park` may wake up spuriously without consuming the token, and callers should be - /// prepared for this possibility. - /// /// # Examples /// /// ``` @@ -113,9 +109,6 @@ impl Parker { /// Blocks the current thread until the token is made available, but only for a limited time. /// - /// A call to `park_timeout` may wake up spuriously without consuming the token, and callers - /// should be prepared for this possibility. - /// /// # Examples /// /// ``` @@ -128,7 +121,25 @@ impl Parker { /// p.park_timeout(Duration::from_millis(500)); /// ``` pub fn park_timeout(&self, timeout: Duration) { - self.unparker.inner.park(Some(timeout)); + self.park_deadline(Instant::now() + timeout) + } + + /// Blocks the current thread until the token is made available, or until a certain deadline. + /// + /// # Examples + /// + /// ``` + /// use std::time::{Duration, Instant}; + /// use crossbeam_utils::sync::Parker; + /// + /// let p = Parker::new(); + /// let deadline = Instant::now() + Duration::from_millis(500); + /// + /// // Waits for the token to become available, but will not wait longer than 500 ms. + /// p.park_deadline(deadline); + /// ``` + pub fn park_deadline(&self, deadline: Instant) { + self.unparker.inner.park(Some(deadline)) } /// Returns a reference to an associated [`Unparker`]. @@ -227,8 +238,7 @@ impl Unparker { /// u.unpark(); /// }); /// - /// // Wakes up when `u.unpark()` provides the token, but may also wake up - /// // spuriously before that without consuming the token. + /// // Wakes up when `u.unpark()` provides the token. /// p.park(); /// ``` /// @@ -302,7 +312,7 @@ struct Inner { } impl Inner { - fn park(&self, timeout: Option) { + fn park(&self, deadline: Option) { // If we were previously notified then we consume this notification and return quickly. if self .state @@ -313,8 +323,8 @@ impl Inner { } // If the timeout is zero, then there is no need to actually block. - if let Some(ref dur) = timeout { - if *dur == Duration::from_millis(0) { + if let Some(deadline) = deadline { + if deadline <= Instant::now() { return; } } @@ -338,40 +348,42 @@ impl Inner { Err(n) => panic!("inconsistent park_timeout state: {}", n), } - match timeout { - None => { - loop { - // Block the current thread on the conditional variable. - m = self.cvar.wait(m).unwrap(); - - if self - .state - .compare_exchange(NOTIFIED, EMPTY, SeqCst, SeqCst) - .is_ok() - { - // got a notification - return; + loop { + // Block the current thread on the conditional variable. + m = match deadline { + None => self.cvar.wait(m).unwrap(), + Some(deadline) => { + let now = Instant::now(); + if now < deadline { + // We could check for a timeout here, in the return value of wait_timeout, + // but in the case that a timeout and an unpark arrive simultaneously, we + // prefer to report the former. + self.cvar.wait_timeout(m, deadline - now).unwrap().0 + } else { + // We've timed out; swap out the state back to empty on our way out + match self.state.swap(EMPTY, SeqCst) { + NOTIFIED | PARKED => return, + n => panic!("inconsistent park_timeout state: {}", n), + }; } - - // spurious wakeup, go back to sleep } - } - Some(timeout) => { - // Wait with a timeout, and if we spuriously wake up or otherwise wake up from a - // notification we just want to unconditionally set `state` back to `EMPTY`, either - // consuming a notification or un-flagging ourselves as parked. - let (_m, _result) = self.cvar.wait_timeout(m, timeout).unwrap(); + }; - match self.state.swap(EMPTY, SeqCst) { - NOTIFIED => {} // got a notification - PARKED => {} // no notification - n => panic!("inconsistent park_timeout state: {}", n), - } + if self + .state + .compare_exchange(NOTIFIED, EMPTY, SeqCst, SeqCst) + .is_ok() + { + // got a notification + return; } + + // Spurious wakeup, go back to sleep. Alternatively, if we timed out, it will be caught + // in the branch above, when we discover the deadline is in the past } } - pub fn unpark(&self) { + pub(crate) fn unpark(&self) { // To ensure the unparked thread will observe any writes we made before this call, we must // perform a release operation that `park` can synchronize with. To do that we must write // `NOTIFIED` even if `state` is already `NOTIFIED`. That is why this must be a swap rather diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/sync/sharded_lock.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/sync/sharded_lock.rs similarity index 100% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/src/sync/sharded_lock.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/src/sync/sharded_lock.rs diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/sync/wait_group.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/sync/wait_group.rs similarity index 98% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/src/sync/wait_group.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/src/sync/wait_group.rs index cd7af12..4206ee4 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/sync/wait_group.rs +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/sync/wait_group.rs @@ -1,8 +1,8 @@ // Necessary for using `Mutex` for conditional variables #![allow(clippy::mutex_atomic)] +use crate::primitive::sync::{Arc, Condvar, Mutex}; use std::fmt; -use std::sync::{Arc, Condvar, Mutex}; /// Enables threads to synchronize the beginning or end of some computation. /// diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/thread.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/thread.rs similarity index 99% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/src/thread.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/src/thread.rs index ab91be7..c57d076 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/src/thread.rs +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/src/thread.rs @@ -110,8 +110,6 @@ //! }); //! }).unwrap(); //! ``` -//! -//! [`std::thread::spawn`]: std::thread::spawn use std::fmt; use std::io; @@ -572,7 +570,6 @@ cfg_if! { } } - #[cfg(windows)] impl IntoRawHandle for ScopedJoinHandle<'_, T> { fn into_raw_handle(self) -> RawHandle { self.as_raw_handle() diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/tests/atomic_cell.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/tests/atomic_cell.rs similarity index 100% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/tests/atomic_cell.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/tests/atomic_cell.rs diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/tests/cache_padded.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/tests/cache_padded.rs similarity index 94% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/tests/cache_padded.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/tests/cache_padded.rs index be90cbe..c9e7687 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/tests/cache_padded.rs +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/tests/cache_padded.rs @@ -27,7 +27,9 @@ fn distance() { let arr = [CachePadded::new(17u8), CachePadded::new(37u8)]; let a = &*arr[0] as *const u8; let b = &*arr[1] as *const u8; - assert!(unsafe { a.offset(64) } <= b); + let align = mem::align_of::>(); + assert!(align >= 32); + assert_eq!(unsafe { a.add(align) }, b); } #[test] diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/tests/parker.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/tests/parker.rs similarity index 93% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/tests/parker.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/tests/parker.rs index f657eb1..2bf9c37 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/tests/parker.rs +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/tests/parker.rs @@ -18,7 +18,7 @@ fn park_timeout_unpark_before() { fn park_timeout_unpark_not_called() { let p = Parker::new(); for _ in 0..10 { - p.park_timeout(Duration::from_millis(10)); + p.park_timeout(Duration::from_millis(10)) } } @@ -34,7 +34,7 @@ fn park_timeout_unpark_called_other_thread() { u.unpark(); }); - p.park_timeout(Duration::from_millis(u32::MAX as u64)); + p.park_timeout(Duration::from_millis(u32::MAX as u64)) }) .unwrap(); } diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/tests/sharded_lock.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/tests/sharded_lock.rs similarity index 97% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/tests/sharded_lock.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/tests/sharded_lock.rs index 73bd489..c362154 100644 --- a/third_party/cargo/vendor/crossbeam-utils-0.8.1/tests/sharded_lock.rs +++ b/third_party/cargo/vendor/crossbeam-utils-0.8.3/tests/sharded_lock.rs @@ -176,11 +176,8 @@ fn try_write() { let write_result = lock.try_write(); match write_result { Err(TryLockError::WouldBlock) => (), - Ok(_) => assert!( - false, - "try_write should not succeed while read_guard is in scope" - ), - Err(_) => assert!(false, "unexpected error"), + Ok(_) => panic!("try_write should not succeed while read_guard is in scope"), + Err(_) => panic!("unexpected error"), } drop(read_guard); diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/tests/thread.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/tests/thread.rs similarity index 100% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/tests/thread.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/tests/thread.rs diff --git a/third_party/cargo/vendor/crossbeam-utils-0.8.1/tests/wait_group.rs b/third_party/cargo/vendor/crossbeam-utils-0.8.3/tests/wait_group.rs similarity index 100% rename from third_party/cargo/vendor/crossbeam-utils-0.8.1/tests/wait_group.rs rename to third_party/cargo/vendor/crossbeam-utils-0.8.3/tests/wait_group.rs diff --git a/third_party/cargo/vendor/darling_core-0.10.2/BUILD.bazel b/third_party/cargo/vendor/darling_core-0.10.2/BUILD.bazel index 1348956..61263a9 100644 --- a/third_party/cargo/vendor/darling_core-0.10.2/BUILD.bazel +++ b/third_party/cargo/vendor/darling_core-0.10.2/BUILD.bazel @@ -53,9 +53,9 @@ rust_library( deps = [ "//third_party/cargo/vendor/fnv-1.0.7:fnv", "//third_party/cargo/vendor/ident_case-1.0.1:ident_case", - "//third_party/cargo/vendor/proc-macro2-1.0.24:proc_macro2", - "//third_party/cargo/vendor/quote-1.0.8:quote", + "//third_party/cargo/vendor/proc-macro2-1.0.26:proc_macro2", + "//third_party/cargo/vendor/quote-1.0.9:quote", "//third_party/cargo/vendor/strsim-0.9.3:strsim", - "//third_party/cargo/vendor/syn-1.0.58:syn", + "//third_party/cargo/vendor/syn-1.0.68:syn", ], ) diff --git a/third_party/cargo/vendor/darling_macro-0.10.2/BUILD.bazel b/third_party/cargo/vendor/darling_macro-0.10.2/BUILD.bazel index 32e82bd..44a46e7 100644 --- a/third_party/cargo/vendor/darling_macro-0.10.2/BUILD.bazel +++ b/third_party/cargo/vendor/darling_macro-0.10.2/BUILD.bazel @@ -50,7 +50,7 @@ rust_library( # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/darling_core-0.10.2:darling_core", - "//third_party/cargo/vendor/quote-1.0.8:quote", - "//third_party/cargo/vendor/syn-1.0.58:syn", + "//third_party/cargo/vendor/quote-1.0.9:quote", + "//third_party/cargo/vendor/syn-1.0.68:syn", ], ) diff --git a/third_party/cargo/vendor/deflate-0.8.6/BUILD.bazel b/third_party/cargo/vendor/deflate-0.8.6/BUILD.bazel index 66d7f62..71eb976 100644 --- a/third_party/cargo/vendor/deflate-0.8.6/BUILD.bazel +++ b/third_party/cargo/vendor/deflate-0.8.6/BUILD.bazel @@ -52,6 +52,6 @@ rust_library( # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/adler32-1.2.0:adler32", - "//third_party/cargo/vendor/byteorder-1.3.4:byteorder", + "//third_party/cargo/vendor/byteorder-1.4.3:byteorder", ], ) diff --git a/third_party/cargo/vendor/derivative-2.1.3/.cargo-checksum.json b/third_party/cargo/vendor/derivative-2.1.3/.cargo-checksum.json deleted file mode 100644 index a25bf88..0000000 --- a/third_party/cargo/vendor/derivative-2.1.3/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"CHANGELOG.md":"883439cdabcbbed10bf4e7d94f87439b397de115d71be2bfb92f6f1ee5cef91d","CONTRIBUTING.md":"a699b5e04b56f1e344ab4012b648f60124096c9693edca12fd3e036bc6b3ca7a","Cargo.toml":"c894be63b80e83b584704a64bd9cc261ca50e615f9ab570ee3a94b8b832f4b34","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"e94997ba9934ce993406caf5d5002a99ac7b0692363cb801e777b961d1934b98","Makefile":"22590a5e01901b2dc7967090e9fe522434b1975c2dfcfbccf6903437b0980589","README.md":"053435f7c72fed779b907d75d71d9e1ed0d6c31f4aee7f3d04f5ccc1b0ea9507","book.json":"f6b605d80251c1d8950f625c5ffa1d224cdd15cdbb8d4f60eb74fff431311d2d","doc/Clone.md":"7a3f75f616f9d814031d3f3bf1f2e58f030ccb8b836d4d41e71cfe9ec824c66c","doc/Debug.md":"a9fb36486a8a010eea54de528e304b293f55edad83bb6f92f44f4421bdaff946","doc/Default.md":"f453b14cf4e6490eb3c73699fc4af61f8c45af300d475ff9d6b4b085feea7431","doc/Hash.md":"2ff6e80d77fa0924f045140e9fc26fe8f67829d73e783179b07ddac91b3ac039","doc/README.md":"65083885730ec3f105db5bf2e8d1b5498eca7857bc35e56275f9ad96615f3749","doc/SUMMARY.md":"2808a6f15821e2588bf32bd2e46475d347fa5cf58b32e60b872dd33354f5fe4e","doc/cmp.md":"21ebfa16067e815fdd23e93a3086b5aea43e6163ef94968044e3713e7b9e1187","doc/debug-transparent-orig.rs":"54017bd5bf08e0a28cb7cc44abeef52419514a5c6dcb0284dfc059537e93dde9","doc/debug-transparent.rs":"bd864da9e0a3e2d1ac5cfa418dac5d54734a2ab2154c9cba69296c67e35d1f5c","doc/default-enum-orig.rs":"069f6bc6a40a08819a6dfc173c066ea5e006cb521678ce5525b2767d635f94a7","doc/default-enum.rs":"85f2a96c965e3ed25eb95bfabbef8c3d6817db8d8f14d11260b748550df54d9d","doc/default-value-orig.rs":"aa896d895abd732f253055fd6b7a47ecb337d0b1ad750fd2f0d4d61aa8d72942","doc/default-value.rs":"eeab75ded762713153def8c5bd57db5e02c326101a2ff7d6955eff4302bc9a1e","doc/eq-ignore-orig.rs":"7adeffc02847edd7919b322804dc30a66990b278dd0f358a9dcc15f32826cfe2","doc/eq-ignore.rs":"d5b69842284b4e4e047fb2ecb99629b5bea0989ae6e856f3de6519004bd0420c","doc/styles/website.css":"5aa8dfc3c73061bb3f01172057613b623c038c3c3df65be7456711279f71f2dc","src/ast.rs":"7b57f0f50dce443a5ad9445b3642327d4925e5f357582c87bef586fa10e310e6","src/attr.rs":"d13217d0f6d2d19b738cbb285f832607b20ad73d636f3fe77e53c8f1e05ce36c","src/bound.rs":"5301cd93e7b38fa4cf306ee48a58de88a25f347d960f44e34ded7c5b7e92148b","src/clone.rs":"43a4299239c2d8d43deb16aa144907559cc8abc3fd11ce033631aadf0420597a","src/cmp.rs":"6f8357d33b19611165c0984024a27970940346244c55915f904d493fbb6bb600","src/debug.rs":"545a3e1e9dc566ee30554265495864e296c406e09f90900f2b46b8f37dabc09b","src/default.rs":"fc3e553a5ed104b5d43b21249c123a555098fb848b88e17815833f3941ad5e38","src/hash.rs":"40add40bef0ea2adfea4e8cf5069fd1f999960af619721ebb59cb4a3370e24fe","src/lib.rs":"9007d81f66cf3965fdb9a30adfd7c8d3e402aafb3e4cfa8da07ea1cd06d686cc","src/matcher.rs":"4073f321f2492db552936d625f2b644f8352933f45aefec9a994d327d3f75a68","src/paths.rs":"94e76fdc5e7355c46766420e22fc79be9870f1cc2ecff9b84df3b00bd316bbac","src/utils.rs":"a14bd907e2b39f30e42b19e869a360f45f35bcf69f2c5eec6a237f53b02a24c9","tests/clippy-warning-clone-from.rs":"f693afac895843ffca6f0bd287695c51ca08a395cbbca088d2c8f7efeb0800d5","tests/compile-fail/derive-debug.rs":"1cce8f5612cf7502cfaccdde74ae3c1c965795fab0b7586ac3619f3852433846","tests/compile-fail/derive-debug.stderr":"0b7725ec4c94cf1a3b58df00a9bf6c2882c4f1b8f0040bbf9739f3882e458f9b","tests/compile-fail/derive-partial-ord.rs":"5bc715422b33ecef76151ec5c99b10241fdac32116016f67e0dc64efee7a0e81","tests/compile-fail/derive-partial-ord.stderr":"5ea6bd3d52836b70d91e7bdd72cec08aa5690472a7f908b6234eec5648f74c0e","tests/compile-fail/invalid-attribute.rs":"4fa02ae9be8aefc4d4045aa0c50d30845b4d49b1048063ee5b0db99c3b16d0c1","tests/compile-fail/invalid-attribute.stderr":"593106861246871b34b4da72e2d6ba5c6759b298d87c68ff720a9bc7b2cfa193","tests/compile-fail/unknown-attribute.rs":"a746db58ff8e191b75f8a9c10c2eefc86b0f63b729fc8b140a7dd0b6c138ae2f","tests/compile-fail/unknown-attribute.stderr":"d5b24c84484677b618cea25d6896ac85a709e9ddfe907c30bc12afb443a929a5","tests/compile-fail/unknown-derive.rs":"84a4917e3ce627cc3f91930868e383d5f095730dc226e6c60563f3450b473aa0","tests/compile-fail/unknown-derive.stderr":"6e789593968794358d94f463f605491a79820b6c2de84cd46d4efa7ab01106ac","tests/compile-test.rs":"31c30e57d302f7540d721a3bc8381491ecf5441db4ec57a7fac1399d7e4de770","tests/derive-clone-generics.rs":"475f1d3bd1f3b0e916f9ee9f88ae373e64c9a68297a0d46cfc6c44e981a1a209","tests/derive-clone.rs":"358a2a501a4cb3aacf3d7ef2f3bfe5fa72c1fcbd8a1b693ae61cddf5ea468188","tests/derive-debug-bounds.rs":"b091c1a8e0365f3f13a9bc527b93d37dddd68c62a0a51c4aa80e80f18f6d1d94","tests/derive-debug-generics.rs":"0af92847c4a3814cd28210cc188dffb21015db2e23ed44c69a4155d2e0bd0529","tests/derive-debug-transparent.rs":"955ec08fa7b72072f02aaf7f0c01e90b2d2e0d5b905bff30e17a872dcbeccbae","tests/derive-debug.rs":"81a364562bad3217107593bf80fc642b36ff4f123d2d26e76fd45c6d99552783","tests/derive-default-bounds.rs":"c4444ff95e56cee027f767c06750e5311b94e3b31e7d1048093cc944160920f7","tests/derive-default.rs":"4730ce9cc728124f9f132f222030ea303b215d8710d2f46e0d6dc03f06aa81ba","tests/derive-eq.rs":"a50e1cc00a15aeef1af1a2b522eb06e42bf74951762ff2ee3ebd21697841d951","tests/derive-hash.rs":"2ca685c9b23c0a4ecac7a49a7373c2cbc2ad9b6c3cf11d041ea9d47e734415ee","tests/derive-ord.rs":"f75f8e93ff3114624fb851b3f8e87cb75b556f4a65d22e0c7bd9386cbed43025","tests/derive-partial-eq.rs":"0f14a62b0c3ae307e5c5b5637c06b104ea5d2bba8ce8abcb1e934c95c6331e14","tests/issue-37-turbofish.rs":"a764c62bac99c8b3cbece751842cecebdb095eda82f1799854a91a45519a79aa","tests/issue-55.rs":"6369af939a63b4cc3005cb6dcfcfa11c30fbb95fcf36e6ed507802a8cccc976f","tests/issue-57.rs":"7aa8e493630af3734167f1d682b82b167337efd2dcb15a799e8aa0f40832ddaa","tests/issue-58.rs":"2564dabadb4a3793a37d0eb574018aca2232b446f80971a6ecf86c34a35cabea","tests/issue-67.rs":"aa17dbd0a508f05e5f3b2cd210a67fd6d5f53032dc1dcd81ec99836d4615d422","tests/rustc-class-implement-traits.rs":"0db94627fa5fd39fc840168acf9a95b3bbf8c4c1dbdc38399f2e89a57391ad1b","tests/rustc-deriving-bounds.rs":"5b36074a476b7ecf1819d3c69d869bf938aa167f54732fd1fd8738fbe0610773","tests/rustc-deriving-clone-array.rs":"66c7d2275578f52e5cd9a64fbf43f1d68a52b7eeabd456509dbb430ef180cf3d","tests/rustc-deriving-clone-enum.rs":"44cdb8703c5b7e14a3921867d638065aacbed0ff0772249aaba3806f9b5d57aa","tests/rustc-deriving-clone-generic-enum.rs":"939c754f019026a60f2ef6320a207261400da08cb8a3a90792b34d95ce7b1291","tests/rustc-deriving-clone-generic-tuple-struct.rs":"e88751ff59207c2b67d462af99437479eea90d1f796304c6f8677e7391b09407","tests/rustc-deriving-clone-struct.rs":"7123824d3ed591527e682270fbc05fa6e11b3e4ba6dffc82136c17d0034ca885","tests/rustc-deriving-clone-tuple-struct.rs":"85464fc39ac16fd84d0fc2e47a54a22ebeb01972c0418b7b9c78801efbd22a3c","tests/rustc-deriving-cmp-generic-enum.rs":"c3f4f5ca69bdf0026d41a4068364ab40097754156ea14ff7588f06e292a43fd8","tests/rustc-deriving-cmp-generic-struct-enum.rs":"b91090b31ee52cb8a07a8393c7a68df0a05ecb4af7d6cce6485c44e102402237","tests/rustc-deriving-cmp-generic-struct.rs":"7d95b78821c7b80da4d76678d7da148ce7575fe0be4c2abb70496c67def06ea7","tests/rustc-deriving-cmp-generic-tuple-struct.rs":"3f61566dd2524d2bc4feabe5605ba4e2f2ebf24fb3d1507bee287e582e96ac6c","tests/rustc-deriving-copyclone.rs":"7afd040a11d557bf403b27ed1c30a512123afaa77841b4e0e1d9cfc0edb497e3","tests/rustc-deriving-default-box.rs":"002f32d294f3e837b2fc98b823248c1131c650b4bbe74ad945c2a6101fa55edf","tests/rustc-deriving-enum-single-variant.rs":"bd3ddd0d1e0244b5632b0292301e8690334b1aff4f4f3d8be1ceaaa96c759e24","tests/rustc-deriving-hash.rs":"bbac3ae2f3a76f1c3fa44ef40b8f64b76274d1d710f8055dc54f2d02dc98baa3","tests/rustc-deriving-in-fn.rs":"8cd53d58a22aa1d5b9a7f26b7fb976e0d55dfd23de181d264964e8a29f126a69","tests/rustc-deriving-meta-multiple.rs":"cdb9f6ef2f46c392d059479778bd1dfbff3c221349c92b6acd2cf2c9ddb37de3","tests/rustc-deriving-meta.rs":"0d03a96f1e9eb9c20bce6db4ea9d951c4fc6323348d1b4a238b9cfc0c102f0b3","tests/rustc-deriving-show-2.rs":"f81a0c5578b1bb7734868021f51a572ec99bebdad7c84bea010bd9b979bf7849","tests/rustc-deriving-show.rs":"198a6c7e12548c45386c14e0a34b00cd41b0457b283eda7ac3d8d4668be9d5ca","tests/rustc-deriving-via-extension-hash-enum.rs":"d3745842c76149ac0dd44afab1b0dd1fda45b8e209fa5b2194bc8ed3f4462369","tests/rustc-deriving-via-extension-hash-struct.rs":"3c5090aa4945283bf61d27600e8d30e1e98c93dd11bfa3bcf1b1f6da1e6d6d4c","tests/rustc-deriving-via-extension-type-params.rs":"c26b31b763b0872b3a11a690e0694a98a1bdc4f305dec05af514f87c2060e62a","tests/rustc-expr-copy.rs":"35c8658a331c1153fc3540125eba9866561ecc9633f82782bd432697a17534c6","tests/rustc-exterior.rs":"cd34d539dae467f27942af90c8007986608f70cfaed020aa8e4ed73b42220ba3","tests/rustc-issue-12860.rs":"b050cbd745ba2c1881344522ec5d0307c7f05ea771a8251784e292362df0a370","tests/rustc-issue-13434.rs":"030a2a7d47e53c2153b9b7ef072ba12aa8a6fef0ec511cfcd0c9d09968c41c07","tests/rustc-issue-16530.rs":"4fbe95ca9cffb9dd2b8a60f98ce64996eb8611e2881dcdff4da111563c3eed6d","tests/rustc-issue-19037.rs":"8728e176d24ae0803ef93ef4c81d17a7fd0c7dd84f175a345c6de7ca09c95069","tests/rustc-issue-19102.rs":"7c08c4a3625d585e8f7218b5864912c9d9b02ef81659e601849f22b4bf2fec62","tests/rustc-issue-19135.rs":"537227d0146be2093be0f4641a9860a68bc5e4660ccd30d2e2a10b39794f4c1f","tests/rustc-issue-19358.rs":"38d50e72f619a6a7214094f103ef04cbe4f6fcbf6a11eab7c247a53e60ce3f02","tests/rustc-issue-21402.rs":"842431d5dbcdb72ab20749480f4334a9a63d68357780469fa28755cda4072f80","tests/rustc-issue-23649-3.rs":"dc66e6707881cf01dc8cd499ea5eae989a724885716b94079f869175c3770bf1","tests/rustc-issue-24085.rs":"abd26755ae5d322c6af20fedef1faf8a3fe43c6c79385200413d7a04138b1c6e","tests/rustc-issue-25394.rs":"643e7f990acc72eaba9403d515c4762393cdee50398cdc9231c841682717ea5d","tests/rustc-issue-28561.rs":"3f703d54fbb86d4fa0cadf1b7d3a60d09b50dc95690b81a287c8a35d4e77ff52","tests/rustc-issue-29030.rs":"741fee2ee04ff650445537555299347930ec3479ff9f0a85845271c48696ccf6","tests/rustc-issue-29540.rs":"d7b28cf54f8346215ebf909fab1cab9b60aed93d3089d23d7818e557daae9fdb","tests/rustc-issue-29710.rs":"5b6ba4496f31faa4d419975fe0f059bee923a3fb4053315c5a78d512fa5ba2ea","tests/rustc-issue-32292.rs":"e2825020deff6b73bdc51b452a34520b30344cce33efe40242baa599b7999e77","tests/rustc-issue-3935.rs":"1460907d4f5cda59b48a7c1a449b376a0797d7fd14ea4971484705d34c79a0fe","tests/rustc-issue-42453.rs":"a28b83ea4dbe1ae6ea6e4614cf49235f646ff6b8db6c5fa658ad6a34cada5baa","tests/rustc-issue-58319.rs":"47545e8180b3cbfdc45cf2c7d0d810dc0ebdd154fb0fae087ab078d2f2d87ebe","tests/rustc-issue-6341.rs":"7563bdc3556cfbfd15d61911f2bf45ba9e2334316d9939aacbd150b36ad461e1","tests/rustc-typeclasses-eq-example.rs":"cf067051f8d62125d0244f8918ec5f0ccc7d4a4b6b74a8811c0e723091c23682","tests/rustc-zero-sized-btreemap-insert.rs":"2da53be3a7fe9cb2f66829d2ea798bc4024f1625e52f85d5b3087a3e3bc82fa3"},"package":"eaed5874effa6cde088c644ddcdcb4ffd1511391c5be4fdd7a5ccd02c7e4a183"} \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.1.3/Makefile b/third_party/cargo/vendor/derivative-2.1.3/Makefile deleted file mode 100644 index 001c0ff..0000000 --- a/third_party/cargo/vendor/derivative-2.1.3/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -publish_doc: - ./node_modules/gitbook-cli/bin/gitbook.js build - rm -fr /tmp/_book - git clone --branch gh-pages --single-branch git@github.com:mcarton/rust-derivative.git /tmp/_book - rm -rf /tmp/_book/* - mv _book/* /tmp/_book - cd /tmp/_book; git add .; git com -am Autogenerate; git push -f diff --git a/third_party/cargo/vendor/derivative-2.1.3/book.json b/third_party/cargo/vendor/derivative-2.1.3/book.json deleted file mode 100644 index d356a4f..0000000 --- a/third_party/cargo/vendor/derivative-2.1.3/book.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "root": "doc", - "title": "Derivative", - "language": "en", - "plugins": ["-search", "-sharing", "codesnippet", "edit-link", "anchors"], - "pluginsConfig": { - "edit-link": { - "base": "https://github.com/mcarton/rust-derivative/tree/master/doc", - "label": "Edit" - } - } -} diff --git a/third_party/cargo/vendor/derivative-2.1.3/doc/SUMMARY.md b/third_party/cargo/vendor/derivative-2.1.3/doc/SUMMARY.md deleted file mode 100644 index 591048a..0000000 --- a/third_party/cargo/vendor/derivative-2.1.3/doc/SUMMARY.md +++ /dev/null @@ -1,25 +0,0 @@ -# Summary - -* [Overview](README.md) -* [`Copy` and `Clone` traits](Clone.md) - * [`clone_from`](Clone.md#clone-from) - * [Custom bound](Clone.md#custom-bound) -* [`Debug` trait](Debug.md) - * [Hiding fields](Debug.md#ignoring-a-field) - * [Hiding newtypes](Debug.md#hiding-newtypes) - * [Alternative format function](Debug.md#format-with) - * [Custom bound](Debug.md#custom-bound) -* [`Default` trait](Default.md) - * [Default enumeration](Default.md#default-enumeration) - * [Setting the value of a field](Default.md#setting-the-value-of-a-field) - * [`new` function](Default.md#new-function) - * [Custom bound](Default.md#custom-bound) -* [`Hash` trait](Hash.md) - * [Ignoring fields](Hash.md#ignoring-a-field) - * [Alternative hash function](Debug.md#hash-with) - * [Custom bound](Hash.md#custom-bound) -* [Comparison traits](cmp.md) - * [Note about enumerations](cmp.md#enumerations) - * [Ignoring fields](cmp.md#ignoring-a-field) - * [Alternative comparison function](cmp.md#compare-with) - * [Custom bound](cmp.md#custom-bound) diff --git a/third_party/cargo/vendor/derivative-2.1.3/doc/debug-transparent.rs b/third_party/cargo/vendor/derivative-2.1.3/doc/debug-transparent.rs deleted file mode 100644 index 2c1628c..0000000 --- a/third_party/cargo/vendor/derivative-2.1.3/doc/debug-transparent.rs +++ /dev/null @@ -1,3 +0,0 @@ -#[derive(Derivative)] -#[derivative(Debug="transparent")] -pub struct Wrapping(pub T); diff --git a/third_party/cargo/vendor/derivative-2.1.3/src/cmp.rs b/third_party/cargo/vendor/derivative-2.1.3/src/cmp.rs deleted file mode 100644 index 0bfb766..0000000 --- a/third_party/cargo/vendor/derivative-2.1.3/src/cmp.rs +++ /dev/null @@ -1,346 +0,0 @@ -// https://github.com/rust-lang/rust/issues/13101 - -use proc_macro2; - -use ast; -use attr; -use matcher; -use paths; -use syn; -use utils; - -/// Derive `Eq` for `input`. -pub fn derive_eq(input: &ast::Input) -> proc_macro2::TokenStream { - let name = &input.ident; - - let eq_trait_path = eq_trait_path(); - let generics = utils::build_impl_generics( - input, - &eq_trait_path, - needs_eq_bound, - |field| field.eq_bound(), - |input| input.eq_bound(), - ); - let (impl_generics, ty_generics, where_clause) = generics.split_for_impl(); - - quote! { - #[allow(unused_qualifications)] - impl #impl_generics #eq_trait_path for #name #ty_generics #where_clause {} - } -} - -/// Derive `PartialEq` for `input`. -pub fn derive_partial_eq(input: &ast::Input) -> proc_macro2::TokenStream { - let discriminant_cmp = if let ast::Body::Enum(_) = input.body { - let discriminant_path = paths::discriminant_path(); - - quote!((#discriminant_path(&*self) == #discriminant_path(&*other))) - } else { - quote!(true) - }; - let body = matcher::Matcher::new(matcher::BindingStyle::Ref).build_2_arms( - (input, "__self"), - (input, "__other"), - |_, _, _, (left_variant, right_variant)| { - let cmp = left_variant.iter().zip(&right_variant).map(|(o, i)| { - let outer_name = &o.ident; - let inner_name = &i.ident; - - if o.field.attrs.ignore_partial_eq() { - None - } else if let Some(compare_fn) = o.field.attrs.partial_eq_compare_with() { - Some(quote!(&& #compare_fn(#outer_name, #inner_name))) - } else { - Some(quote!(&& #outer_name == #inner_name)) - } - }); - - quote!(true #(#cmp)*) - }, - ); - - let name = &input.ident; - - let partial_eq_trait_path = partial_eq_trait_path(); - let generics = utils::build_impl_generics( - input, - &partial_eq_trait_path, - needs_partial_eq_bound, - |field| field.partial_eq_bound(), - |input| input.partial_eq_bound(), - ); - let (impl_generics, ty_generics, where_clause) = generics.split_for_impl(); - - let match_fields = if input.is_trivial_enum() { - quote!(true) - } else { - quote! { - match (&*self, &*other) { - #body - _ => unreachable!(), - } - } - }; - - quote! { - #[allow(unused_qualifications)] - impl #impl_generics #partial_eq_trait_path for #name #ty_generics #where_clause { - fn eq(&self, other: &Self) -> bool { - #discriminant_cmp && #match_fields - } - } - } -} - -/// Derive `PartialOrd` for `input`. -pub fn derive_partial_ord(input: &ast::Input, errors: &mut proc_macro2::TokenStream) -> proc_macro2::TokenStream { - if let ast::Body::Enum(_) = input.body { - if !input.attrs.partial_ord_on_enum() { - let message = "can't use `#[derivative(PartialOrd)]` on an enumeration without \ - `feature_allow_slow_enum`; see the documentation for more details"; - errors.extend( - syn::Error::new(input.span, message).to_compile_error() - ); - } - } - - let option_path = option_path(); - let ordering_path = ordering_path(); - - let body = matcher::Matcher::new(matcher::BindingStyle::Ref).build_arms( - input, - "__self", - |_, n, _, _, _, outer_bis| { - let body = matcher::Matcher::new(matcher::BindingStyle::Ref).build_arms( - input, - "__other", - |_, m, _, _, _, inner_bis| match n.cmp(&m) { - ::std::cmp::Ordering::Less => quote!(#option_path::Some(#ordering_path::Less)), - ::std::cmp::Ordering::Greater => { - quote!(#option_path::Some(#ordering_path::Greater)) - } - ::std::cmp::Ordering::Equal => { - let equal_path = quote!(#ordering_path::Equal); - outer_bis - .iter() - .rev() - .zip(inner_bis.into_iter().rev()) - .fold(quote!(#option_path::Some(#equal_path)), |acc, (o, i)| { - let outer_name = &o.ident; - let inner_name = &i.ident; - - if o.field.attrs.ignore_partial_ord() { - acc - } else { - let cmp_fn = o - .field - .attrs - .partial_ord_compare_with() - .map(|f| quote!(#f)) - .unwrap_or_else(|| { - let path = partial_ord_trait_path(); - quote!(#path::partial_cmp) - }); - - quote!(match #cmp_fn(&(*#outer_name), &(*#inner_name)) { - #option_path::Some(#equal_path) => #acc, - __derive_ordering_other => __derive_ordering_other, - }) - } - }) - } - }, - ); - - quote! { - match *other { - #body - } - - } - }, - ); - - let name = &input.ident; - - let partial_ord_trait_path = partial_ord_trait_path(); - let generics = utils::build_impl_generics( - input, - &partial_ord_trait_path, - needs_partial_ord_bound, - |field| field.partial_ord_bound(), - |input| input.partial_ord_bound(), - ); - let (impl_generics, ty_generics, where_clause) = generics.split_for_impl(); - - quote! { - #[allow(unused_qualifications)] - impl #impl_generics #partial_ord_trait_path for #name #ty_generics #where_clause { - fn partial_cmp(&self, other: &Self) -> #option_path<#ordering_path> { - match *self { - #body - } - } - } - } -} - -/// Derive `Ord` for `input`. -pub fn derive_ord(input: &ast::Input, errors: &mut proc_macro2::TokenStream) -> proc_macro2::TokenStream { - if let ast::Body::Enum(_) = input.body { - if !input.attrs.ord_on_enum() { - let message = "can't use `#[derivative(Ord)]` on an enumeration without \ - `feature_allow_slow_enum`; see the documentation for more details"; - errors.extend( - syn::Error::new(input.span, message).to_compile_error() - ); - } - } - - let ordering_path = ordering_path(); - - let body = matcher::Matcher::new(matcher::BindingStyle::Ref).build_arms( - input, - "__self", - |_, n, _, _, _, outer_bis| { - let body = matcher::Matcher::new(matcher::BindingStyle::Ref).build_arms( - input, - "__other", - |_, m, _, _, _, inner_bis| match n.cmp(&m) { - ::std::cmp::Ordering::Less => quote!(#ordering_path::Less), - ::std::cmp::Ordering::Greater => quote!(#ordering_path::Greater), - ::std::cmp::Ordering::Equal => { - let equal_path = quote!(#ordering_path::Equal); - outer_bis - .iter() - .rev() - .zip(inner_bis.into_iter().rev()) - .fold(quote!(#equal_path), |acc, (o, i)| { - let outer_name = &o.ident; - let inner_name = &i.ident; - - if o.field.attrs.ignore_ord() { - acc - } else { - let cmp_fn = o - .field - .attrs - .ord_compare_with() - .map(|f| quote!(#f)) - .unwrap_or_else(|| { - let path = ord_trait_path(); - quote!(#path::cmp) - }); - - quote!(match #cmp_fn(&(*#outer_name), &(*#inner_name)) { - #equal_path => #acc, - __derive_ordering_other => __derive_ordering_other, - }) - } - }) - } - }, - ); - - quote! { - match *other { - #body - } - - } - }, - ); - - let name = &input.ident; - - let ord_trait_path = ord_trait_path(); - let generics = utils::build_impl_generics( - input, - &ord_trait_path, - needs_ord_bound, - |field| field.ord_bound(), - |input| input.ord_bound(), - ); - let (impl_generics, ty_generics, where_clause) = generics.split_for_impl(); - - quote! { - #[allow(unused_qualifications)] - impl #impl_generics #ord_trait_path for #name #ty_generics #where_clause { - fn cmp(&self, other: &Self) -> #ordering_path { - match *self { - #body - } - } - } - } -} - -fn needs_partial_eq_bound(attrs: &attr::Field) -> bool { - !attrs.ignore_partial_eq() && attrs.partial_eq_bound().is_none() -} - -fn needs_partial_ord_bound(attrs: &attr::Field) -> bool { - !attrs.ignore_partial_ord() && attrs.partial_ord_bound().is_none() -} - -fn needs_ord_bound(attrs: &attr::Field) -> bool { - !attrs.ignore_ord() && attrs.ord_bound().is_none() -} - -fn needs_eq_bound(attrs: &attr::Field) -> bool { - !attrs.ignore_partial_eq() && attrs.eq_bound().is_none() -} - -/// Return the path of the `Eq` trait, that is `::std::cmp::Eq`. -fn eq_trait_path() -> syn::Path { - if cfg!(feature = "use_core") { - parse_quote!(::core::cmp::Eq) - } else { - parse_quote!(::std::cmp::Eq) - } -} - -/// Return the path of the `PartialEq` trait, that is `::std::cmp::PartialEq`. -fn partial_eq_trait_path() -> syn::Path { - if cfg!(feature = "use_core") { - parse_quote!(::core::cmp::PartialEq) - } else { - parse_quote!(::std::cmp::PartialEq) - } -} - -/// Return the path of the `PartialOrd` trait, that is `::std::cmp::PartialOrd`. -fn partial_ord_trait_path() -> syn::Path { - if cfg!(feature = "use_core") { - parse_quote!(::core::cmp::PartialOrd) - } else { - parse_quote!(::std::cmp::PartialOrd) - } -} - -/// Return the path of the `Ord` trait, that is `::std::cmp::Ord`. -fn ord_trait_path() -> syn::Path { - if cfg!(feature = "use_core") { - parse_quote!(::core::cmp::Ord) - } else { - parse_quote!(::std::cmp::Ord) - } -} - -/// Return the path of the `Option` trait, that is `::std::option::Option`. -fn option_path() -> syn::Path { - if cfg!(feature = "use_core") { - parse_quote!(::core::option::Option) - } else { - parse_quote!(::std::option::Option) - } -} - -/// Return the path of the `Ordering` trait, that is `::std::cmp::Ordering`. -fn ordering_path() -> syn::Path { - if cfg!(feature = "use_core") { - parse_quote!(::core::cmp::Ordering) - } else { - parse_quote!(::std::cmp::Ordering) - } -} \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.2.0/.cargo-checksum.json b/third_party/cargo/vendor/derivative-2.2.0/.cargo-checksum.json new file mode 100644 index 0000000..87be638 --- /dev/null +++ b/third_party/cargo/vendor/derivative-2.2.0/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"092ab0f1848e7d8df682d4f2949773a530e5f08e5a20963a1e0c87977c9ecd94","CONTRIBUTING.md":"c0652d83a460d4a7fa4d25a88cd6b436d7bf2da83186cd18170187fe43297502","Cargo.toml":"facfa3aa874a8e11be2678464da82680a992c78753ba8d8ba90fda57be9cc6e5","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"e94997ba9934ce993406caf5d5002a99ac7b0692363cb801e777b961d1934b98","README.md":"65c92addca07a0fc7c01e5399848876d50548e210e5272388d2c42286a5a421e","book.toml":"12a9954378c736c880cb3347355ed0a54c1bc30424d3ef01782bdf869c203dad","doc/Clone.md":"1b6eaa318c4549537c42a7c5b2940ca2eb7af2315dea43d4fe814ad1ae558642","doc/Debug.md":"5c94cf9a59d2b049c5b77ae503be8a275610009c12d7bf1475dffba85737e0e5","doc/Default.md":"30f9e3bc8c5570751d5e8cc8c06326d6b0c8fcd189296d4e3864ad3825400e45","doc/Hash.md":"f3fd21be426bc0fd823245445ed7765d9b158934686a1c7bb3011f99e2eba287","doc/README.md":"0107b47c86b3a0c4efcd719ddfed3bb50cb8aa87f02484bf6a2349b2a7b92963","doc/SUMMARY.md":"e4a8fbebc75befcac4c17cc8d2b06c593b4ab143efc75bb563d22818c6a5e680","doc/cmp.md":"42f95d52f1e393e59935f8e0dd19d87d4c664e8eaab80e8cf20afd18afff9374","doc/custom.css":"6d26d0483b1b69b236d7a320c5f95b24186d7d1d8609ad4e17433719898a3619","doc/debug-transparent-orig.rs":"dd9ae1fc8914ea0ca6167a22f94e6679cfe5d2e3735515c04c42c51ba265a6ef","doc/debug-transparent.rs":"923db7de034a9dfec13fd60231df89d83a680746220d89474b47fd96e3cab567","doc/default-enum-orig.rs":"d1390b4ca8a1e2482e2beb70ebac9a4b8922af8fba54fc2cc41623549865c4e0","doc/default-enum.rs":"3f87634a2c79b2ce526ae7cdfab3d037d1f744072b445f0d3c8a155f456b83bc","doc/default-value-orig.rs":"873c599d74003f4896ae7785b2c60e3fbc0625e56fd51c865243acda318025c6","doc/default-value.rs":"97fc93cb3c138fb5956cd7a221454a2cdc5dd65a1fdf25bc3701d4071e55d7d6","doc/eq-ignore-orig.rs":"de33bd171339aa7ff39bc891665d4b8cd6b557212371eee69395f0975047fb3f","doc/eq-ignore.rs":"df84bfce35e3d3add596b6c83b823471911340e051d0b00d320bef5f5953135e","doc/styles/website.css":"5aa8dfc3c73061bb3f01172057613b623c038c3c3df65be7456711279f71f2dc","src/ast.rs":"955c218a9e33e60d74019fe5b14eb01f232f90e0d152d6bdc61d4277cb0da82f","src/attr.rs":"55c5a2db82ade119288f0fabd713cd16274d28c01465c1a52abfd991a9f839a2","src/bound.rs":"5301cd93e7b38fa4cf306ee48a58de88a25f347d960f44e34ded7c5b7e92148b","src/clone.rs":"0259b59bdf187d78b55a46095a08495262e1ff674f117e6af56078acc1c7a9a8","src/cmp.rs":"a4a47ab3dcfee3f236cc611e76bdb5cf7bd0fa24593e48a4e2ad972b97cb63d9","src/debug.rs":"6747d5f78d5918d5e133878f03b574bc6b1b239ca95397e0c9eb414cc80cbc01","src/default.rs":"fc3e553a5ed104b5d43b21249c123a555098fb848b88e17815833f3941ad5e38","src/hash.rs":"67147861123a28e7e390b267a46151ee23bdd5e37347be08c451c831e37861c1","src/lib.rs":"9007d81f66cf3965fdb9a30adfd7c8d3e402aafb3e4cfa8da07ea1cd06d686cc","src/matcher.rs":"3e9754ef40f6546852e3290a33bb220c3c7dd21908d5edc339f4083d2e0659af","src/paths.rs":"94e76fdc5e7355c46766420e22fc79be9870f1cc2ecff9b84df3b00bd316bbac","src/utils.rs":"a14bd907e2b39f30e42b19e869a360f45f35bcf69f2c5eec6a237f53b02a24c9","tests/clippy-warning-clone-from.rs":"f693afac895843ffca6f0bd287695c51ca08a395cbbca088d2c8f7efeb0800d5","tests/compile-fail/derive-debug-unused.rs":"e27b0afef3e828aee94f9fb4a56f388e9983f3643a18309b256c1edd359e14ac","tests/compile-fail/derive-debug-unused.stderr":"e18e1bcc17edfed30b9d81b2d7106582ca50fcfc6516b223b409ca980b0817ad","tests/compile-fail/derive-debug.rs":"1cce8f5612cf7502cfaccdde74ae3c1c965795fab0b7586ac3619f3852433846","tests/compile-fail/derive-debug.stderr":"41db2d73012ec4cfac8198833eed3b91434a29531c934274ad6dfaadb513f1ee","tests/compile-fail/derive-partial-ord.rs":"5bc715422b33ecef76151ec5c99b10241fdac32116016f67e0dc64efee7a0e81","tests/compile-fail/derive-partial-ord.stderr":"5ea6bd3d52836b70d91e7bdd72cec08aa5690472a7f908b6234eec5648f74c0e","tests/compile-fail/invalid-attribute.rs":"4fa02ae9be8aefc4d4045aa0c50d30845b4d49b1048063ee5b0db99c3b16d0c1","tests/compile-fail/invalid-attribute.stderr":"593106861246871b34b4da72e2d6ba5c6759b298d87c68ff720a9bc7b2cfa193","tests/compile-fail/unknown-attribute.rs":"a746db58ff8e191b75f8a9c10c2eefc86b0f63b729fc8b140a7dd0b6c138ae2f","tests/compile-fail/unknown-attribute.stderr":"d5b24c84484677b618cea25d6896ac85a709e9ddfe907c30bc12afb443a929a5","tests/compile-fail/unknown-derive.rs":"84a4917e3ce627cc3f91930868e383d5f095730dc226e6c60563f3450b473aa0","tests/compile-fail/unknown-derive.stderr":"6e789593968794358d94f463f605491a79820b6c2de84cd46d4efa7ab01106ac","tests/compile-test.rs":"31c30e57d302f7540d721a3bc8381491ecf5441db4ec57a7fac1399d7e4de770","tests/derive-clone-generics.rs":"475f1d3bd1f3b0e916f9ee9f88ae373e64c9a68297a0d46cfc6c44e981a1a209","tests/derive-clone.rs":"358a2a501a4cb3aacf3d7ef2f3bfe5fa72c1fcbd8a1b693ae61cddf5ea468188","tests/derive-debug-bounds.rs":"ddcd33f77cf2bc66e42ea68b9e64f399c66bcf09fc3d24e179761e09c15d2c7d","tests/derive-debug-generics.rs":"8a12be8ae70831a3a0f78dbda062dc631c60870c8e34ca1b750756678e7f1d28","tests/derive-debug-packed.rs":"dab1ab95d0373dc4985971f17088bae5cf54bdf31563ddf898314054d7a79f1d","tests/derive-debug-transparent.rs":"955ec08fa7b72072f02aaf7f0c01e90b2d2e0d5b905bff30e17a872dcbeccbae","tests/derive-debug.rs":"8d22095a24c6c5f8843b68f9c9bd66cd5b4cbf8f77c6bc6bce8903b74ebbc8e7","tests/derive-default-bounds.rs":"c4444ff95e56cee027f767c06750e5311b94e3b31e7d1048093cc944160920f7","tests/derive-default.rs":"4730ce9cc728124f9f132f222030ea303b215d8710d2f46e0d6dc03f06aa81ba","tests/derive-eq-packed.rs":"39183b23d3135110e88a2b02ffc5ef2bcfa9335b8eed9a5625875dd73204eac7","tests/derive-eq.rs":"a50e1cc00a15aeef1af1a2b522eb06e42bf74951762ff2ee3ebd21697841d951","tests/derive-hash.rs":"2ca685c9b23c0a4ecac7a49a7373c2cbc2ad9b6c3cf11d041ea9d47e734415ee","tests/derive-ord-packed.rs":"fb7f43cf57a9d12b4227d41d8c9dc0562fdd6a780949b4eeaa0a127527da444d","tests/derive-ord.rs":"f75f8e93ff3114624fb851b3f8e87cb75b556f4a65d22e0c7bd9386cbed43025","tests/derive-partial-eq-packed.rs":"b4e97dbb4db3fb6c9cd325b289fb28b25b366911eda4fcbf177a0f835bb4c6db","tests/derive-partial-eq.rs":"d698dbbb742d605becea5a53c00f07fcda26fbbc319cef3ceb51ea2d90f369a7","tests/issue-37-turbofish.rs":"a764c62bac99c8b3cbece751842cecebdb095eda82f1799854a91a45519a79aa","tests/issue-55.rs":"6369af939a63b4cc3005cb6dcfcfa11c30fbb95fcf36e6ed507802a8cccc976f","tests/issue-57.rs":"7aa8e493630af3734167f1d682b82b167337efd2dcb15a799e8aa0f40832ddaa","tests/issue-58.rs":"66a341be75c76b4ce0353ed27ca4ab426ce123cb34cc3122aa615bf4f88612a6","tests/issue-67.rs":"aa17dbd0a508f05e5f3b2cd210a67fd6d5f53032dc1dcd81ec99836d4615d422","tests/issue-82.rs":"74338c02ba0c0d287a863bd07a9f6bf849aa46319fb7a82707bcaea188248ad0","tests/rustc-class-implement-traits.rs":"0db94627fa5fd39fc840168acf9a95b3bbf8c4c1dbdc38399f2e89a57391ad1b","tests/rustc-deriving-bounds.rs":"5b36074a476b7ecf1819d3c69d869bf938aa167f54732fd1fd8738fbe0610773","tests/rustc-deriving-clone-array.rs":"66c7d2275578f52e5cd9a64fbf43f1d68a52b7eeabd456509dbb430ef180cf3d","tests/rustc-deriving-clone-enum.rs":"44cdb8703c5b7e14a3921867d638065aacbed0ff0772249aaba3806f9b5d57aa","tests/rustc-deriving-clone-generic-enum.rs":"939c754f019026a60f2ef6320a207261400da08cb8a3a90792b34d95ce7b1291","tests/rustc-deriving-clone-generic-tuple-struct.rs":"e88751ff59207c2b67d462af99437479eea90d1f796304c6f8677e7391b09407","tests/rustc-deriving-clone-struct.rs":"7123824d3ed591527e682270fbc05fa6e11b3e4ba6dffc82136c17d0034ca885","tests/rustc-deriving-clone-tuple-struct.rs":"85464fc39ac16fd84d0fc2e47a54a22ebeb01972c0418b7b9c78801efbd22a3c","tests/rustc-deriving-cmp-generic-enum.rs":"c3f4f5ca69bdf0026d41a4068364ab40097754156ea14ff7588f06e292a43fd8","tests/rustc-deriving-cmp-generic-struct-enum.rs":"b91090b31ee52cb8a07a8393c7a68df0a05ecb4af7d6cce6485c44e102402237","tests/rustc-deriving-cmp-generic-struct.rs":"7d95b78821c7b80da4d76678d7da148ce7575fe0be4c2abb70496c67def06ea7","tests/rustc-deriving-cmp-generic-tuple-struct.rs":"3f61566dd2524d2bc4feabe5605ba4e2f2ebf24fb3d1507bee287e582e96ac6c","tests/rustc-deriving-copyclone.rs":"7afd040a11d557bf403b27ed1c30a512123afaa77841b4e0e1d9cfc0edb497e3","tests/rustc-deriving-default-box.rs":"002f32d294f3e837b2fc98b823248c1131c650b4bbe74ad945c2a6101fa55edf","tests/rustc-deriving-enum-single-variant.rs":"bd3ddd0d1e0244b5632b0292301e8690334b1aff4f4f3d8be1ceaaa96c759e24","tests/rustc-deriving-hash.rs":"bbac3ae2f3a76f1c3fa44ef40b8f64b76274d1d710f8055dc54f2d02dc98baa3","tests/rustc-deriving-in-fn.rs":"8cd53d58a22aa1d5b9a7f26b7fb976e0d55dfd23de181d264964e8a29f126a69","tests/rustc-deriving-meta-multiple.rs":"cdb9f6ef2f46c392d059479778bd1dfbff3c221349c92b6acd2cf2c9ddb37de3","tests/rustc-deriving-meta.rs":"0d03a96f1e9eb9c20bce6db4ea9d951c4fc6323348d1b4a238b9cfc0c102f0b3","tests/rustc-deriving-show-2.rs":"f81a0c5578b1bb7734868021f51a572ec99bebdad7c84bea010bd9b979bf7849","tests/rustc-deriving-show.rs":"198a6c7e12548c45386c14e0a34b00cd41b0457b283eda7ac3d8d4668be9d5ca","tests/rustc-deriving-via-extension-hash-enum.rs":"d3745842c76149ac0dd44afab1b0dd1fda45b8e209fa5b2194bc8ed3f4462369","tests/rustc-deriving-via-extension-hash-struct.rs":"3c5090aa4945283bf61d27600e8d30e1e98c93dd11bfa3bcf1b1f6da1e6d6d4c","tests/rustc-deriving-via-extension-type-params.rs":"c26b31b763b0872b3a11a690e0694a98a1bdc4f305dec05af514f87c2060e62a","tests/rustc-expr-copy.rs":"35c8658a331c1153fc3540125eba9866561ecc9633f82782bd432697a17534c6","tests/rustc-exterior.rs":"cd34d539dae467f27942af90c8007986608f70cfaed020aa8e4ed73b42220ba3","tests/rustc-issue-12860.rs":"b050cbd745ba2c1881344522ec5d0307c7f05ea771a8251784e292362df0a370","tests/rustc-issue-13434.rs":"030a2a7d47e53c2153b9b7ef072ba12aa8a6fef0ec511cfcd0c9d09968c41c07","tests/rustc-issue-16530.rs":"4fbe95ca9cffb9dd2b8a60f98ce64996eb8611e2881dcdff4da111563c3eed6d","tests/rustc-issue-19037.rs":"8728e176d24ae0803ef93ef4c81d17a7fd0c7dd84f175a345c6de7ca09c95069","tests/rustc-issue-19102.rs":"7c08c4a3625d585e8f7218b5864912c9d9b02ef81659e601849f22b4bf2fec62","tests/rustc-issue-19135.rs":"537227d0146be2093be0f4641a9860a68bc5e4660ccd30d2e2a10b39794f4c1f","tests/rustc-issue-19358.rs":"38d50e72f619a6a7214094f103ef04cbe4f6fcbf6a11eab7c247a53e60ce3f02","tests/rustc-issue-21402.rs":"842431d5dbcdb72ab20749480f4334a9a63d68357780469fa28755cda4072f80","tests/rustc-issue-23649-3.rs":"dc66e6707881cf01dc8cd499ea5eae989a724885716b94079f869175c3770bf1","tests/rustc-issue-24085.rs":"abd26755ae5d322c6af20fedef1faf8a3fe43c6c79385200413d7a04138b1c6e","tests/rustc-issue-25394.rs":"643e7f990acc72eaba9403d515c4762393cdee50398cdc9231c841682717ea5d","tests/rustc-issue-28561.rs":"3f703d54fbb86d4fa0cadf1b7d3a60d09b50dc95690b81a287c8a35d4e77ff52","tests/rustc-issue-29030.rs":"741fee2ee04ff650445537555299347930ec3479ff9f0a85845271c48696ccf6","tests/rustc-issue-29540.rs":"d7b28cf54f8346215ebf909fab1cab9b60aed93d3089d23d7818e557daae9fdb","tests/rustc-issue-29710.rs":"5b6ba4496f31faa4d419975fe0f059bee923a3fb4053315c5a78d512fa5ba2ea","tests/rustc-issue-32292.rs":"e2825020deff6b73bdc51b452a34520b30344cce33efe40242baa599b7999e77","tests/rustc-issue-3935.rs":"1460907d4f5cda59b48a7c1a449b376a0797d7fd14ea4971484705d34c79a0fe","tests/rustc-issue-42453.rs":"a28b83ea4dbe1ae6ea6e4614cf49235f646ff6b8db6c5fa658ad6a34cada5baa","tests/rustc-issue-58319.rs":"47545e8180b3cbfdc45cf2c7d0d810dc0ebdd154fb0fae087ab078d2f2d87ebe","tests/rustc-issue-6341.rs":"7563bdc3556cfbfd15d61911f2bf45ba9e2334316d9939aacbd150b36ad461e1","tests/rustc-typeclasses-eq-example.rs":"cf067051f8d62125d0244f8918ec5f0ccc7d4a4b6b74a8811c0e723091c23682","tests/rustc-zero-sized-btreemap-insert.rs":"2da53be3a7fe9cb2f66829d2ea798bc4024f1625e52f85d5b3087a3e3bc82fa3"},"package":"fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"} \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.1.3/BUILD.bazel b/third_party/cargo/vendor/derivative-2.2.0/BUILD.bazel similarity index 91% rename from third_party/cargo/vendor/derivative-2.1.3/BUILD.bazel rename to third_party/cargo/vendor/derivative-2.2.0/BUILD.bazel index 058b953..ae743c4 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/BUILD.bazel +++ b/third_party/cargo/vendor/derivative-2.2.0/BUILD.bazel @@ -47,12 +47,12 @@ rust_library( "cargo-raze", "manual", ], - version = "2.1.3", + version = "2.2.0", # buildifier: leave-alone deps = [ - "//third_party/cargo/vendor/proc-macro2-1.0.24:proc_macro2", - "//third_party/cargo/vendor/quote-1.0.8:quote", - "//third_party/cargo/vendor/syn-1.0.58:syn", + "//third_party/cargo/vendor/proc-macro2-1.0.26:proc_macro2", + "//third_party/cargo/vendor/quote-1.0.9:quote", + "//third_party/cargo/vendor/syn-1.0.68:syn", ], ) @@ -70,6 +70,8 @@ rust_library( # Unsupported target "derive-debug-generics" with type "test" omitted +# Unsupported target "derive-debug-packed" with type "test" omitted + # Unsupported target "derive-debug-transparent" with type "test" omitted # Unsupported target "derive-default" with type "test" omitted @@ -78,12 +80,18 @@ rust_library( # Unsupported target "derive-eq" with type "test" omitted +# Unsupported target "derive-eq-packed" with type "test" omitted + # Unsupported target "derive-hash" with type "test" omitted # Unsupported target "derive-ord" with type "test" omitted +# Unsupported target "derive-ord-packed" with type "test" omitted + # Unsupported target "derive-partial-eq" with type "test" omitted +# Unsupported target "derive-partial-eq-packed" with type "test" omitted + # Unsupported target "issue-37-turbofish" with type "test" omitted # Unsupported target "issue-55" with type "test" omitted @@ -94,6 +102,8 @@ rust_library( # Unsupported target "issue-67" with type "test" omitted +# Unsupported target "issue-82" with type "test" omitted + # Unsupported target "rustc-class-implement-traits" with type "test" omitted # Unsupported target "rustc-deriving-bounds" with type "test" omitted diff --git a/third_party/cargo/vendor/derivative-2.1.3/CHANGELOG.md b/third_party/cargo/vendor/derivative-2.2.0/CHANGELOG.md similarity index 88% rename from third_party/cargo/vendor/derivative-2.1.3/CHANGELOG.md rename to third_party/cargo/vendor/derivative-2.2.0/CHANGELOG.md index a94a4d8..95262fa 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/CHANGELOG.md +++ b/third_party/cargo/vendor/derivative-2.2.0/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. + +## 2.2.0 +* Add support for deriving traits on `repr(packed)` types ([#84]). +* Fix bug with `Debug` bounds ([#83]). +* Migrate documentation to `mdbook` and fix issues found in examples ([#83]). + ## 2.1.3 * Fix Clippy warning ([#81]). @@ -66,3 +72,5 @@ This is the last version to support rustc versions 1.15 to 1.33. [#71]: https://github.com/mcarton/rust-derivative/pull/71 [#79]: https://github.com/mcarton/rust-derivative/pull/79 [#81]: https://github.com/mcarton/rust-derivative/pull/81 +[#83]: https://github.com/mcarton/rust-derivative/pull/83 +[#84]: https://github.com/mcarton/rust-derivative/pull/84 \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.1.3/CONTRIBUTING.md b/third_party/cargo/vendor/derivative-2.2.0/CONTRIBUTING.md similarity index 83% rename from third_party/cargo/vendor/derivative-2.1.3/CONTRIBUTING.md rename to third_party/cargo/vendor/derivative-2.2.0/CONTRIBUTING.md index 481718d..c7db610 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/CONTRIBUTING.md +++ b/third_party/cargo/vendor/derivative-2.2.0/CONTRIBUTING.md @@ -6,9 +6,9 @@ There are several ways you can contribute: * File bug reports on the [issue tracker]. Include as much details as you can and, ideally, a self-contained example if you can make one. * Improve the [documentation]. It consists of markdown files in the [doc](doc) - directory. It uses [gitbook] to generate the website. + directory. It uses [mdBook] to generate the website. * Implement something, fix bugs, etc. You know the deal. [documentation]: https://mcarton.github.io/rust-derivative/ -[gitbook]: https://github.com/GitbookIO/gitbook +[mdBook]: https://rust-lang.github.io/mdBook/ [issue tracker]: https://github.com/mcarton/rust-derivative/issues diff --git a/third_party/cargo/vendor/derivative-2.1.3/Cargo.toml b/third_party/cargo/vendor/derivative-2.2.0/Cargo.toml similarity index 98% rename from third_party/cargo/vendor/derivative-2.1.3/Cargo.toml rename to third_party/cargo/vendor/derivative-2.2.0/Cargo.toml index eb89930..95741fb 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/Cargo.toml +++ b/third_party/cargo/vendor/derivative-2.2.0/Cargo.toml @@ -12,7 +12,7 @@ [package] name = "derivative" -version = "2.1.3" +version = "2.2.0" authors = ["mcarton "] description = "A set of alternative `derive` attributes for Rust" documentation = "https://mcarton.github.io/rust-derivative/" diff --git a/third_party/cargo/vendor/derivative-2.1.3/LICENSE-APACHE b/third_party/cargo/vendor/derivative-2.2.0/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/LICENSE-APACHE rename to third_party/cargo/vendor/derivative-2.2.0/LICENSE-APACHE diff --git a/third_party/cargo/vendor/derivative-2.1.3/LICENSE-MIT b/third_party/cargo/vendor/derivative-2.2.0/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/LICENSE-MIT rename to third_party/cargo/vendor/derivative-2.2.0/LICENSE-MIT diff --git a/third_party/cargo/vendor/derivative-2.1.3/README.md b/third_party/cargo/vendor/derivative-2.2.0/README.md similarity index 95% rename from third_party/cargo/vendor/derivative-2.1.3/README.md rename to third_party/cargo/vendor/derivative-2.2.0/README.md index 14b6f61..36e998a 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/README.md +++ b/third_party/cargo/vendor/derivative-2.2.0/README.md @@ -51,5 +51,5 @@ 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. [`serde`]: https://crates.io/crates/serde -[documentation]: https://mcarton.github.io/rust-derivative/ +[documentation]: https://mcarton.github.io/rust-derivative/latest/index.html [rustc]: https://github.com/rust-lang/rust diff --git a/third_party/cargo/vendor/derivative-2.2.0/book.toml b/third_party/cargo/vendor/derivative-2.2.0/book.toml new file mode 100644 index 0000000..e9aaf5a --- /dev/null +++ b/third_party/cargo/vendor/derivative-2.2.0/book.toml @@ -0,0 +1,16 @@ +[book] +title = "Derivative" +src = "doc" + +[rust] +edition = "2018" + +[build] +create-missing = false + +[output.html.search] +limit-results = 15 + +[output.html] +additional-css = ["doc/custom.css"] +git-repository-url = "https://github.com/mcarton/rust-derivative" \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.1.3/doc/Clone.md b/third_party/cargo/vendor/derivative-2.2.0/doc/Clone.md similarity index 97% rename from third_party/cargo/vendor/derivative-2.1.3/doc/Clone.md rename to third_party/cargo/vendor/derivative-2.2.0/doc/Clone.md index 5dcd503..25ea215 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/doc/Clone.md +++ b/third_party/cargo/vendor/derivative-2.2.0/doc/Clone.md @@ -8,7 +8,7 @@ The `Copy` and `Clone` traits support the following attributes: * **Field attributes** * [`(bound="")`](#custom-bound) -#
`clone_from` +# `clone_from` The [`Clone`] trait has a default implementation for [`clone_from`] and `derive(Clone)` never implements that method. *derivative* can implement it if diff --git a/third_party/cargo/vendor/derivative-2.1.3/doc/Debug.md b/third_party/cargo/vendor/derivative-2.2.0/doc/Debug.md similarity index 64% rename from third_party/cargo/vendor/derivative-2.1.3/doc/Debug.md rename to third_party/cargo/vendor/derivative-2.2.0/doc/Debug.md index cae5286..25b66be 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/doc/Debug.md +++ b/third_party/cargo/vendor/derivative-2.2.0/doc/Debug.md @@ -17,6 +17,8 @@ You can use *derivative* to hide fields from a structure or enumeration `Debug` implementation: ```rust +# extern crate derivative; +# use derivative::Derivative; #[derive(Derivative)] #[derivative(Debug)] struct Foo { @@ -34,6 +36,8 @@ You can use *derivative* to automatically unwrap newtypes and enumeration variants with only one field: ```rust +# extern crate derivative; +# use derivative::Derivative; #[derive(Derivative)] #[derivative(Debug="transparent")] struct A(isize); @@ -58,6 +62,15 @@ println!("{:?}", C::Foo(42)); // Foo(42) You can pass a field to a format function: ```rust +# extern crate derivative; +# use derivative::Derivative; +# mod path { +# pub struct SomeTypeThatMightNotBeDebug; +# pub mod to { +# pub fn my_fmt_fn(_: &super::SomeTypeThatMightNotBeDebug, _: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { unimplemented!() } +# } +# } +# use path::SomeTypeThatMightNotBeDebug; #[derive(Derivative)] #[derivative(Debug)] struct Foo { @@ -72,7 +85,7 @@ where `fmt` is the current [`Formatter`]. The function must the following prototype: -```rust +```rust,ignore fn fmt(&T, &mut std::fmt::Formatter) -> Result<(), std::fmt::Error>; ``` @@ -84,8 +97,14 @@ of the current type. If you do not want that, you can specify an explicit bound: * Either on the type. This replaces all bounds: ```rust +# extern crate derivative; +# use derivative::Derivative; +# trait MyDebug { +# fn my_fmt(&self, _: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error>; +# } +# use std::fmt::Debug; #[derive(Derivative)] -#[derivative(Debug(bound="T: Debug, U:MyDebug")] +#[derivative(Debug(bound="T: Debug, U: MyDebug"))] struct Foo { foo: T, #[derivative(Debug(format_with="MyDebug::my_fmt"))] @@ -96,6 +115,11 @@ struct Foo { * Or on a field. This replaces the bound *derivative* guessed for that field. The example below is equivalent to the above: ```rust +# extern crate derivative; +# use derivative::Derivative; +# trait MyDebug { +# fn my_fmt(&self, _: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error>; +# } #[derive(Derivative)] #[derivative(Debug)] struct Foo { @@ -109,3 +133,21 @@ With `bound=""` it is possible to remove any bound for the type. This is useful if your type contains a `Foo` that is `Debug` even if `T` is not. [`Formatter`]: https://doc.rust-lang.org/std/fmt/struct.Formatter.html + +# Packed structures + +You can use *derivative* to implement `Debug` on packed structures. Unlike the standard `derive(debug)`, *derivative* does not require the structure itself to be `Copy`, but like the standard `derive(debug)`, it requires each (non-ignored) field to be `Copy`. + +```rust +# extern crate derivative; +# use derivative::Derivative; +#[derive(Derivative)] +#[derivative(Debug)] +#[repr(C, packed)] +struct Foo { + foo: u8, + // `String` isn't `Copy` so it must be ignored to derive `Debug` + #[derivative(Debug="ignore")] + bar: String, +} +``` \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.1.3/doc/Default.md b/third_party/cargo/vendor/derivative-2.2.0/doc/Default.md similarity index 82% rename from third_party/cargo/vendor/derivative-2.1.3/doc/Default.md rename to third_party/cargo/vendor/derivative-2.2.0/doc/Default.md index 9c00e67..f61bbc9 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/doc/Default.md +++ b/third_party/cargo/vendor/derivative-2.2.0/doc/Default.md @@ -8,7 +8,7 @@ The `Default` trait supports the following attributes: * [`Default`](#default-enumeration) * **Field attributes** * [`Default(bound="")`](#custom-bound) - * [`Default(value="")`](#ignoring-a-field) + * [`Default(value="")`](#setting-the-value-of-a-field) # Default enumeration @@ -17,6 +17,8 @@ This does not work with *rustc*'s `#[derive(Default)]`. All you need is to specify what variant is the default value: ```rust +# extern crate derivative; +# use derivative::Derivative; #[derive(Debug, Derivative)] #[derivative(Default)] enum Enum { @@ -34,6 +36,8 @@ You can use *derivative* to change the default value of a field in a `Default` implementation: ```rust +# extern crate derivative; +# use derivative::Derivative; #[derive(Debug, Derivative)] #[derivative(Default)] struct Foo { @@ -51,6 +55,8 @@ You can use *derivative* to derive a convenience `new` method for your type that calls `Default::default`: ```rust +# extern crate derivative; +# use derivative::Derivative; #[derive(Debug, Derivative)] #[derivative(Default(new="true"))] struct Foo { @@ -66,7 +72,9 @@ println!("{:?}", Foo::new()); // Foo { foo: 0, bar: 0 } The following does not work because `derive` adds a `T: Default` bound on the `impl Default for Foo`: -```rust +```rust,compile_fail +# extern crate derivative; +# use derivative::Derivative; #[derive(Default)] struct Foo { foo: Option, @@ -74,7 +82,7 @@ struct Foo { struct NonDefault; -Foo::::default() // gives: +Foo::::default(); // gives: // error: no associated item named `default` found for type `Foo` in the current scope // = note: the method `default` exists but the following trait bounds were not satisfied: `NonDefault : std::default::Default` ``` @@ -84,6 +92,8 @@ That bound however is useless as `Option: Default` for any `T`. correct: ```rust +# extern crate derivative; +# use derivative::Derivative; #[derive(Derivative)] #[derivative(Default(bound=""))] // don't need any bound struct Foo { @@ -92,5 +102,5 @@ struct Foo { struct NonDefault; -Foo::::default() // works! +Foo::::default(); // works! ``` diff --git a/third_party/cargo/vendor/derivative-2.1.3/doc/Hash.md b/third_party/cargo/vendor/derivative-2.2.0/doc/Hash.md similarity index 69% rename from third_party/cargo/vendor/derivative-2.1.3/doc/Hash.md rename to third_party/cargo/vendor/derivative-2.2.0/doc/Hash.md index 0fbc0e4..71c6f08 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/doc/Hash.md +++ b/third_party/cargo/vendor/derivative-2.2.0/doc/Hash.md @@ -13,6 +13,8 @@ The `Hash` trait supports the following attributes: You can use *derivative* to ignore fields from a `Hash` implementation: ```rust +# extern crate derivative; +# use derivative::Derivative; #[derive(Derivative)] #[derivative(Hash)] struct Foo { @@ -26,7 +28,14 @@ struct Bar { foo: u8, } -assert_eq!(hash(Foo { foo: 42, bar: -1337 }), hash(Bar { foo: 42 })); +# fn hash(t: &T) -> u64 { +# use std::hash::Hasher; +# let mut s = std::collections::hash_map::DefaultHasher::new(); +# t.hash(&mut s); +# s.finish() +# } +# +assert_eq!(hash(&Foo { foo: 42, bar: -1337 }), hash(&Bar { foo: 42 })); ``` # Hash with @@ -34,6 +43,15 @@ assert_eq!(hash(Foo { foo: 42, bar: -1337 }), hash(Bar { foo: 42 })); You can pass a field to a hash function: ```rust +# extern crate derivative; +# use derivative::Derivative; +# mod path { +# pub struct SomeTypeThatMightNotBeHash; +# pub mod to { +# pub fn my_hash_fn(_: &super::SomeTypeThatMightNotBeHash, state: &mut H) where H: std::hash::Hasher { unimplemented!() } +# } +# } +# use path::SomeTypeThatMightNotBeHash; #[derive(Derivative)] #[derivative(Hash)] struct Foo { @@ -48,7 +66,7 @@ where `state` is the current [`Hasher`]. The function must the following prototype: -```rust +```rust,ignore fn my_hash_fn(&T, state: &mut H) where H: Hasher; ``` diff --git a/third_party/cargo/vendor/derivative-2.1.3/doc/README.md b/third_party/cargo/vendor/derivative-2.2.0/doc/README.md similarity index 51% rename from third_party/cargo/vendor/derivative-2.1.3/doc/README.md rename to third_party/cargo/vendor/derivative-2.2.0/doc/README.md index 16d266b..62d73bc 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/doc/README.md +++ b/third_party/cargo/vendor/derivative-2.2.0/doc/README.md @@ -10,30 +10,113 @@ just `derive`. You can derive `Default` on enumerations: -| With *derivative* | [Original][default-enum-source] | -|-------------------|---------------------------------| -| {% codesnippet "default-enum.rs" %}{% endcodesnippet %} | {% codesnippet "default-enum-orig.rs" %}{% endcodesnippet %} | + + + + + + + + + + + +
+With *derivative* + + +[Original][default-value-source] +
+ +{{#playground default-enum.rs}} + + +{{#playground default-enum-orig.rs}} +
You can use different default values for some fields: -| With *derivative* | [Original][default-value-source] | -|-------------------|---------------------------------| -| {% codesnippet "default-value.rs" %}{% endcodesnippet %} | {% codesnippet "default-value-orig.rs" %}{% endcodesnippet %} | + + + + + + + + + + + +
+ +With *derivative* + + +[Original][default-value-source] +
+ +{{#playground default-value.rs}} + + +{{#playground default-value-orig.rs}} +
Want a transparent `Debug` implementation for your wrapper? We got that: -| With *derivative* | [Original][transparent-source] | -|-------------------|---------------------------------| -| {% codesnippet "debug-transparent.rs" %}{% endcodesnippet %} | {% codesnippet "debug-transparent-orig.rs" %}{% endcodesnippet %} | + + + + + + + + + + + +
+ +With *derivative* + + +[Original][transparent-source] +
+ +{{#playground debug-transparent.rs}} + + +{{#playground debug-transparent-orig.rs}} +
Need to ignore a field? We got that too: -| With *derivative* | [Original][eq-ignore-source] | -|-------------------|---------------------------------| -| {% codesnippet "eq-ignore.rs" %}{% endcodesnippet %} | {% codesnippet "eq-ignore-orig.rs" %}{% endcodesnippet %} | + + + + + + + + + + + +
+ +With *derivative* + + +[Original][eq-ignore-source] +
+ +{{#playground eq-ignore.rs}} + + +{{#playground eq-ignore-orig.rs}} +
[default-value-source]: https://github.com/rust-lang-nursery/regex/blob/3cfef1e79d135a3e8a670aff53e7fabef453a3e1/src/re_builder.rs#L12-L39 diff --git a/third_party/cargo/vendor/derivative-2.2.0/doc/SUMMARY.md b/third_party/cargo/vendor/derivative-2.2.0/doc/SUMMARY.md new file mode 100644 index 0000000..6676293 --- /dev/null +++ b/third_party/cargo/vendor/derivative-2.2.0/doc/SUMMARY.md @@ -0,0 +1,25 @@ +# Summary + +* [Overview](README.md) +* [`Copy` and `Clone` traits](Clone.md) + + +* [`Debug` trait](Debug.md) + + + + +* [`Default` trait](Default.md) + + + + +* [`Hash` trait](Hash.md) + + + +* [Comparison traits](cmp.md) + + + + diff --git a/third_party/cargo/vendor/derivative-2.1.3/doc/cmp.md b/third_party/cargo/vendor/derivative-2.2.0/doc/cmp.md similarity index 66% rename from third_party/cargo/vendor/derivative-2.1.3/doc/cmp.md rename to third_party/cargo/vendor/derivative-2.2.0/doc/cmp.md index 807499e..b6ff490 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/doc/cmp.md +++ b/third_party/cargo/vendor/derivative-2.2.0/doc/cmp.md @@ -23,7 +23,7 @@ enumerations as efficiently as the built-in `derive(…)` yet. If you want to use derivative on enumerations anyway, you can add -```rust +```rust,ignore #[derivative(PartialOrd="feature_allow_slow_enum")] ``` @@ -37,6 +37,8 @@ necessary anymore as of v2.1.0. It was never necessary nor allowed for `Eq`. You can use *derivative* to ignore a field when comparing: ```rust +# extern crate derivative; +# use derivative::Derivative; #[derive(Derivative)] #[derivative(PartialEq)] struct Foo { @@ -55,6 +57,15 @@ Usually fields are compared using `==`, `PartialOrd::partial_cmp` or `Ord::cmp`. function if you like: ```rust +# extern crate derivative; +# use derivative::Derivative; +# mod path { +# pub struct SomeTypeThatMightNotBePartialEq; +# pub mod to { +# pub fn my_cmp_fn(_: &super::SomeTypeThatMightNotBePartialEq, _: &super::SomeTypeThatMightNotBePartialEq) -> bool { false } +# } +# } +# use path::SomeTypeThatMightNotBePartialEq; #[derive(Derivative)] #[derivative(PartialEq)] struct Foo { @@ -69,9 +80,9 @@ struct Foo { | Trait | Signature | |--------------|-----------| -| `PartialEq` | `fn my_cmp_fn(&T, &T) -> bool;` -| `PartialOrd` | `fn my_cmp_fn(&T, &T) -> std::option::Option;` -| `Ord` | `fn my_cmp_fn(&T, &T) -> std::cmp::Ordering;` +| `PartialEq` | `fn my_cmp_fn(&T, &T) -> bool;` +| `PartialOrd` | `fn my_cmp_fn(&T, &T) -> std::option::Option;` +| `Ord` | `fn my_cmp_fn(&T, &T) -> std::cmp::Ordering;` # Custom bound @@ -82,12 +93,31 @@ Eg. comparing raw pointers does not require the type to be `Eq`, so you could use: ```rust +# extern crate derivative; +# use derivative::Derivative; #[derive(Derivative)] -#[derivative(Eq)] +#[derivative(PartialEq)] struct WithPtr { - #[derivative(Eq(bound=""))] + #[derivative(PartialEq(bound=""))] foo: *const T } ``` See [`Default`'s documentation](./Default.md#custom-bound) for more details. + +# Packed structures + +You can use *derivative* to implement the comparison traits on packed structures. Unlike the standard `derive`, *derivative* does not require the structure itself to be `Copy`, but like the standard `derive`, it requires each (non-ignored) field to be `Copy`. + +```rust +# extern crate derivative; +# use derivative::Derivative; +#[derive(Derivative)] +#[derivative(PartialEq)] +#[repr(C, packed)] +struct Foo { + f: u32, + #[derivative(PartialEq = "ignore")] + t: String, +} +``` \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.2.0/doc/custom.css b/third_party/cargo/vendor/derivative-2.2.0/doc/custom.css new file mode 100644 index 0000000..3ccc008 --- /dev/null +++ b/third_party/cargo/vendor/derivative-2.2.0/doc/custom.css @@ -0,0 +1,24 @@ +#content > main > table { + position: relative; + left: 50%; + transform: translateX(-50%); + + margin-left: 0px; + margin-right: 0px; +} + +#content > main > table td { + vertical-align: top; +} + +#content > main > table .hljs { + background: none; +} + +.readme-example { + background: #f1f1f1; +} + +table .readme-example > td { + border: 1px hsl(0, 0%, 0%) solid; +} \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.1.3/doc/debug-transparent-orig.rs b/third_party/cargo/vendor/derivative-2.2.0/doc/debug-transparent-orig.rs similarity index 90% rename from third_party/cargo/vendor/derivative-2.1.3/doc/debug-transparent-orig.rs rename to third_party/cargo/vendor/derivative-2.2.0/doc/debug-transparent-orig.rs index df41c89..387ab7f 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/doc/debug-transparent-orig.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/doc/debug-transparent-orig.rs @@ -1,7 +1,8 @@ +# use std::fmt; pub struct Wrapping(pub T); impl fmt::Debug for Wrapping { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.0.fmt(f) } -} +} \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.2.0/doc/debug-transparent.rs b/third_party/cargo/vendor/derivative-2.2.0/doc/debug-transparent.rs new file mode 100644 index 0000000..2270495 --- /dev/null +++ b/third_party/cargo/vendor/derivative-2.2.0/doc/debug-transparent.rs @@ -0,0 +1,5 @@ +# extern crate derivative; +# use derivative::Derivative; +#[derive(Derivative)] +#[derivative(Debug="transparent")] +pub struct Wrapping(pub T); \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.1.3/doc/default-enum-orig.rs b/third_party/cargo/vendor/derivative-2.2.0/doc/default-enum-orig.rs similarity index 67% rename from third_party/cargo/vendor/derivative-2.1.3/doc/default-enum-orig.rs rename to third_party/cargo/vendor/derivative-2.2.0/doc/default-enum-orig.rs index 7d5b126..4f459d7 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/doc/default-enum-orig.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/doc/default-enum-orig.rs @@ -1,3 +1,8 @@ +# #![no_implicit_prelude] +# extern crate core; +# use core::default::Default; +# use Option::None; +# pub enum Option { /// No value None, diff --git a/third_party/cargo/vendor/derivative-2.1.3/doc/default-enum.rs b/third_party/cargo/vendor/derivative-2.2.0/doc/default-enum.rs similarity index 74% rename from third_party/cargo/vendor/derivative-2.1.3/doc/default-enum.rs rename to third_party/cargo/vendor/derivative-2.2.0/doc/default-enum.rs index 51f10f5..79ec81e 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/doc/default-enum.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/doc/default-enum.rs @@ -1,3 +1,5 @@ +# extern crate derivative; +# use derivative::Derivative; #[derive(Derivative)] #[derivative(Default(bound=""))] pub enum Option { @@ -6,4 +8,4 @@ pub enum Option { None, /// Some value `T` Some(T), -} +} \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.1.3/doc/default-value-orig.rs b/third_party/cargo/vendor/derivative-2.2.0/doc/default-value-orig.rs similarity index 82% rename from third_party/cargo/vendor/derivative-2.1.3/doc/default-value-orig.rs rename to third_party/cargo/vendor/derivative-2.2.0/doc/default-value-orig.rs index 8d8c810..6e016cc 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/doc/default-value-orig.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/doc/default-value-orig.rs @@ -1,5 +1,5 @@ pub struct RegexOptions { - pub pats: Vec<String>, + pub pats: Vec, pub size_limit: usize, pub dfa_size_limit: usize, pub case_insensitive: bool, @@ -14,8 +14,8 @@ impl Default for RegexOptions { fn default() -> Self { RegexOptions { pats: vec![], - size_limit: 10 * (1<<20), - dfa_size_limit: 2 * (1<<20), + size_limit: 10 * (1 << 20), + dfa_size_limit: 2 * (1 << 20), case_insensitive: false, multi_line: false, dot_matches_new_line: false, @@ -24,4 +24,4 @@ impl Default for RegexOptions { unicode: true, } } -} +} \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.1.3/doc/default-value.rs b/third_party/cargo/vendor/derivative-2.2.0/doc/default-value.rs similarity index 65% rename from third_party/cargo/vendor/derivative-2.1.3/doc/default-value.rs rename to third_party/cargo/vendor/derivative-2.2.0/doc/default-value.rs index d4fdcb1..deced98 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/doc/default-value.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/doc/default-value.rs @@ -1,10 +1,12 @@ +# extern crate derivative; +# use derivative::Derivative; #[derive(Derivative)] #[derivative(Default)] pub struct RegexOptions { - pub pats: Vec<String>, - #[derivative(Default(value="10 * (1<<20)"))] + pub pats: Vec, + #[derivative(Default(value="10 * (1 << 20)"))] pub size_limit: usize, - #[derivative(Default(value="2 * (1<<20)"))] + #[derivative(Default(value="2 * (1 << 20)"))] pub dfa_size_limit: usize, pub case_insensitive: bool, pub multi_line: bool, @@ -13,4 +15,4 @@ pub struct RegexOptions { pub ignore_whitespace: bool, #[derivative(Default(value="true"))] pub unicode: bool, -} +} \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.1.3/doc/eq-ignore-orig.rs b/third_party/cargo/vendor/derivative-2.2.0/doc/eq-ignore-orig.rs similarity index 93% rename from third_party/cargo/vendor/derivative-2.1.3/doc/eq-ignore-orig.rs rename to third_party/cargo/vendor/derivative-2.2.0/doc/eq-ignore-orig.rs index c54a6b4..235a749 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/doc/eq-ignore-orig.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/doc/eq-ignore-orig.rs @@ -1,3 +1,6 @@ +# use std::{cmp, hash}; +# #[derive(PartialEq, Hash)] +# struct Identifier; pub struct Version { /// The major version. pub major: u64, @@ -34,4 +37,4 @@ impl hash::Hash for Version { self.patch.hash(into); self.pre.hash(into); } -} +} \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.1.3/doc/eq-ignore.rs b/third_party/cargo/vendor/derivative-2.2.0/doc/eq-ignore.rs similarity index 86% rename from third_party/cargo/vendor/derivative-2.1.3/doc/eq-ignore.rs rename to third_party/cargo/vendor/derivative-2.2.0/doc/eq-ignore.rs index 61eb24d..a83af2c 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/doc/eq-ignore.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/doc/eq-ignore.rs @@ -1,3 +1,7 @@ +# extern crate derivative; +# use derivative::Derivative; +# #[derive(PartialEq, Hash)] +# struct Identifier; #[derive(Derivative)] #[derivative(PartialEq, Hash)] pub struct Version { @@ -19,4 +23,4 @@ pub struct Version { /// The build metadata, ignored when /// determining version precedence. pub build: Vec, -} +} \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.1.3/doc/styles/website.css b/third_party/cargo/vendor/derivative-2.2.0/doc/styles/website.css similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/doc/styles/website.css rename to third_party/cargo/vendor/derivative-2.2.0/doc/styles/website.css diff --git a/third_party/cargo/vendor/derivative-2.1.3/src/ast.rs b/third_party/cargo/vendor/derivative-2.2.0/src/ast.rs similarity index 94% rename from third_party/cargo/vendor/derivative-2.1.3/src/ast.rs rename to third_party/cargo/vendor/derivative-2.2.0/src/ast.rs index 2c31ab6..cf06995 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/src/ast.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/src/ast.rs @@ -59,7 +59,7 @@ impl<'a> Input<'a> { syn::Data::Union(..) => { errors.extend( syn::Error::new_spanned(item, "derivative does not support unions") - .to_compile_error() + .to_compile_error(), ); return Err(()); } @@ -93,6 +93,13 @@ impl<'a> Body<'a> { Body::Struct(_, ref fields) => fields.iter().collect(), } } + + pub fn is_empty(&self) -> bool { + match *self { + Body::Enum(ref variants) => variants.is_empty(), + Body::Struct(_, ref fields) => fields.is_empty(), + } + } } impl<'a> Variant<'a> { diff --git a/third_party/cargo/vendor/derivative-2.1.3/src/attr.rs b/third_party/cargo/vendor/derivative-2.2.0/src/attr.rs similarity index 97% rename from third_party/cargo/vendor/derivative-2.1.3/src/attr.rs rename to third_party/cargo/vendor/derivative-2.2.0/src/attr.rs index 6165354..01ac740 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/src/attr.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/src/attr.rs @@ -23,6 +23,7 @@ pub struct Input { pub partial_ord: Option, /// Whether `Ord` is present and its specific attributes. pub ord: Option, + pub is_packed: bool, } #[derive(Debug, Default)] @@ -263,7 +264,10 @@ impl Input { attrs: &[syn::Attribute], errors: &mut proc_macro2::TokenStream, ) -> Result { - let mut input = Input::default(); + let mut input = Input { + is_packed: attrs.iter().any(has_repr_packed_attr), + ..Default::default() + }; for_all_attr! { errors; @@ -863,3 +867,21 @@ fn ensure_str_lit<'a>( Err(()) } } + +pub fn has_repr_packed_attr(attr: &syn::Attribute) -> bool { + if let Ok(attr) = attr.parse_meta() { + if attr.path().get_ident().map(|i| i == "repr") == Some(true) { + if let syn::Meta::List(items) = attr { + for item in items.nested { + if let syn::NestedMeta::Meta(item) = item { + if item.path().get_ident().map(|i| i == "packed") == Some(true) { + return true; + } + } + } + } + } + } + + false +} diff --git a/third_party/cargo/vendor/derivative-2.1.3/src/bound.rs b/third_party/cargo/vendor/derivative-2.2.0/src/bound.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/src/bound.rs rename to third_party/cargo/vendor/derivative-2.2.0/src/bound.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/src/clone.rs b/third_party/cargo/vendor/derivative-2.2.0/src/clone.rs similarity index 95% rename from third_party/cargo/vendor/derivative-2.1.3/src/clone.rs rename to third_party/cargo/vendor/derivative-2.2.0/src/clone.rs index d6ea31a..3594e94 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/src/clone.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/src/clone.rs @@ -51,15 +51,15 @@ pub fn derive_clone(input: &ast::Input) -> proc_macro2::TokenStream { } } } else { - let body = matcher::Matcher::new(matcher::BindingStyle::Ref).build_arms( + let body = matcher::Matcher::new(matcher::BindingStyle::Ref, input.attrs.is_packed).build_arms( input, "__arg", |arm_path, _, _, style, _, bis| { let field_clones = bis.iter().map(|bi| { - let arg = &bi.ident; + let arg = &bi.expr; let clone = if let Some(clone_with) = bi.field.attrs.clone_with() { - quote!(#clone_with(#arg)) + quote!(#clone_with(&#arg)) } else { quote!(#arg.clone()) }; @@ -97,21 +97,21 @@ pub fn derive_clone(input: &ast::Input) -> proc_macro2::TokenStream { let clone_from = if input.attrs.clone_from() { Some( - matcher::Matcher::new(matcher::BindingStyle::RefMut).build_arms( + matcher::Matcher::new(matcher::BindingStyle::RefMut, input.attrs.is_packed).build_arms( input, "__arg", |outer_arm_path, _, _, _, _, outer_bis| { - let body = matcher::Matcher::new(matcher::BindingStyle::Ref).build_arms( + let body = matcher::Matcher::new(matcher::BindingStyle::Ref, input.attrs.is_packed).build_arms( input, "__other", |inner_arm_path, _, _, _, _, inner_bis| { if outer_arm_path == inner_arm_path { let field_clones = outer_bis.iter().zip(inner_bis).map( |(outer_bi, inner_bi)| { - let outer = &outer_bi.ident; - let inner = &inner_bi.ident; + let outer = &outer_bi.expr; + let inner = &inner_bi.expr; - quote!(#outer.clone_from(#inner);) + quote!(#outer.clone_from(&#inner);) }, ); diff --git a/third_party/cargo/vendor/derivative-2.2.0/src/cmp.rs b/third_party/cargo/vendor/derivative-2.2.0/src/cmp.rs new file mode 100644 index 0000000..573c5fa --- /dev/null +++ b/third_party/cargo/vendor/derivative-2.2.0/src/cmp.rs @@ -0,0 +1,407 @@ +// https://github.com/rust-lang/rust/issues/13101 + +use ast; +use attr; +use matcher; +use paths; +use proc_macro2; +use syn; +use utils; + +/// Derive `Eq` for `input`. +pub fn derive_eq(input: &ast::Input) -> proc_macro2::TokenStream { + let name = &input.ident; + + let eq_trait_path = eq_trait_path(); + let generics = utils::build_impl_generics( + input, + &eq_trait_path, + needs_eq_bound, + |field| field.eq_bound(), + |input| input.eq_bound(), + ); + let new_where_clause; + let (impl_generics, ty_generics, mut where_clause) = generics.split_for_impl(); + + if let Some(new_where_clause2) = + maybe_add_copy(input, where_clause, |f| !f.attrs.ignore_partial_eq()) + { + new_where_clause = new_where_clause2; + where_clause = Some(&new_where_clause); + } + + quote! { + #[allow(unused_qualifications)] + impl #impl_generics #eq_trait_path for #name #ty_generics #where_clause {} + } +} + +/// Derive `PartialEq` for `input`. +pub fn derive_partial_eq(input: &ast::Input) -> proc_macro2::TokenStream { + let discriminant_cmp = if let ast::Body::Enum(_) = input.body { + let discriminant_path = paths::discriminant_path(); + + quote!((#discriminant_path(&*self) == #discriminant_path(&*other))) + } else { + quote!(true) + }; + + let name = &input.ident; + + let partial_eq_trait_path = partial_eq_trait_path(); + let generics = utils::build_impl_generics( + input, + &partial_eq_trait_path, + needs_partial_eq_bound, + |field| field.partial_eq_bound(), + |input| input.partial_eq_bound(), + ); + let new_where_clause; + let (impl_generics, ty_generics, mut where_clause) = generics.split_for_impl(); + + let match_fields = if input.is_trivial_enum() { + quote!(true) + } else { + matcher::Matcher::new(matcher::BindingStyle::Ref, input.attrs.is_packed) + .with_field_filter(|f: &ast::Field| !f.attrs.ignore_partial_eq()) + .build_2_arms( + (quote!(*self), quote!(*other)), + (input, "__self"), + (input, "__other"), + |_, _, _, (left_variant, right_variant)| { + let cmp = left_variant.iter().zip(&right_variant).map(|(o, i)| { + let outer_name = &o.expr; + let inner_name = &i.expr; + + if o.field.attrs.ignore_partial_eq() { + None + } else if let Some(compare_fn) = o.field.attrs.partial_eq_compare_with() { + Some(quote!(&& #compare_fn(&#outer_name, &#inner_name))) + } else { + Some(quote!(&& &#outer_name == &#inner_name)) + } + }); + + quote!(true #(#cmp)*) + }, + ) + }; + + if let Some(new_where_clause2) = + maybe_add_copy(input, where_clause, |f| !f.attrs.ignore_partial_eq()) + { + new_where_clause = new_where_clause2; + where_clause = Some(&new_where_clause); + } + + quote! { + #[allow(unused_qualifications)] + #[allow(clippy::unneeded_field_pattern)] + impl #impl_generics #partial_eq_trait_path for #name #ty_generics #where_clause { + fn eq(&self, other: &Self) -> bool { + #discriminant_cmp && #match_fields + } + } + } +} + +/// Derive `PartialOrd` for `input`. +pub fn derive_partial_ord( + input: &ast::Input, + errors: &mut proc_macro2::TokenStream, +) -> proc_macro2::TokenStream { + if let ast::Body::Enum(_) = input.body { + if !input.attrs.partial_ord_on_enum() { + let message = "can't use `#[derivative(PartialOrd)]` on an enumeration without \ + `feature_allow_slow_enum`; see the documentation for more details"; + errors.extend(syn::Error::new(input.span, message).to_compile_error()); + } + } + + let option_path = option_path(); + let ordering_path = ordering_path(); + + let body = matcher::Matcher::new(matcher::BindingStyle::Ref, input.attrs.is_packed) + .with_field_filter(|f: &ast::Field| !f.attrs.ignore_partial_ord()) + .build_arms(input, "__self", |_, n, _, _, _, outer_bis| { + let body = matcher::Matcher::new(matcher::BindingStyle::Ref, input.attrs.is_packed) + .with_field_filter(|f: &ast::Field| !f.attrs.ignore_partial_ord()) + .build_arms(input, "__other", |_, m, _, _, _, inner_bis| { + match n.cmp(&m) { + ::std::cmp::Ordering::Less => { + quote!(#option_path::Some(#ordering_path::Less)) + } + ::std::cmp::Ordering::Greater => { + quote!(#option_path::Some(#ordering_path::Greater)) + } + ::std::cmp::Ordering::Equal => { + let equal_path = quote!(#ordering_path::Equal); + outer_bis + .iter() + .rev() + .zip(inner_bis.into_iter().rev()) + .fold(quote!(#option_path::Some(#equal_path)), |acc, (o, i)| { + let outer_name = &o.expr; + let inner_name = &i.expr; + + if o.field.attrs.ignore_partial_ord() { + acc + } else { + let cmp_fn = o + .field + .attrs + .partial_ord_compare_with() + .map(|f| quote!(#f)) + .unwrap_or_else(|| { + let path = partial_ord_trait_path(); + quote!(#path::partial_cmp) + }); + + quote!(match #cmp_fn(&#outer_name, &#inner_name) { + #option_path::Some(#equal_path) => #acc, + __derive_ordering_other => __derive_ordering_other, + }) + } + }) + } + } + }); + + quote! { + match *other { + #body + } + + } + }); + + let name = &input.ident; + + let partial_ord_trait_path = partial_ord_trait_path(); + let generics = utils::build_impl_generics( + input, + &partial_ord_trait_path, + needs_partial_ord_bound, + |field| field.partial_ord_bound(), + |input| input.partial_ord_bound(), + ); + let new_where_clause; + let (impl_generics, ty_generics, mut where_clause) = generics.split_for_impl(); + + if let Some(new_where_clause2) = + maybe_add_copy(input, where_clause, |f| !f.attrs.ignore_partial_ord()) + { + new_where_clause = new_where_clause2; + where_clause = Some(&new_where_clause); + } + + quote! { + #[allow(unused_qualifications)] + #[allow(clippy::unneeded_field_pattern)] + impl #impl_generics #partial_ord_trait_path for #name #ty_generics #where_clause { + fn partial_cmp(&self, other: &Self) -> #option_path<#ordering_path> { + match *self { + #body + } + } + } + } +} + +/// Derive `Ord` for `input`. +pub fn derive_ord( + input: &ast::Input, + errors: &mut proc_macro2::TokenStream, +) -> proc_macro2::TokenStream { + if let ast::Body::Enum(_) = input.body { + if !input.attrs.ord_on_enum() { + let message = "can't use `#[derivative(Ord)]` on an enumeration without \ + `feature_allow_slow_enum`; see the documentation for more details"; + errors.extend(syn::Error::new(input.span, message).to_compile_error()); + } + } + + let ordering_path = ordering_path(); + + let body = matcher::Matcher::new(matcher::BindingStyle::Ref, input.attrs.is_packed) + .with_field_filter(|f: &ast::Field| !f.attrs.ignore_ord()) + .build_arms(input, "__self", |_, n, _, _, _, outer_bis| { + let body = matcher::Matcher::new(matcher::BindingStyle::Ref, input.attrs.is_packed) + .with_field_filter(|f: &ast::Field| !f.attrs.ignore_ord()) + .build_arms(input, "__other", |_, m, _, _, _, inner_bis| { + match n.cmp(&m) { + ::std::cmp::Ordering::Less => quote!(#ordering_path::Less), + ::std::cmp::Ordering::Greater => quote!(#ordering_path::Greater), + ::std::cmp::Ordering::Equal => { + let equal_path = quote!(#ordering_path::Equal); + outer_bis + .iter() + .rev() + .zip(inner_bis.into_iter().rev()) + .fold(quote!(#equal_path), |acc, (o, i)| { + let outer_name = &o.expr; + let inner_name = &i.expr; + + if o.field.attrs.ignore_ord() { + acc + } else { + let cmp_fn = o + .field + .attrs + .ord_compare_with() + .map(|f| quote!(#f)) + .unwrap_or_else(|| { + let path = ord_trait_path(); + quote!(#path::cmp) + }); + + quote!(match #cmp_fn(&#outer_name, &#inner_name) { + #equal_path => #acc, + __derive_ordering_other => __derive_ordering_other, + }) + } + }) + } + } + }); + + quote! { + match *other { + #body + } + + } + }); + + let name = &input.ident; + + let ord_trait_path = ord_trait_path(); + let generics = utils::build_impl_generics( + input, + &ord_trait_path, + needs_ord_bound, + |field| field.ord_bound(), + |input| input.ord_bound(), + ); + let new_where_clause; + let (impl_generics, ty_generics, mut where_clause) = generics.split_for_impl(); + + if let Some(new_where_clause2) = maybe_add_copy(input, where_clause, |f| !f.attrs.ignore_ord()) + { + new_where_clause = new_where_clause2; + where_clause = Some(&new_where_clause); + } + + quote! { + #[allow(unused_qualifications)] + #[allow(clippy::unneeded_field_pattern)] + impl #impl_generics #ord_trait_path for #name #ty_generics #where_clause { + fn cmp(&self, other: &Self) -> #ordering_path { + match *self { + #body + } + } + } + } +} + +fn needs_partial_eq_bound(attrs: &attr::Field) -> bool { + !attrs.ignore_partial_eq() && attrs.partial_eq_bound().is_none() +} + +fn needs_partial_ord_bound(attrs: &attr::Field) -> bool { + !attrs.ignore_partial_ord() && attrs.partial_ord_bound().is_none() +} + +fn needs_ord_bound(attrs: &attr::Field) -> bool { + !attrs.ignore_ord() && attrs.ord_bound().is_none() +} + +fn needs_eq_bound(attrs: &attr::Field) -> bool { + !attrs.ignore_partial_eq() && attrs.eq_bound().is_none() +} + +/// Return the path of the `Eq` trait, that is `::std::cmp::Eq`. +fn eq_trait_path() -> syn::Path { + if cfg!(feature = "use_core") { + parse_quote!(::core::cmp::Eq) + } else { + parse_quote!(::std::cmp::Eq) + } +} + +/// Return the path of the `PartialEq` trait, that is `::std::cmp::PartialEq`. +fn partial_eq_trait_path() -> syn::Path { + if cfg!(feature = "use_core") { + parse_quote!(::core::cmp::PartialEq) + } else { + parse_quote!(::std::cmp::PartialEq) + } +} + +/// Return the path of the `PartialOrd` trait, that is `::std::cmp::PartialOrd`. +fn partial_ord_trait_path() -> syn::Path { + if cfg!(feature = "use_core") { + parse_quote!(::core::cmp::PartialOrd) + } else { + parse_quote!(::std::cmp::PartialOrd) + } +} + +/// Return the path of the `Ord` trait, that is `::std::cmp::Ord`. +fn ord_trait_path() -> syn::Path { + if cfg!(feature = "use_core") { + parse_quote!(::core::cmp::Ord) + } else { + parse_quote!(::std::cmp::Ord) + } +} + +/// Return the path of the `Option` trait, that is `::std::option::Option`. +fn option_path() -> syn::Path { + if cfg!(feature = "use_core") { + parse_quote!(::core::option::Option) + } else { + parse_quote!(::std::option::Option) + } +} + +/// Return the path of the `Ordering` trait, that is `::std::cmp::Ordering`. +fn ordering_path() -> syn::Path { + if cfg!(feature = "use_core") { + parse_quote!(::core::cmp::Ordering) + } else { + parse_quote!(::std::cmp::Ordering) + } +} + +fn maybe_add_copy( + input: &ast::Input, + where_clause: Option<&syn::WhereClause>, + field_filter: impl Fn(&ast::Field) -> bool, +) -> Option { + if input.attrs.is_packed && !input.body.is_empty() { + let mut new_where_clause = where_clause.cloned().unwrap_or_else(|| syn::WhereClause { + where_token: parse_quote!(where), + predicates: Default::default(), + }); + + new_where_clause.predicates.extend( + input + .body + .all_fields() + .into_iter() + .filter(|f| field_filter(f)) + .map(|f| { + let ty = f.ty; + + let pred: syn::WherePredicate = parse_quote!(#ty: Copy); + pred + }), + ); + + Some(new_where_clause) + } else { + None + } +} diff --git a/third_party/cargo/vendor/derivative-2.1.3/src/debug.rs b/third_party/cargo/vendor/derivative-2.2.0/src/debug.rs similarity index 77% rename from third_party/cargo/vendor/derivative-2.1.3/src/debug.rs rename to third_party/cargo/vendor/derivative-2.2.0/src/debug.rs index 6db31c6..ed667c1 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/src/debug.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/src/debug.rs @@ -13,10 +13,9 @@ pub fn derive(input: &ast::Input) -> proc_macro2::TokenStream { let formatter = quote_spanned! {input.span=> __f}; - let body = matcher::Matcher::new(matcher::BindingStyle::Ref).build_arms( - input, - "__arg", - |_, _, arm_name, style, attrs, bis| { + let body = matcher::Matcher::new(matcher::BindingStyle::Ref, input.attrs.is_packed) + .with_field_filter(|f: &ast::Field| !f.attrs.ignore_debug()) + .build_arms(input, "__arg", |_, _, arm_name, style, attrs, bis| { let field_prints = bis.iter().filter_map(|bi| { if bi.field.attrs.ignore_debug() { return None; @@ -28,22 +27,39 @@ pub fn derive(input: &ast::Input) -> proc_macro2::TokenStream { }); } - let arg = &bi.ident; + let arg_expr = &bi.expr; + let arg_ident = &bi.ident; let dummy_debug = bi.field.attrs.debug_format_with().map(|format_fn| { - format_with(bi.field, &arg, format_fn, input.generics.clone()) + format_with( + bi.field, + &input.attrs.debug_bound(), + &arg_expr, + &arg_ident, + format_fn, + input.generics.clone(), + ) }); + let expr = if bi.field.attrs.debug_format_with().is_some() { + quote_spanned! {arm_name.span()=> + &#arg_ident + } + } else { + quote_spanned! {arm_name.span()=> + &&#arg_expr + } + }; let builder = if let Some(ref name) = bi.field.ident { let name = name.to_string(); quote_spanned! {arm_name.span()=> #dummy_debug - let _ = __debug_trait_builder.field(#name, &#arg); + let _ = __debug_trait_builder.field(#name, #expr); } } else { quote_spanned! {arm_name.span()=> #dummy_debug - let _ = __debug_trait_builder.field(&#arg); + let _ = __debug_trait_builder.field(#expr); } }; @@ -68,8 +84,7 @@ pub fn derive(input: &ast::Input) -> proc_macro2::TokenStream { __debug_trait_builder.finish() } } - }, - ); + }); let name = &input.ident; @@ -86,6 +101,7 @@ pub fn derive(input: &ast::Input) -> proc_macro2::TokenStream { let match_self = quote!(match *self); quote_spanned! {input.span=> #[allow(unused_qualifications)] + #[allow(clippy::unneeded_field_pattern)] impl #impl_generics #debug_trait_path for #name #ty_generics #where_clause { fn fmt(&self, #formatter: &mut #fmt_path::Formatter) -> #fmt_path::Result { #match_self { @@ -129,7 +145,9 @@ fn phantom_path() -> syn::Path { fn format_with( f: &ast::Field, - arg_n: &syn::Ident, + bounds: &Option<&[syn::WherePredicate]>, + arg_expr: &proc_macro2::TokenStream, + arg_ident: &syn::Ident, format_fn: &syn::Path, mut generics: syn::Generics, ) -> proc_macro2::TokenStream { @@ -160,14 +178,12 @@ fn format_with( syn::WherePredicate::Type(syn::PredicateType { lifetimes: None, - bounded_ty: syn::Type::Path(syn::TypePath { - qself: None, - path, - }), + bounded_ty: syn::Type::Path(syn::TypePath { qself: None, path }), colon_token: Default::default(), bounds, }) }) + .chain(bounds.iter().flat_map(|b| b.iter().cloned())) .collect::>(); generics .make_where_clause() @@ -189,17 +205,21 @@ fn format_with( let (_, ctor_ty_generics, _) = ctor_generics.split_for_impl(); let ctor_ty_generics = ctor_ty_generics.as_turbofish(); + // don't attach a span to prevent issue #58 + let match_self = quote!(match self.0); quote_spanned!(format_fn.span()=> - let #arg_n = { + let #arg_ident = { struct Dummy #impl_generics (&'_derivative #ty, #phantom_path <(#(#phantom,)*)>) #where_clause; impl #impl_generics #debug_trait_path for Dummy #ty_generics #where_clause { fn fmt(&self, __f: &mut #fmt_path::Formatter) -> #fmt_path::Result { - #format_fn(&self.0, __f) + #match_self { + this => #format_fn(this, __f) + } } } - Dummy #ctor_ty_generics (#arg_n, #phantom_path) + Dummy #ctor_ty_generics (&&#arg_expr, #phantom_path) }; ) } diff --git a/third_party/cargo/vendor/derivative-2.1.3/src/default.rs b/third_party/cargo/vendor/derivative-2.2.0/src/default.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/src/default.rs rename to third_party/cargo/vendor/derivative-2.2.0/src/default.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/src/hash.rs b/third_party/cargo/vendor/derivative-2.2.0/src/hash.rs similarity index 90% rename from third_party/cargo/vendor/derivative-2.1.3/src/hash.rs rename to third_party/cargo/vendor/derivative-2.2.0/src/hash.rs index be9ba84..8f13f80 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/src/hash.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/src/hash.rs @@ -20,7 +20,7 @@ pub fn derive(input: &ast::Input) -> proc_macro2::TokenStream { None }; - let body = matcher::Matcher::new(matcher::BindingStyle::Ref).build_arms( + let body = matcher::Matcher::new(matcher::BindingStyle::Ref, input.attrs.is_packed).build_arms( input, "__arg", |_, _, _, _, _, bis| { @@ -29,15 +29,15 @@ pub fn derive(input: &ast::Input) -> proc_macro2::TokenStream { return None; } - let arg = &bi.ident; + let arg = &bi.expr; if let Some(hash_with) = bi.field.attrs.hash_with() { Some(quote! { - #hash_with(#arg, __state); + #hash_with(&#arg, __state); }) } else { Some(quote! { - #hash_trait_path::hash(#arg, __state); + #hash_trait_path::hash(&#arg, __state); }) } }); diff --git a/third_party/cargo/vendor/derivative-2.1.3/src/lib.rs b/third_party/cargo/vendor/derivative-2.2.0/src/lib.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/src/lib.rs rename to third_party/cargo/vendor/derivative-2.2.0/src/lib.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/src/matcher.rs b/third_party/cargo/vendor/derivative-2.2.0/src/matcher.rs similarity index 68% rename from third_party/cargo/vendor/derivative-2.1.3/src/matcher.rs rename to third_party/cargo/vendor/derivative-2.2.0/src/matcher.rs index 746b4c4..4b78fa4 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/src/matcher.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/src/matcher.rs @@ -27,6 +27,17 @@ pub enum BindingStyle { RefMut, } +impl BindingStyle { + fn with_packed(self, is_packed: bool) -> BindingStyle { + match self { + BindingStyle::Move | BindingStyle::MoveMut => self, + BindingStyle::Ref if is_packed => BindingStyle::Move, + BindingStyle::RefMut if is_packed => BindingStyle::MoveMut, + BindingStyle::Ref | BindingStyle::RefMut => self, + } + } +} + impl quote::ToTokens for BindingStyle { fn to_tokens(&self, tokens: &mut TokenStream) { match *self { @@ -42,6 +53,7 @@ impl quote::ToTokens for BindingStyle { #[derive(Debug)] pub struct BindingInfo<'a> { + pub expr: TokenStream, pub ident: syn::Ident, pub field: &'a ast::Field<'a>, } @@ -54,19 +66,25 @@ pub struct CommonVariant<'a> { attrs: &'a attr::Input, } -pub struct Matcher { +pub struct Matcher { binding_name: String, binding_style: BindingStyle, + is_packed: bool, + field_filter: T, } -impl Matcher { - pub fn new(style: BindingStyle) -> Self { +impl Matcher bool> { + pub fn new(style: BindingStyle, is_packed: bool) -> Self { Matcher { binding_name: "__arg".into(), - binding_style: style, + binding_style: style.with_packed(is_packed), + is_packed, + field_filter: |_| true, } } +} +impl bool> Matcher { pub fn with_name(self, name: String) -> Self { Matcher { binding_name: name, @@ -74,6 +92,15 @@ impl Matcher { } } + pub fn with_field_filter

(self, field_filter: P) -> Matcher

{ + Matcher { + field_filter, + binding_name: self.binding_name, + binding_style: self.binding_style, + is_packed: self.is_packed, + } + } + pub fn build_arms(self, input: &ast::Input, binding_name: &str, f: F) -> TokenStream where F: Fn( @@ -107,6 +134,7 @@ impl Matcher { pub fn build_2_arms( self, + (left_matched_expr, right_matched_expr): (TokenStream, TokenStream), left: (&ast::Input, &str), right: (&ast::Input, &str), f: F, @@ -124,18 +152,38 @@ impl Matcher { assert_eq!(left_variants.len(), right_variants.len()); - // Now that we have the patterns, generate the actual branches of the match - // expression - let mut t = TokenStream::new(); - for (i, (left, right)) in left_variants.into_iter().zip(right_variants).enumerate() { - let (left, (left_pat, left_bindings)) = left; - let (right, (right_pat, right_bindings)) = right; + if left_variants.len() == 1 { + let (left, (left_pat, left_bindings)) = left_variants.into_iter().next().unwrap(); + let (right, (right_pat, right_bindings)) = right_variants.into_iter().next().unwrap(); - let body = f(i, left, right, (left_bindings, right_bindings)); - quote!((#left_pat, #right_pat) => { #body }).to_tokens(&mut t); + let body = f(0, left, right, (left_bindings, right_bindings)); + + quote! { + match #left_matched_expr { + #left_pat => match #right_matched_expr { + #right_pat => #body, + }, + } + } + } else { + // Now that we have the patterns, generate the actual branches of the match + // expression + let mut t = TokenStream::new(); + for (i, (left, right)) in left_variants.into_iter().zip(right_variants).enumerate() { + let (left, (left_pat, left_bindings)) = left; + let (right, (right_pat, right_bindings)) = right; + + let body = f(i, left, right, (left_bindings, right_bindings)); + quote!((#left_pat, #right_pat) => { #body }).to_tokens(&mut t); + } + + quote! { + match (&#left_matched_expr, &#right_matched_expr) { + #t + _ => unreachable!(), + } + } } - - t } /// Generate patterns for matching against all of the variants @@ -206,7 +254,13 @@ impl Matcher { (stream, matches), field, binding_name, - |_, ident, binding| quote!(#binding #ident ,), + |f, ident, binding| { + if (self.field_filter)(f) { + quote!(#binding #ident ,) + } else { + quote!(_ ,) + } + }, ) }, ); @@ -223,7 +277,11 @@ impl Matcher { binding_name, |field, ident, binding| { let field_name = field.ident.as_ref().unwrap(); - quote!(#field_name : #binding #ident ,) + if (self.field_filter)(field) { + quote!(#field_name : #binding #ident ,) + } else { + quote!(#field_name : _ ,) + } }, ) }, @@ -253,10 +311,22 @@ impl Matcher { &format!("{}_{}", binding_name, i), proc_macro2::Span::call_site(), ); + let expr = syn::Expr::Path(syn::ExprPath { + attrs: vec![], + qself: None, + path: syn::Path::from(ident.clone()) + }); + + let expr = if self.is_packed { + expr.into_token_stream() + } else { + quote!((*#expr)) + }; f(field, &ident, binding_style).to_tokens(&mut stream); matches.push(BindingInfo { + expr, ident, field, }); diff --git a/third_party/cargo/vendor/derivative-2.1.3/src/paths.rs b/third_party/cargo/vendor/derivative-2.2.0/src/paths.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/src/paths.rs rename to third_party/cargo/vendor/derivative-2.2.0/src/paths.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/src/utils.rs b/third_party/cargo/vendor/derivative-2.2.0/src/utils.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/src/utils.rs rename to third_party/cargo/vendor/derivative-2.2.0/src/utils.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/clippy-warning-clone-from.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/clippy-warning-clone-from.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/clippy-warning-clone-from.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/clippy-warning-clone-from.rs diff --git a/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-debug-unused.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-debug-unused.rs new file mode 100644 index 0000000..91cc077 --- /dev/null +++ b/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-debug-unused.rs @@ -0,0 +1,19 @@ +#![deny(dead_code)] + +#[cfg(feature = "use_core")] +extern crate core; + +#[macro_use] +extern crate derivative; + +#[derive(Derivative)] +#[derivative(Debug)] +struct Foo { + foo: u8, + #[derivative(Debug="ignore")] + bar: u8, +} + +fn main() { + let _ = Foo { foo: 42, bar: 1 }; +} \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-debug-unused.stderr b/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-debug-unused.stderr new file mode 100644 index 0000000..a56c9a2 --- /dev/null +++ b/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-debug-unused.stderr @@ -0,0 +1,11 @@ +error: field is never used: `bar` + --> $DIR/derive-debug-unused.rs:14:5 + | +14 | bar: u8, + | ^^^^^^^ + | +note: lint level defined here + --> $DIR/derive-debug-unused.rs:1:9 + | +1 | #![deny(dead_code)] + | ^^^^^^^^^ diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/derive-debug.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-debug.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/derive-debug.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-debug.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/derive-debug.stderr b/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-debug.stderr similarity index 84% rename from third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/derive-debug.stderr rename to third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-debug.stderr index 03d16ad..9bca716 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/derive-debug.stderr +++ b/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-debug.stderr @@ -6,5 +6,4 @@ error[E0277]: `U` doesn't implement `std::fmt::Debug` | = help: the trait `std::fmt::Debug` is not implemented for `U` = help: consider adding a `where U: std::fmt::Debug` bound - = note: required because of the requirements on the impl of `std::fmt::Debug` for `&U` = note: required by `std::fmt::Debug::fmt` diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/derive-partial-ord.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-partial-ord.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/derive-partial-ord.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-partial-ord.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/derive-partial-ord.stderr b/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-partial-ord.stderr similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/derive-partial-ord.stderr rename to third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/derive-partial-ord.stderr diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/invalid-attribute.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/invalid-attribute.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/invalid-attribute.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/invalid-attribute.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/invalid-attribute.stderr b/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/invalid-attribute.stderr similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/invalid-attribute.stderr rename to third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/invalid-attribute.stderr diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/unknown-attribute.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/unknown-attribute.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/unknown-attribute.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/unknown-attribute.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/unknown-attribute.stderr b/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/unknown-attribute.stderr similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/unknown-attribute.stderr rename to third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/unknown-attribute.stderr diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/unknown-derive.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/unknown-derive.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/unknown-derive.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/unknown-derive.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/unknown-derive.stderr b/third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/unknown-derive.stderr similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/compile-fail/unknown-derive.stderr rename to third_party/cargo/vendor/derivative-2.2.0/tests/compile-fail/unknown-derive.stderr diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/compile-test.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/compile-test.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/compile-test.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/compile-test.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/derive-clone-generics.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-clone-generics.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/derive-clone-generics.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/derive-clone-generics.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/derive-clone.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-clone.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/derive-clone.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/derive-clone.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/derive-debug-bounds.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-debug-bounds.rs similarity index 94% rename from third_party/cargo/vendor/derivative-2.1.3/tests/derive-debug-bounds.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/derive-debug-bounds.rs index 3a9c7bc..c572a50 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/tests/derive-debug-bounds.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-debug-bounds.rs @@ -15,7 +15,7 @@ struct Foo { } #[derive(Derivative)] -#[derivative(Debug(bound="T: std::fmt::Debug, U:MyDebug"))] +#[derivative(Debug(bound="T: std::fmt::Debug, U: MyDebug"))] struct Foo2 { foo: T, #[derivative(Debug(format_with="MyDebug::my_fmt"))] @@ -31,7 +31,7 @@ struct Bar ( ); #[derive(Derivative)] -#[derivative(Debug(bound="T: std::fmt::Debug, U:MyDebug"))] +#[derivative(Debug(bound="T: std::fmt::Debug, U: MyDebug"))] struct Bar2 ( T, #[derivative(Debug(format_with="MyDebug::my_fmt"))] diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/derive-debug-generics.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-debug-generics.rs similarity index 98% rename from third_party/cargo/vendor/derivative-2.1.3/tests/derive-debug-generics.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/derive-debug-generics.rs index 97208b1..97104c1 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/tests/derive-debug-generics.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-debug-generics.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + #[cfg(feature = "use_core")] extern crate core; diff --git a/third_party/cargo/vendor/derivative-2.2.0/tests/derive-debug-packed.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-debug-packed.rs new file mode 100644 index 0000000..08ece8f --- /dev/null +++ b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-debug-packed.rs @@ -0,0 +1,74 @@ +#[cfg(feature = "use_core")] +extern crate core; + +#[macro_use] +extern crate derivative; + +#[derive(Derivative)] +#[derivative(Debug)] +#[repr(C, packed)] +struct Foo { + foo: u8, + #[derivative(Debug="ignore")] + bar: u8, +} + +#[derive(Derivative)] +#[derivative(Debug)] +#[repr(C, packed)] +struct Bar ( + u8, + #[derivative(Debug="ignore")] + u8, +); + +#[derive(Derivative)] +#[derivative(Debug)] +#[repr(C, packed)] +struct F(#[derivative(Debug="ignore")] isize); + +#[derive(Derivative)] +#[derivative(Debug)] +#[repr(C, packed)] +struct G(isize, #[derivative(Debug="ignore")] isize); + +#[derive(Derivative)] +#[derivative(Debug)] +#[repr(C, packed)] +struct J(#[derivative(Debug="ignore")] NoDebug); + +#[derive(Derivative)] +#[derivative(Debug)] +#[repr(C, packed)] +struct K(isize, #[derivative(Debug="ignore")] NoDebug); + +#[derive(Derivative)] +#[derivative(Debug)] +#[repr(C, packed)] +struct L { + #[derivative(Debug="ignore")] + foo: NoDebug +} + +struct NoDebug; + +trait ToDebug { + fn to_show(&self) -> String; +} + +impl ToDebug for T { + fn to_show(&self) -> String { + format!("{:?}", self) + } +} + +#[test] +fn main() { + assert_eq!(Foo { foo: 42, bar: 1 }.to_show(), "Foo { foo: 42 }".to_string()); + assert_eq!(Bar(42, 1).to_show(), "Bar(42)".to_string()); + assert_eq!(F(42).to_show(), "F".to_string()); + assert_eq!(G(42, 0).to_show(), "G(42)".to_string()); + assert_eq!(J(NoDebug).to_show(), "J".to_string()); + assert_eq!(K(42, NoDebug).to_show(), "K(42)".to_string()); + assert_eq!(L{ foo: NoDebug }.to_show(), "L".to_string()); +} diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/derive-debug-transparent.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-debug-transparent.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/derive-debug-transparent.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/derive-debug-transparent.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/derive-debug.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-debug.rs similarity index 98% rename from third_party/cargo/vendor/derivative-2.1.3/tests/derive-debug.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/derive-debug.rs index 565e7d4..1c218bb 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/tests/derive-debug.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-debug.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + #[cfg(feature = "use_core")] extern crate core; diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/derive-default-bounds.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-default-bounds.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/derive-default-bounds.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/derive-default-bounds.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/derive-default.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-default.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/derive-default.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/derive-default.rs diff --git a/third_party/cargo/vendor/derivative-2.2.0/tests/derive-eq-packed.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-eq-packed.rs new file mode 100644 index 0000000..6e495c2 --- /dev/null +++ b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-eq-packed.rs @@ -0,0 +1,61 @@ +#![allow(clippy::eq_op)] + +#[cfg(feature = "use_core")] +extern crate core; + +#[macro_use] +extern crate derivative; + +#[derive(Derivative, PartialEq)] +#[derivative(Eq)] +#[repr(C, packed)] +struct Foo { + foo: u8 +} + +#[derive(Derivative)] +#[derivative(Eq)] +#[repr(C, packed)] +struct WithPtr { + #[derivative(Eq(bound=""))] + foo: *const T +} + +impl PartialEq for WithPtr { + fn eq(&self, other: &Self) -> bool { + self.foo == other.foo + } +} + +#[derive(Derivative)] +#[derivative(PartialEq, Eq)] +#[repr(C, packed)] +struct Generic(T); + +trait SomeTrait {} +#[derive(Clone, Copy, PartialEq, Eq)] +struct SomeType { + #[allow(dead_code)] + foo: u8 +} +impl SomeTrait for SomeType {} + +fn assert_eq(_: T) {} + +#[test] +fn main() { + assert!(Foo { foo: 7 } == Foo { foo: 7 }); + assert!(Foo { foo: 7 } != Foo { foo: 42 }); + + assert_eq(Foo { foo: 7 }); + + let ptr1: *const dyn SomeTrait = &SomeType { foo: 0 }; + let ptr2: *const dyn SomeTrait = &SomeType { foo: 1 }; + assert!(WithPtr { foo: ptr1 } == WithPtr { foo: ptr1 }); + assert!(WithPtr { foo: ptr1 } != WithPtr { foo: ptr2 }); + + assert_eq(WithPtr { foo: ptr1 }); + + assert!(Generic(SomeType { foo: 0 }) == Generic(SomeType { foo: 0 })); + assert_eq(Generic(SomeType { foo: 0 })); +} diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/derive-eq.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-eq.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/derive-eq.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/derive-eq.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/derive-hash.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-hash.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/derive-hash.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/derive-hash.rs diff --git a/third_party/cargo/vendor/derivative-2.2.0/tests/derive-ord-packed.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-ord-packed.rs new file mode 100644 index 0000000..7b4cad7 --- /dev/null +++ b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-ord-packed.rs @@ -0,0 +1,264 @@ +#![allow(renamed_and_removed_lints)] // clippy::cyclomatic_complexity → clippy::cognitive_complexity +#![allow(clippy::cyclomatic_complexity)] +#![allow(clippy::cognitive_complexity)] +#![allow(clippy::trivially_copy_pass_by_ref)] +#![allow(clippy::unknown_clippy_lints)] + +#[cfg(feature = "use_core")] +extern crate core; + +#[macro_use] +extern crate derivative; + +#[derive(PartialEq, Eq, Derivative)] +#[derivative(PartialOrd, Ord)] +#[repr(C, packed)] +struct Foo { + foo: u8, +} + +#[derive(Derivative)] +#[derivative(PartialEq, PartialOrd, Ord, Eq)] +#[repr(C, packed)] +struct WithPtr { + #[derivative(PartialEq(bound = ""))] + #[derivative(PartialOrd(bound = ""))] + #[derivative(Ord(bound = ""))] + #[derivative(Eq(bound = ""))] + foo: *const T, +} + +#[derive(PartialEq, Eq, Derivative)] +#[derivative(PartialOrd, Ord)] +#[repr(C, packed)] +struct Empty; + +#[derive(PartialEq, Eq, Derivative)] +#[derivative(PartialOrd, Ord)] +#[repr(C, packed)] +struct AllIgnored { + #[derivative(PartialOrd = "ignore")] + #[derivative(Ord = "ignore")] + foo: u8, +} + +#[derive(PartialEq, Eq, Derivative)] +#[derivative(PartialOrd, Ord)] +#[repr(C, packed)] +struct OneIgnored { + #[derivative(PartialOrd = "ignore")] + #[derivative(Ord = "ignore")] + foo: u8, + bar: u8, +} + +#[derive(PartialEq, Eq, Derivative)] +#[derivative(PartialOrd, Ord)] +#[repr(C, packed)] +struct Tenth( + #[derivative( + PartialOrd(compare_with = "partial_cmp_tenth"), + Ord(compare_with = "cmp_tenth") + )] + u8, +); + +fn partial_cmp_tenth(lhs: &u8, rhs: &u8) -> std::option::Option { + if *lhs == 0 { + None + } else { + Some((lhs / 10).cmp(&(rhs / 10))) + } +} +fn cmp_tenth(lhs: &u8, rhs: &u8) -> std::cmp::Ordering { + (lhs / 10).cmp(&(rhs / 10)) +} + +#[derive(Derivative)] +#[derivative(PartialOrd, Ord, PartialEq, Eq)] +#[repr(C, packed)] +struct Generic( + #[derivative( + PartialEq = "ignore", + PartialOrd(compare_with = "dummy_partial_cmp", bound = ""), + Ord(compare_with = "dummy_cmp", bound = "") + )] + T, +); + +fn dummy_partial_cmp(_: &T, _: &T) -> std::option::Option { + Some(std::cmp::Ordering::Less) +} +fn dummy_cmp(_: &T, _: &T) -> std::cmp::Ordering { + std::cmp::Ordering::Less +} + +struct NonPartialOrd; + +#[derive(Derivative)] +#[derivative(PartialEq, PartialOrd, Ord, Eq)] +#[repr(C, packed)] +struct GenericIgnore { + f: u32, + #[derivative(PartialEq = "ignore")] + #[derivative(PartialOrd = "ignore")] + #[derivative(Ord = "ignore")] + t: T, +} + +trait SomeTrait {} + +#[derive(Clone, Copy)] +struct SomeType { + #[allow(dead_code)] + foo: u8, +} +impl SomeTrait for SomeType {} + +#[test] +fn main() { + use std::cmp::Ordering; + + assert_eq!( + Foo { foo: 7 }.partial_cmp(&Foo { foo: 42 }), + Some(Ordering::Less) + ); + assert_eq!( + Foo { foo: 42 }.partial_cmp(&Foo { foo: 42 }), + Some(Ordering::Equal) + ); + assert_eq!( + Foo { foo: 42 }.partial_cmp(&Foo { foo: 7 }), + Some(Ordering::Greater) + ); + assert_eq!(Foo { foo: 7 }.cmp(&Foo { foo: 42 }), Ordering::Less); + assert_eq!(Foo { foo: 42 }.cmp(&Foo { foo: 42 }), Ordering::Equal); + assert_eq!(Foo { foo: 42 }.cmp(&Foo { foo: 7 }), Ordering::Greater); + + let pointers: [*const dyn SomeTrait; 2] = [&SomeType { foo: 1 }, &SomeType { foo: 0 }]; + let ptr1: *const dyn SomeTrait = pointers[0]; + let ptr2: *const dyn SomeTrait = pointers[1]; + let (ptr1, ptr2) = (std::cmp::min(ptr1, ptr2), std::cmp::max(ptr1, ptr2)); + assert_eq!( + WithPtr { foo: ptr1 }.partial_cmp(&WithPtr { foo: ptr1 }), + Some(Ordering::Equal) + ); + assert_eq!( + WithPtr { foo: ptr1 }.cmp(&WithPtr { foo: ptr1 }), + Ordering::Equal + ); + assert_eq!( + WithPtr { foo: ptr1 }.partial_cmp(&WithPtr { foo: ptr2 }), + Some(Ordering::Less) + ); + assert_eq!( + WithPtr { foo: ptr1 }.cmp(&WithPtr { foo: ptr2 }), + Ordering::Less + ); + + assert_eq!(Empty.partial_cmp(&Empty), Some(Ordering::Equal)); + assert_eq!( + AllIgnored { foo: 0 }.partial_cmp(&AllIgnored { foo: 42 }), + Some(Ordering::Equal) + ); + assert_eq!( + OneIgnored { foo: 0, bar: 6 }.partial_cmp(&OneIgnored { foo: 42, bar: 7 }), + Some(Ordering::Less) + ); + assert_eq!( + OneIgnored { foo: 0, bar: 6 }.partial_cmp(&OneIgnored { foo: 42, bar: 6 }), + Some(Ordering::Equal) + ); + assert_eq!( + OneIgnored { foo: 0, bar: 7 }.partial_cmp(&OneIgnored { foo: 42, bar: 6 }), + Some(Ordering::Greater) + ); + assert_eq!(Empty.cmp(&Empty), Ordering::Equal); + assert_eq!( + AllIgnored { foo: 0 }.cmp(&AllIgnored { foo: 42 }), + Ordering::Equal + ); + assert_eq!( + OneIgnored { foo: 0, bar: 6 }.cmp(&OneIgnored { foo: 42, bar: 7 }), + Ordering::Less + ); + assert_eq!( + OneIgnored { foo: 0, bar: 6 }.cmp(&OneIgnored { foo: 42, bar: 6 }), + Ordering::Equal + ); + assert_eq!( + OneIgnored { foo: 0, bar: 7 }.cmp(&OneIgnored { foo: 42, bar: 6 }), + Ordering::Greater + ); + + assert_eq!( + Option::None::.partial_cmp(&Option::Some(7)), + Some(Ordering::Less) + ); + assert_eq!( + Option::Some(6).partial_cmp(&Option::Some(7)), + Some(Ordering::Less) + ); + assert_eq!( + Option::Some(42).partial_cmp(&Option::Some(42)), + Some(Ordering::Equal) + ); + assert_eq!( + Option::None::.partial_cmp(&Option::None::), + Some(Ordering::Equal) + ); + assert_eq!( + Option::Some(7).partial_cmp(&Option::Some(6)), + Some(Ordering::Greater) + ); + assert_eq!( + Option::Some(7).partial_cmp(&Option::None::), + Some(Ordering::Greater) + ); + assert_eq!(Option::None::.cmp(&Option::Some(7)), Ordering::Less); + assert_eq!(Option::Some(6).cmp(&Option::Some(7)), Ordering::Less); + assert_eq!(Option::Some(42).cmp(&Option::Some(42)), Ordering::Equal); + assert_eq!(Option::None::.cmp(&Option::None::), Ordering::Equal); + assert_eq!(Option::Some(7).cmp(&Option::Some(6)), Ordering::Greater); + assert_eq!(Option::Some(7).cmp(&Option::None::), Ordering::Greater); + + assert_eq!(Tenth(0).partial_cmp(&Tenth(67)), None); + assert_eq!(Tenth(42).partial_cmp(&Tenth(67)), Some(Ordering::Less)); + assert_eq!(Tenth(60).partial_cmp(&Tenth(67)), Some(Ordering::Equal)); + assert_eq!(Tenth(100).partial_cmp(&Tenth(67)), Some(Ordering::Greater)); + assert_eq!(Tenth(42).cmp(&Tenth(67)), Ordering::Less); + assert_eq!(Tenth(60).cmp(&Tenth(67)), Ordering::Equal); + assert_eq!(Tenth(100).cmp(&Tenth(67)), Ordering::Greater); + + assert_eq!( + Generic(SomeType { foo: 0 }).partial_cmp(&Generic(SomeType { foo: 0 })), + Some(Ordering::Less) + ); + assert_eq!( + Generic(SomeType { foo: 0 }).cmp(&Generic(SomeType { foo: 0 })), + Ordering::Less + ); + + assert_eq!( + GenericIgnore { + f: 123, + t: NonPartialOrd + } + .cmp(&GenericIgnore { + f: 123, + t: NonPartialOrd + }), + Ordering::Equal + ); + assert_eq!( + GenericIgnore { + f: 123, + t: NonPartialOrd + } + .partial_cmp(&GenericIgnore { + f: 123, + t: NonPartialOrd + }), + Some(Ordering::Equal) + ); +} diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/derive-ord.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-ord.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/derive-ord.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/derive-ord.rs diff --git a/third_party/cargo/vendor/derivative-2.2.0/tests/derive-partial-eq-packed.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-partial-eq-packed.rs new file mode 100644 index 0000000..e3bce6c --- /dev/null +++ b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-partial-eq-packed.rs @@ -0,0 +1,120 @@ +#![allow(clippy::eq_op, clippy::trivially_copy_pass_by_ref)] + +#[cfg(feature = "use_core")] +extern crate core; + +#[macro_use] +extern crate derivative; + +#[derive(Derivative)] +#[derivative(PartialEq)] +#[repr(C, packed)] +struct Foo { + foo: u8, +} + +#[derive(Derivative)] +#[derivative(PartialEq)] +#[repr(C, packed)] +struct WithPtr { + #[derivative(PartialEq(bound = ""))] + foo: *const T, +} + +#[derive(Derivative)] +#[derivative(PartialEq)] +#[repr(C, packed)] +struct Empty; + +#[derive(Derivative)] +#[derivative(PartialEq)] +#[repr(C, packed)] +struct AllIgnored { + #[derivative(PartialEq = "ignore")] + foo: u8, +} + +#[derive(Derivative)] +#[derivative(PartialEq)] +#[repr(C, packed)] +struct OneIgnored { + #[derivative(PartialEq = "ignore")] + foo: u8, + bar: u8, +} + +#[derive(Derivative)] +#[derivative(PartialEq)] +#[repr(C, packed)] +struct Parity(#[derivative(PartialEq(compare_with = "same_parity"))] u8); + +fn same_parity(lhs: &u8, rhs: &u8) -> bool { + lhs % 2 == rhs % 2 +} + +#[derive(Derivative)] +#[derivative(PartialEq)] +#[repr(C, packed)] +struct Generic(#[derivative(PartialEq(compare_with = "dummy_cmp", bound = ""))] T); + +fn dummy_cmp(_: &T, _: &T) -> bool { + true +} + +struct NonPartialEq; + +#[derive(Derivative)] +#[derivative(PartialEq, Eq)] +#[repr(C, packed)] +struct GenericIgnore { + f: u32, + #[derivative(PartialEq = "ignore")] + t: T, +} + +trait SomeTrait {} + +#[derive(Copy, Clone)] +struct SomeType { + #[allow(dead_code)] + foo: u8, +} +impl SomeTrait for SomeType {} + +#[test] +fn main() { + assert!(Foo { foo: 7 } == Foo { foo: 7 }); + assert!(Foo { foo: 7 } != Foo { foo: 42 }); + + let ptr1: *const dyn SomeTrait = &SomeType { foo: 0 }; + let ptr2: *const dyn SomeTrait = &SomeType { foo: 1 }; + assert!(WithPtr { foo: ptr1 } == WithPtr { foo: ptr1 }); + assert!(WithPtr { foo: ptr1 } != WithPtr { foo: ptr2 }); + + assert!(Empty == Empty); + assert!(AllIgnored { foo: 0 } == AllIgnored { foo: 42 }); + assert!(OneIgnored { foo: 0, bar: 6 } == OneIgnored { foo: 42, bar: 6 }); + assert!(OneIgnored { foo: 0, bar: 6 } != OneIgnored { foo: 42, bar: 7 }); + + assert!(Option::Some(42) == Option::Some(42)); + assert!(Option::Some(0) != Option::Some(42)); + assert!(Option::Some(42) != Option::None); + assert!(Option::None != Option::Some(42)); + assert!(Option::None:: == Option::None::); + + assert!(Parity(3) == Parity(7)); + assert!(Parity(2) == Parity(42)); + assert!(Parity(3) != Parity(42)); + assert!(Parity(2) != Parity(7)); + + assert!(Generic(SomeType { foo: 0 }) == Generic(SomeType { foo: 0 })); + assert!( + GenericIgnore { + f: 123, + t: NonPartialEq + } == GenericIgnore { + f: 123, + t: NonPartialEq + } + ); +} diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/derive-partial-eq.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-partial-eq.rs similarity index 97% rename from third_party/cargo/vendor/derivative-2.1.3/tests/derive-partial-eq.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/derive-partial-eq.rs index 0368127..d9e67f3 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/tests/derive-partial-eq.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/tests/derive-partial-eq.rs @@ -1,4 +1,4 @@ -#![allow(clippy::eq_op, clippy::trivially_copy_pass_by_ref)] +#![allow(clippy::eq_op, clippy::trivially_copy_pass_by_ref, dead_code)] #[cfg(feature = "use_core")] extern crate core; diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/issue-37-turbofish.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/issue-37-turbofish.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/issue-37-turbofish.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/issue-37-turbofish.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/issue-55.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/issue-55.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/issue-55.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/issue-55.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/issue-57.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/issue-57.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/issue-57.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/issue-57.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/issue-58.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/issue-58.rs similarity index 91% rename from third_party/cargo/vendor/derivative-2.1.3/tests/issue-58.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/issue-58.rs index 14673b2..313ffd5 100644 --- a/third_party/cargo/vendor/derivative-2.1.3/tests/issue-58.rs +++ b/third_party/cargo/vendor/derivative-2.2.0/tests/issue-58.rs @@ -1,4 +1,4 @@ -#![forbid(clippy::all)] +#![deny(clippy::all)] #[cfg(feature = "use_core")] extern crate core; diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/issue-67.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/issue-67.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/issue-67.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/issue-67.rs diff --git a/third_party/cargo/vendor/derivative-2.2.0/tests/issue-82.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/issue-82.rs new file mode 100644 index 0000000..69913d4 --- /dev/null +++ b/third_party/cargo/vendor/derivative-2.2.0/tests/issue-82.rs @@ -0,0 +1,13 @@ +#[cfg(feature = "use_core")] +extern crate core; + +#[macro_use] +extern crate derivative; + +#[derive(Copy, Clone, Derivative)] +#[derivative(Debug)] +#[repr(C, packed)] +struct Test { + a: u8, + b: u32, +} \ No newline at end of file diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-class-implement-traits.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-class-implement-traits.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-class-implement-traits.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-class-implement-traits.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-bounds.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-bounds.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-bounds.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-bounds.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-clone-array.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-clone-array.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-clone-array.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-clone-array.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-clone-enum.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-clone-enum.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-clone-enum.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-clone-enum.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-clone-generic-enum.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-clone-generic-enum.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-clone-generic-enum.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-clone-generic-enum.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-clone-generic-tuple-struct.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-clone-generic-tuple-struct.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-clone-generic-tuple-struct.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-clone-generic-tuple-struct.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-clone-struct.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-clone-struct.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-clone-struct.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-clone-struct.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-clone-tuple-struct.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-clone-tuple-struct.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-clone-tuple-struct.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-clone-tuple-struct.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-cmp-generic-enum.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-cmp-generic-enum.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-cmp-generic-enum.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-cmp-generic-enum.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-cmp-generic-struct-enum.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-cmp-generic-struct-enum.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-cmp-generic-struct-enum.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-cmp-generic-struct-enum.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-cmp-generic-struct.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-cmp-generic-struct.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-cmp-generic-struct.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-cmp-generic-struct.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-cmp-generic-tuple-struct.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-cmp-generic-tuple-struct.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-cmp-generic-tuple-struct.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-cmp-generic-tuple-struct.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-copyclone.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-copyclone.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-copyclone.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-copyclone.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-default-box.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-default-box.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-default-box.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-default-box.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-enum-single-variant.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-enum-single-variant.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-enum-single-variant.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-enum-single-variant.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-hash.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-hash.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-hash.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-hash.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-in-fn.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-in-fn.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-in-fn.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-in-fn.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-meta-multiple.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-meta-multiple.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-meta-multiple.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-meta-multiple.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-meta.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-meta.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-meta.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-meta.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-show-2.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-show-2.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-show-2.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-show-2.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-show.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-show.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-show.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-show.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-via-extension-hash-enum.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-via-extension-hash-enum.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-via-extension-hash-enum.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-via-extension-hash-enum.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-via-extension-hash-struct.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-via-extension-hash-struct.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-via-extension-hash-struct.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-via-extension-hash-struct.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-via-extension-type-params.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-via-extension-type-params.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-deriving-via-extension-type-params.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-deriving-via-extension-type-params.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-expr-copy.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-expr-copy.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-expr-copy.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-expr-copy.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-exterior.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-exterior.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-exterior.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-exterior.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-12860.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-12860.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-12860.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-12860.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-13434.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-13434.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-13434.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-13434.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-16530.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-16530.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-16530.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-16530.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-19037.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-19037.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-19037.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-19037.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-19102.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-19102.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-19102.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-19102.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-19135.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-19135.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-19135.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-19135.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-19358.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-19358.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-19358.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-19358.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-21402.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-21402.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-21402.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-21402.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-23649-3.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-23649-3.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-23649-3.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-23649-3.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-24085.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-24085.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-24085.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-24085.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-25394.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-25394.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-25394.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-25394.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-28561.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-28561.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-28561.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-28561.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-29030.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-29030.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-29030.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-29030.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-29540.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-29540.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-29540.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-29540.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-29710.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-29710.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-29710.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-29710.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-32292.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-32292.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-32292.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-32292.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-3935.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-3935.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-3935.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-3935.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-42453.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-42453.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-42453.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-42453.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-58319.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-58319.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-58319.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-58319.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-6341.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-6341.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-issue-6341.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-issue-6341.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-typeclasses-eq-example.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-typeclasses-eq-example.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-typeclasses-eq-example.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-typeclasses-eq-example.rs diff --git a/third_party/cargo/vendor/derivative-2.1.3/tests/rustc-zero-sized-btreemap-insert.rs b/third_party/cargo/vendor/derivative-2.2.0/tests/rustc-zero-sized-btreemap-insert.rs similarity index 100% rename from third_party/cargo/vendor/derivative-2.1.3/tests/rustc-zero-sized-btreemap-insert.rs rename to third_party/cargo/vendor/derivative-2.2.0/tests/rustc-zero-sized-btreemap-insert.rs diff --git a/third_party/cargo/vendor/dlib-0.4.2/BUILD.bazel b/third_party/cargo/vendor/dlib-0.4.2/BUILD.bazel index dda56b0..2f2f9fa 100644 --- a/third_party/cargo/vendor/dlib-0.4.2/BUILD.bazel +++ b/third_party/cargo/vendor/dlib-0.4.2/BUILD.bazel @@ -34,7 +34,6 @@ rust_library( name = "dlib", srcs = glob(["**/*.rs"]), crate_features = [ - "dlopen", ], crate_root = "src/lib.rs", crate_type = "lib", @@ -50,6 +49,6 @@ rust_library( version = "0.4.2", # buildifier: leave-alone deps = [ - "//third_party/cargo/vendor/libloading-0.6.6:libloading", + "//third_party/cargo/vendor/libloading-0.6.7:libloading", ], ) diff --git a/third_party/cargo/vendor/dlib-0.5.0/.cargo-checksum.json b/third_party/cargo/vendor/dlib-0.5.0/.cargo-checksum.json new file mode 100644 index 0000000..f5a4d43 --- /dev/null +++ b/third_party/cargo/vendor/dlib-0.5.0/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"b9bea9c534ecfcfb0d2f64a2666f17e1fa95314360b034c6472bbdf12822de15","LICENSE.txt":"10e5daea68c3ab7da6468ea51860e9d4ac87ea6a9a2d34127beff17b7193b618","README.md":"695c46ea33a846ce2e80b18019eaa112df576959805029625a52a00b8fff00ca","src/lib.rs":"accaa029720892af16a6c26a60240863897406af24f535f0cf9451062e2486ad"},"package":"ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794"} \ No newline at end of file diff --git a/third_party/cargo/vendor/dlib-0.5.0/BUILD.bazel b/third_party/cargo/vendor/dlib-0.5.0/BUILD.bazel new file mode 100644 index 0000000..6de9f9e --- /dev/null +++ b/third_party/cargo/vendor/dlib-0.5.0/BUILD.bazel @@ -0,0 +1,54 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//third_party/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT" +]) + +# Generated Targets + +rust_library( + name = "dlib", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.5.0", + # buildifier: leave-alone + deps = [ + "//third_party/cargo/vendor/libloading-0.7.0:libloading", + ], +) diff --git a/third_party/cargo/vendor/dlib-0.5.0/Cargo.toml b/third_party/cargo/vendor/dlib-0.5.0/Cargo.toml new file mode 100644 index 0000000..82cc369 --- /dev/null +++ b/third_party/cargo/vendor/dlib-0.5.0/Cargo.toml @@ -0,0 +1,25 @@ +# 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 = "dlib" +version = "0.5.0" +authors = ["Victor Berger "] +exclude = ["/dlib-test", "README.tpl"] +description = "Helper macros for handling manually loading optional system libraries." +readme = "README.md" +keywords = ["dylib", "dlopen"] +categories = ["api-bindings"] +license = "MIT" +repository = "https://github.com/vberger/dlib" +[dependencies.libloading] +version = "0.7" diff --git a/third_party/cargo/vendor/wayland-client-0.28.3/LICENSE.txt b/third_party/cargo/vendor/dlib-0.5.0/LICENSE.txt similarity index 100% rename from third_party/cargo/vendor/wayland-client-0.28.3/LICENSE.txt rename to third_party/cargo/vendor/dlib-0.5.0/LICENSE.txt diff --git a/third_party/cargo/vendor/dlib-0.5.0/README.md b/third_party/cargo/vendor/dlib-0.5.0/README.md new file mode 100644 index 0000000..b8f971c --- /dev/null +++ b/third_party/cargo/vendor/dlib-0.5.0/README.md @@ -0,0 +1,136 @@ +[![crates.io](http://meritbadge.herokuapp.com/dlib)](https://crates.io/crates/dlib) +[![docs.rs](https://docs.rs/dlib/badge.svg)](https://docs.rs/dlib) + +# dlib + +dlib is a small crate providing macros to make easy the use of external system libraries that +can or cannot be optionally loaded at runtime, depending on whether a certain feature is enabled. + +### Usage + +dlib defines the `external_library!` macro, which can be invoked in this way: + +```rust +external_library!(feature="dlopen-foo", Foo, "foo", + statics: + me: c_int, + you: c_float, + functions: + fn foo() -> c_int, + fn bar(c_int, c_float) -> (), + fn baz(*const c_int) -> c_int, + varargs: + fn blah(c_int, c_int ...) -> *const c_void, + fn bleh(c_int ...) -> (), +); +``` + +As you can see, it is required to separate static values from functions and from function +having variadic arguments. Each of these 3 categories is optional, but the ones used must appear +in this order. Return types of the functions must all be explicit (hence `-> ()` for void functions). + +If the feature named by the `feature` argument (in this example, `dlopen-foo`) is absent on your crate, +this macro will expand to an extern block defining each of the items, using the third argument +of the macro as a link name: + +```rust +#[link(name = "foo")] +extern "C" { + pub static me: c_int; + pub static you: c_float; + pub fn foo() -> c_int; + pub fn bar(_: c_int, _: c_float) -> (); + pub fn baz(_: *const c_int) -> c_int; + pub fn blah(_: c_int, _: c_int, ...) -> *const c_void; + pub fn bleh(_: c_int, ...) -> (); +} + +``` + +If the feature named by the `feature` argument is present on your crate, it will expand to a +`struct` named by the second argument of the macro, with one field for each of the symbols defined; +and a method `open`, which tries to load the library from the name or path given as an argument. + +```rust +pub struct Foo { + pub me: &'static c_int, + pub you: &'static c_float, + pub foo: unsafe extern "C" fn() -> c_int, + pub bar: unsafe extern "C" fn(c_int, c_float) -> (), + pub baz: unsafe extern "C" fn(*const c_int) -> c_int, + pub blah: unsafe extern "C" fn(c_int, c_int, ...) -> *const c_void, + pub bleh: unsafe extern "C" fn(c_int, ...) -> (), +} + + +impl Foo { + pub unsafe fn open(name: &str) -> Result { /* ... */ } +} +``` + +This method returns `Ok(..)` if the loading was successful. It contains an instance of the defined struct +with all of its fields pointing to the appropriate symbol. + +If the library specified by `name` could not be openened, it returns `Err(DlError::CantOpen(e))`, with +`e` the error reported by `libloading` (see [LibLoadingError]); + +It will also fail on the first missing symbol, with `Err(DlError::MissingSymbol(symb))` where `symb` +is a `&str` containing the missing symbol name. + +Note that this method is unsafe, as loading (and unloading on drop) an external C library can run arbitrary +code. As such, you need to ensure that the specific library you want to load is safe to load in the context +you want to load it. + +### Remaining generic in your crate + +If you want your crate to remain generic over dlopen vs. linking, simply add a feature to your `Cargo.toml`: + +```toml +[dependencies] +dlib = "0.5" + +[features] +dlopen-foo = [] +``` + +Then give the name of that feature as the `feature` argument to dlib's macros: + +```rust +external_library!(feature="dlopen-foo", Foo, "foo", + functions: + fn foo() -> c_int, +); +``` + +`dlib` provides helper macros to dispatch the access to foreign symbols: + +```rust +ffi_dispatch!(feature="dlopen-foo", Foo, function, arg1, arg2); +ffi_dispatch_static!(feature="dlopen-foo", Foo, my_static_var); +``` + +These will expand to the appropriate value or function call depending on the presence or absence of the +`dlopen-foo` feature on your crate. + +You must still ensure that the functions/statics or the wrapper struct `Foo` are in scope. For example, +you could use the [`lazy_static`](https://crates.io/crates/lazy_static) crate to do the initialization, +and store the wrapper struct in a static variable that you import wherever needed: + +```rust +#[cfg(feature = "dlopen-foo")] +lazy_static::lazy_static! { + pub static ref FOO_STATIC: Foo = + Foo::open("libfoo.so").ok().expect("could not find libfoo"); +} +``` + +Then, it can become as simple as putting this on top of all modules using the FFI: + +```rust +#[cfg(feature = "dlopen-foo")] +use ffi::FOO_STATIC; +#[cfg(not(feature = "dlopen-foo"))] +use ffi::*; +``` + +License: MIT diff --git a/third_party/cargo/vendor/dlib-0.5.0/src/lib.rs b/third_party/cargo/vendor/dlib-0.5.0/src/lib.rs new file mode 100644 index 0000000..b1ab52a --- /dev/null +++ b/third_party/cargo/vendor/dlib-0.5.0/src/lib.rs @@ -0,0 +1,386 @@ +//! dlib is a small crate providing macros to make easy the use of external system libraries that +//! can or cannot be optionally loaded at runtime, depending on whether a certain feature is enabled. +//! +//! ## Usage +//! +//! dlib defines the `external_library!` macro, which can be invoked in this way: +//! +//! ```rust +//! external_library!(feature="dlopen-foo", Foo, "foo", +//! statics: +//! me: c_int, +//! you: c_float, +//! functions: +//! fn foo() -> c_int, +//! fn bar(c_int, c_float) -> (), +//! fn baz(*const c_int) -> c_int, +//! varargs: +//! fn blah(c_int, c_int ...) -> *const c_void, +//! fn bleh(c_int ...) -> (), +//! ); +//! ``` +//! +//! As you can see, it is required to separate static values from functions and from function +//! having variadic arguments. Each of these 3 categories is optional, but the ones used must appear +//! in this order. Return types of the functions must all be explicit (hence `-> ()` for void functions). +//! +//! If the feature named by the `feature` argument (in this example, `dlopen-foo`) is absent on your crate, +//! this macro will expand to an extern block defining each of the items, using the third argument +//! of the macro as a link name: +//! +//! ```rust +//! #[link(name = "foo")] +//! extern "C" { +//! pub static me: c_int; +//! pub static you: c_float; +//! pub fn foo() -> c_int; +//! pub fn bar(_: c_int, _: c_float) -> (); +//! pub fn baz(_: *const c_int) -> c_int; +//! pub fn blah(_: c_int, _: c_int, ...) -> *const c_void; +//! pub fn bleh(_: c_int, ...) -> (); +//! } +//! +//! ``` +//! +//! If the feature named by the `feature` argument is present on your crate, it will expand to a +//! `struct` named by the second argument of the macro, with one field for each of the symbols defined; +//! and a method `open`, which tries to load the library from the name or path given as an argument. +//! +//! ```rust +//! pub struct Foo { +//! pub me: &'static c_int, +//! pub you: &'static c_float, +//! pub foo: unsafe extern "C" fn() -> c_int, +//! pub bar: unsafe extern "C" fn(c_int, c_float) -> (), +//! pub baz: unsafe extern "C" fn(*const c_int) -> c_int, +//! pub blah: unsafe extern "C" fn(c_int, c_int, ...) -> *const c_void, +//! pub bleh: unsafe extern "C" fn(c_int, ...) -> (), +//! } +//! +//! +//! impl Foo { +//! pub unsafe fn open(name: &str) -> Result { /* ... */ } +//! } +//! ``` +//! +//! This method returns `Ok(..)` if the loading was successful. It contains an instance of the defined struct +//! with all of its fields pointing to the appropriate symbol. +//! +//! If the library specified by `name` could not be openened, it returns `Err(DlError::CantOpen(e))`, with +//! `e` the error reported by `libloading` (see [LibLoadingError]); +//! +//! It will also fail on the first missing symbol, with `Err(DlError::MissingSymbol(symb))` where `symb` +//! is a `&str` containing the missing symbol name. +//! +//! Note that this method is unsafe, as loading (and unloading on drop) an external C library can run arbitrary +//! code. As such, you need to ensure that the specific library you want to load is safe to load in the context +//! you want to load it. +//! +//! ## Remaining generic in your crate +//! +//! If you want your crate to remain generic over dlopen vs. linking, simply add a feature to your `Cargo.toml`: +//! +//! ```toml +//! [dependencies] +//! dlib = "0.5" +//! +//! [features] +//! dlopen-foo = [] +//! ``` +//! +//! Then give the name of that feature as the `feature` argument to dlib's macros: +//! +//! ```rust +//! external_library!(feature="dlopen-foo", Foo, "foo", +//! functions: +//! fn foo() -> c_int, +//! ); +//! ``` +//! +//! `dlib` provides helper macros to dispatch the access to foreign symbols: +//! +//! ```rust +//! ffi_dispatch!(feature="dlopen-foo", Foo, function, arg1, arg2); +//! ffi_dispatch_static!(feature="dlopen-foo", Foo, my_static_var); +//! ``` +//! +//! These will expand to the appropriate value or function call depending on the presence or absence of the +//! `dlopen-foo` feature on your crate. +//! +//! You must still ensure that the functions/statics or the wrapper struct `Foo` are in scope. For example, +//! you could use the [`lazy_static`](https://crates.io/crates/lazy_static) crate to do the initialization, +//! and store the wrapper struct in a static variable that you import wherever needed: +//! +//! ```rust +//! #[cfg(feature = "dlopen-foo")] +//! lazy_static::lazy_static! { +//! pub static ref FOO_STATIC: Foo = +//! Foo::open("libfoo.so").ok().expect("could not find libfoo"); +//! } +//! ``` +//! +//! Then, it can become as simple as putting this on top of all modules using the FFI: +//! +//! ```rust +//! #[cfg(feature = "dlopen-foo")] +//! use ffi::FOO_STATIC; +//! #[cfg(not(feature = "dlopen-foo"))] +//! use ffi::*; +//! ``` +#![warn(missing_docs)] + +extern crate libloading; + +pub use libloading::Error as LibLoadingError; +#[doc(hidden)] +pub use libloading::{Library, Symbol}; + +/// Macro for generically invoking a FFI function +/// +/// The expected arguments are, in order: +/// - (Optional) The name of the cargo feature conditionning the usage of dlopen, in the form +/// `feature="feature-name"`. If ommited, the feature `"dlopen"` will be used. +/// - A value of the handle generated by the macro [`external_library!`] when the +/// dlopen-controlling feature is enabled +/// - The name of the function to invoke +/// - The arguments to be passed to the function +/// +/// The macro invocation evaluates to the return value of the FFI function. +/// +/// #### Example +/// +/// Assuming an FFI function of signature `fn(u32, u32) -> u32`: +/// +/// ```rust,ignore +/// let sum = unsafe { ffi_dispatch!(feature="dlopen", LIBRARY_HANDLE, sum, 2, 2) }; +/// ``` +#[macro_export] +macro_rules! ffi_dispatch( + (feature=$feature: expr, $handle: ident, $func: ident, $($arg: expr),*) => ( + { + #[cfg(feature = $feature)] + let ret = ($handle.$func)($($arg),*); + #[cfg(not(feature = $feature))] + let ret = $func($($arg),*); + + ret + } + ); + ($handle: ident, $func: ident, $($arg: expr),*) => ( + // NOTE: this "dlopen" refers to a feature on the crate *using* dlib + $crate::ffi_dispatch!(feature="dlopen", $handle, $func, $($arg),*) + ); +); + +/// Macro for generically accessing a FFI static +/// +/// The expected arguments are, in order: +/// - (Optional) The name of the cargo feature conditionning the usage of dlopen, in the form +/// `feature="feature-name"`. If ommited, the feature `"dlopen"` will be used. +/// - A value of the handle generated by the macro [`external_library!`] when the +/// dlopen-controlling feature is enabled +/// - The name of the static +/// +/// The macro invocation evaluates to a `&T` reference to the static +/// +/// #### Example +/// +/// ```rust,ignore +/// let my_static = unsafe { ffi_dispatch!(feature="dlopen", LIBRARY_HANDLE, my_static) }; +/// ``` +#[macro_export] +macro_rules! ffi_dispatch_static( + (feature=$feature: expr, $handle: ident, $name: ident) => ( + { + #[cfg(feature = $feature)] + let ret = $handle.$name; + #[cfg(not(feature = $feature))] + let ret = &$name; + + ret + } + ); + ($handle:ident, $name: ident) => ( + $crate::ffi_dispatch_static!(feature="dlopen", $handle, $name) + ); +); + +#[doc(hidden)] +#[macro_export] +macro_rules! link_external_library( + ($link: expr, + $(statics: $($sname: ident: $stype: ty),+,)|* + $(functions: $(fn $fname: ident($($farg: ty),*) -> $fret:ty),+,)|* + $(varargs: $(fn $vname: ident($($vargs: ty),+) -> $vret: ty),+,)|* + ) => ( + #[link(name = $link)] + extern "C" { + $($( + pub static $sname: $stype; + )+)* + $($( + pub fn $fname($(_: $farg),*) -> $fret; + )+)* + $($( + pub fn $vname($(_: $vargs),+ , ...) -> $vret; + )+)* + } + ); +); + +/// An error generated when failing to load a library +#[derive(Debug)] +pub enum DlError { + /// The requested library would not be opened + /// + /// Includes the error reported by `libloading` when trying to + /// open the library. + CantOpen(LibLoadingError), + /// Some required symbol was missing in the library + MissingSymbol(&'static str), +} + +impl std::error::Error for DlError { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + match *self { + DlError::CantOpen(ref e) => Some(e), + DlError::MissingSymbol(_) => None, + } + } +} + +impl std::fmt::Display for DlError { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match *self { + DlError::CantOpen(ref e) => write!(f, "Could not open the requested library: {}", e), + DlError::MissingSymbol(s) => write!(f, "The resquested symbol was missing: {}", s), + } + } +} + +#[doc(hidden)] +#[macro_export] +macro_rules! dlopen_external_library( + (__struct, $structname: ident, + $(statics: $($sname: ident: $stype: ty),+,)|* + $(functions: $(fn $fname: ident($($farg: ty),*) -> $fret:ty),+,)|* + $(varargs: $(fn $vname: ident($($vargs: ty),+) -> $vret: ty),+,)|* + ) => ( + pub struct $structname { + __lib: $crate::Library, + $($( + pub $sname: $crate::Symbol<'static, &'static $stype>, + )+)* + $($( + pub $fname: $crate::Symbol<'static, unsafe extern "C" fn($($farg),*) -> $fret>, + )+)* + $($( + pub $vname: $crate::Symbol<'static, unsafe extern "C" fn($($vargs),+ , ...) -> $vret>, + )+)* + } + ); + (__impl, $structname: ident, + $(statics: $($sname: ident: $stype: ty),+,)|* + $(functions: $(fn $fname: ident($($farg: ty),*) -> $fret:ty),+,)|* + $(varargs: $(fn $vname: ident($($vargs: ty),+) -> $vret: ty),+,)|* + ) => ( + impl $structname { + pub unsafe fn open(name: &str) -> Result<$structname, $crate::DlError> { + // we use it to ensure the 'static lifetime + use std::mem::transmute; + let lib = $crate::Library::new(name).map_err($crate::DlError::CantOpen)?; + let s = $structname { + $($($sname: { + let s_name = concat!(stringify!($sname), "\0"); + transmute(match lib.get::<&'static $stype>(s_name.as_bytes()) { + Ok(s) => s, + Err(_) => return Err($crate::DlError::MissingSymbol(s_name)) + }) + }, + )+)* + $($($fname: { + let s_name = concat!(stringify!($fname), "\0"); + transmute(match lib.get:: $fret>(s_name.as_bytes()) { + Ok(s) => s, + Err(_) => return Err($crate::DlError::MissingSymbol(s_name)) + }) + }, + )+)* + $($($vname: { + let s_name = concat!(stringify!($vname), "\0"); + transmute(match lib.get:: $vret>(s_name.as_bytes()) { + Ok(s) => s, + Err(_) => return Err($crate::DlError::MissingSymbol(s_name)) + }) + }, + )+)* + __lib: lib + }; + Ok(s) + } + } + ); + ($structname: ident, + $(statics: $($sname: ident: $stype: ty),+,)|* + $(functions: $(fn $fname: ident($($farg: ty),*) -> $fret:ty),+,)|* + $(varargs: $(fn $vname: ident($($vargs: ty),+) -> $vret: ty),+,)|* + ) => ( + $crate::dlopen_external_library!(__struct, + $structname, $(statics: $($sname: $stype),+,)|* + $(functions: $(fn $fname($($farg),*) -> $fret),+,)|* + $(varargs: $(fn $vname($($vargs),+) -> $vret),+,)|* + ); + $crate::dlopen_external_library!(__impl, + $structname, $(statics: $($sname: $stype),+,)|* + $(functions: $(fn $fname($($farg),*) -> $fret),+,)|* + $(varargs: $(fn $vname($($vargs),+) -> $vret),+,)|* + ); + unsafe impl Sync for $structname { } + ); +); + +/// Main macro of this library, used to generate the the FFI bindings. +/// +/// The expected arguments are, in order: +/// - (Optional) The name of the cargo feature conditionning the usage of dlopen, in the form +/// `feature="feature-name"`. If ommited, the feature `"dlopen"` will be used. +/// - The name of the struct that will be generated when the dlopen-controlling feature is +/// enabled +/// - The link name of the target library +/// - The desctription of the statics, functions, and vararg functions that should be linked +/// +/// See crate-level documentation for a detailed example of use. +#[macro_export] +macro_rules! external_library( + (feature=$feature: expr, $structname: ident, $link: expr, + $(statics: $($sname: ident: $stype: ty),+,)|* + $(functions: $(fn $fname: ident($($farg: ty),*) -> $fret:ty),+,)|* + $(varargs: $(fn $vname: ident($($vargs: ty),+) -> $vret: ty),+,)|* + ) => ( + #[cfg(feature = $feature)] + $crate::dlopen_external_library!( + $structname, $(statics: $($sname: $stype),+,)|* + $(functions: $(fn $fname($($farg),*) -> $fret),+,)|* + $(varargs: $(fn $vname($($vargs),+) -> $vret),+,)|* + ); + + #[cfg(not(feature = $feature))] + $crate::link_external_library!( + $link, $(statics: $($sname: $stype),+,)|* + $(functions: $(fn $fname($($farg),*) -> $fret),+,)|* + $(varargs: $(fn $vname($($vargs),+) -> $vret),+,)|* + ); + ); + ($structname: ident, $link: expr, + $(statics: $($sname: ident: $stype: ty),+,)|* + $(functions: $(fn $fname: ident($($farg: ty),*) -> $fret:ty),+,)|* + $(varargs: $(fn $vname: ident($($vargs: ty),+) -> $vret: ty),+,)|* + ) => ( + $crate::external_library!( + feature="dlopen", $structname, $link, + $(statics: $($sname: $stype),+,)|* + $(functions: $(fn $fname($($farg),*) -> $fret),+,)|* + $(varargs: $(fn $vname($($vargs),+) -> $vret),+,)|* + ); + ); +); diff --git a/third_party/cargo/vendor/env_logger-0.6.2/BUILD.bazel b/third_party/cargo/vendor/env_logger-0.6.2/BUILD.bazel index f4ea01a..dacd0d1 100644 --- a/third_party/cargo/vendor/env_logger-0.6.2/BUILD.bazel +++ b/third_party/cargo/vendor/env_logger-0.6.2/BUILD.bazel @@ -68,8 +68,8 @@ rust_library( deps = [ "//third_party/cargo/vendor/atty-0.2.14:atty", "//third_party/cargo/vendor/humantime-1.3.0:humantime", - "//third_party/cargo/vendor/log-0.4.11:log", - "//third_party/cargo/vendor/regex-1.4.2:regex", + "//third_party/cargo/vendor/log-0.4.14:log", + "//third_party/cargo/vendor/regex-1.4.5:regex", "//third_party/cargo/vendor/termcolor-1.1.2:termcolor", ], ) diff --git a/third_party/cargo/vendor/flatbuffers-0.6.1/BUILD.bazel b/third_party/cargo/vendor/flatbuffers-0.6.1/BUILD.bazel index c5dc82e..f8aca57 100644 --- a/third_party/cargo/vendor/flatbuffers-0.6.1/BUILD.bazel +++ b/third_party/cargo/vendor/flatbuffers-0.6.1/BUILD.bazel @@ -49,6 +49,6 @@ rust_library( version = "0.6.1", # buildifier: leave-alone deps = [ - "//third_party/cargo/vendor/smallvec-1.6.0:smallvec", + "//third_party/cargo/vendor/smallvec-1.6.1:smallvec", ], ) diff --git a/third_party/cargo/vendor/gif-0.11.1/.cargo-checksum.json b/third_party/cargo/vendor/gif-0.11.1/.cargo-checksum.json deleted file mode 100644 index e04e767..0000000 --- a/third_party/cargo/vendor/gif-0.11.1/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"Cargo.toml":"302af2e4b3a924b5df2053a997e570b6d4d0614ad75fa2e2ff1388ba95db314b","Changes.md":"b796d18ab43a4585de8c2e903b451b80ccfbec8236de654fd9cbf13f4da65041","LICENSE-APACHE":"769f80b5bcb42ed0af4e4d2fd74e1ac9bf843cb80c5a29219d1ef3544428a6bb","LICENSE-MIT":"77257f3d2181236b1aee78920238062ae64efe13c5d858b2db126e79c9e1b14f","README.md":"c9668fbeb76bdb3c47900ee6b014fe676d00732b3327fc83a8aeb60c312f9084","benches/decode.rs":"3a042e32cf987c6ffada205d2eea6f66c02958b92ed76c712a36a43dccddbd43","src/common.rs":"7417c89d6914d7ee5ec817fc1bce7b108a5e316bb5440bf2ef42090976e19d56","src/encoder.rs":"0debb8b4303e018a9f00279fff22b4b596f78dab8764539f4b01e26ec855b73d","src/lib.rs":"38f87aee4d10c8907f00fc0be16dd779e059f7f0542525854f6d964b2cd1b9b2","src/reader/decoder.rs":"e10e6f7aa0dffdf26e791e34b170f28042ef85107f1e7ab220d496e70f8bc4b8","src/reader/mod.rs":"d83c5186a9801881e89f843b68c37535be551b2c59c81184aa05d9fdef95661d","src/traits.rs":"0c39abb20949ca7615cb7a2340edd2aa5e6cec5686b013352d3736018dee4a94"},"package":"02efba560f227847cb41463a7395c514d127d4f74fff12ef0137fff1b84b96c4"} \ No newline at end of file diff --git a/third_party/cargo/vendor/gif-0.11.2/.cargo-checksum.json b/third_party/cargo/vendor/gif-0.11.2/.cargo-checksum.json new file mode 100644 index 0000000..44d0003 --- /dev/null +++ b/third_party/cargo/vendor/gif-0.11.2/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.lock":"c7241c34430d8126b4f418c880ceffcf3ba5ebd54c02b7e4b7b7bca91a9de7aa","Cargo.toml":"9294ec6f383ae72025b4603c6b635ba3d390d7fa6b8fd25e8da5949ce8b5c723","Changes.md":"5ed67e295980856eebed359de417b413fd0c6bae3a0cd66ad84ef7bae6db9d3b","LICENSE-APACHE":"769f80b5bcb42ed0af4e4d2fd74e1ac9bf843cb80c5a29219d1ef3544428a6bb","LICENSE-MIT":"77257f3d2181236b1aee78920238062ae64efe13c5d858b2db126e79c9e1b14f","README.md":"2fdb933b17e84901abbc50ff9fae053a6fb363b56b7093a26695c18863214c95","benches/decode.rs":"3a042e32cf987c6ffada205d2eea6f66c02958b92ed76c712a36a43dccddbd43","examples/explode.rs":"735ae5980aa9106cedbb42cc3a7e0af5dfa3d77c35ae142ab49f499e76cb07a2","src/common.rs":"f508c30cfb2c522f471b0bdc050695a36c75cd4f237eb99b372110de90ef9235","src/encoder.rs":"40ad8edf5ab7d2a8839803573ea490b7ba8ef8e8385a2cbaa25ad9e5bb5b23bf","src/lib.rs":"608807d94883524ed9f77a0c43fe378ab35ddba7f100337ae9c507581a3a731c","src/reader/decoder.rs":"991dd5f4d92973a0fe110340b8f9231e9608731205c1e88bdc6693b21f758189","src/reader/mod.rs":"c7b994431b0d0936f0728d3bf9b5c61195638eaebde75a8989587bbe37e7fd21","src/traits.rs":"0c39abb20949ca7615cb7a2340edd2aa5e6cec5686b013352d3736018dee4a94","tests/check_testimages.rs":"7c87cf697218bcf2d738451e1b8c28687df1c76b0b864fc0c41da1a8ef6a76e4","tests/crashtest.rs":"e22fbda43133ff1f0b2905a6e01dc5ddd854b817b0b28dbf798ade3eb84c8315","tests/decode.rs":"9985342b5fe581e099207e25ba67031fbb46cd9158b84799ab5e9bde23ead31a","tests/results.txt":"22e9d4c260cf8f52ae1388b5f10ed5f1aecf353701af4a1e221e6059ded2cb66","tests/roundtrip.rs":"33b60c224812a9a02a46c5af515a088aeb6222701706f374ed3391ff3c1d92f9"},"package":"5a668f699973d0f573d15749b7002a9ac9e1f9c6b220e7b165601334c173d8de"} \ No newline at end of file diff --git a/third_party/cargo/vendor/gif-0.11.1/BUILD.bazel b/third_party/cargo/vendor/gif-0.11.2/BUILD.bazel similarity index 75% rename from third_party/cargo/vendor/gif-0.11.1/BUILD.bazel rename to third_party/cargo/vendor/gif-0.11.2/BUILD.bazel index 62a65ce..d327d46 100644 --- a/third_party/cargo/vendor/gif-0.11.1/BUILD.bazel +++ b/third_party/cargo/vendor/gif-0.11.2/BUILD.bazel @@ -32,6 +32,8 @@ licenses([ # Unsupported target "decode" with type "bench" omitted +# Unsupported target "explode" with type "example" omitted + rust_library( name = "gif", srcs = glob(["**/*.rs"]), @@ -51,10 +53,18 @@ rust_library( "cargo-raze", "manual", ], - version = "0.11.1", + version = "0.11.2", # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/color_quant-1.1.0:color_quant", - "//third_party/cargo/vendor/weezl-0.1.3:weezl", + "//third_party/cargo/vendor/weezl-0.1.4:weezl", ], ) + +# Unsupported target "check_testimages" with type "test" omitted + +# Unsupported target "crashtest" with type "test" omitted + +# Unsupported target "decode" with type "test" omitted + +# Unsupported target "roundtrip" with type "test" omitted diff --git a/third_party/cargo/vendor/gif-0.11.2/Cargo.lock b/third_party/cargo/vendor/gif-0.11.2/Cargo.lock new file mode 100644 index 0000000..a0ab2e1 --- /dev/null +++ b/third_party/cargo/vendor/gif-0.11.2/Cargo.lock @@ -0,0 +1,646 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "bstr" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" +dependencies = [ + "lazy_static", + "memchr", + "regex-automata", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "cast" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" +dependencies = [ + "rustc_version", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "2.33.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +dependencies = [ + "bitflags", + "textwrap", + "unicode-width", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "criterion" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab327ed7354547cc2ef43cbe20ef68b988e70b4b593cbd66a2a61733123a3d23" +dependencies = [ + "atty", + "cast", + "clap", + "criterion-plot", + "csv", + "itertools 0.10.0", + "lazy_static", + "num-traits", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_cbor", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e022feadec601fba1649cfa83586381a4ad31c6bf3a9ab7d408118b05dd9889d" +dependencies = [ + "cast", + "itertools 0.9.0", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2584f639eb95fea8c798496315b297cf81b9b58b6d30ab066a75455333cf4b12" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "lazy_static", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" +dependencies = [ + "autocfg", + "cfg-if", + "lazy_static", +] + +[[package]] +name = "csv" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" +dependencies = [ + "bstr", + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +dependencies = [ + "memchr", +] + +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + +[[package]] +name = "gif" +version = "0.11.2" +dependencies = [ + "color_quant", + "criterion", + "glob", + "weezl", +] + +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + +[[package]] +name = "half" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3" + +[[package]] +name = "hermit-abi" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" +dependencies = [ + "libc", +] + +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" + +[[package]] +name = "js-sys" +version = "0.3.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc15e39392125075f60c95ba416f5381ff6c3a948ff02ab12464715adf56c821" +dependencies = [ + "wasm-bindgen", +] + +[[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.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba4aede83fc3617411dc6993bc8c70919750c1c257c6ca6a502aed6e0e2394ae" + +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "memchr" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" + +[[package]] +name = "memoffset" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "oorandom" +version = "11.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" + +[[package]] +name = "plotters" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45ca0ae5f169d0917a7c7f5a9c1a3d3d9598f18f529dd2b8373ed988efea307a" +dependencies = [ + "num-traits", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b07fffcddc1cb3a1de753caa4e4df03b79922ba43cf882acc1bdd7e8df9f4590" + +[[package]] +name = "plotters-svg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b38a02e23bd9604b842a812063aec4ef702b57989c37b655254bb61c471ad211" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "proc-macro2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rayon" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" +dependencies = [ + "autocfg", + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "lazy_static", + "num_cpus", +] + +[[package]] +name = "regex" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +dependencies = [ + "byteorder", +] + +[[package]] +name = "regex-syntax" +version = "0.6.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" + +[[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 = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "serde" +version = "1.0.124" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd761ff957cb2a45fbb9ab3da6512de9de55872866160b23c25f1a841e99d29f" + +[[package]] +name = "serde_cbor" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622" +dependencies = [ + "half", + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.124" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1800f7693e94e186f5e25a28291ae1570da908aff7d97a095dec1e56ff99069b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "syn" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fd9d1e9976102a03c542daa2eff1b43f9d72306342f3f8b3ed5fb8908195d6f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[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 = "unicode-width" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" + +[[package]] +name = "unicode-xid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" + +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fe8f61dba8e5d645a4d8132dc7a0a66861ed5e1045d2c0ed940fab33bac0fbe" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046ceba58ff062da072c7cb4ba5b22a37f00a302483f7e2a6cdc18fedbdc1fd3" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef9aa01d36cda046f797c57959ff5f3c615c9cc63997a8d545831ec7976819b" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96eb45c1b2ee33545a813a92dbb53856418bf7eb54ab34f7f7ff1448a5b3735d" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7148f4696fb4960a346eaa60bbfb42a1ac4ebba21f750f75fc1375b098d5ffa" + +[[package]] +name = "web-sys" +version = "0.3.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59fe19d70f5dacc03f6e46777213facae5ac3801575d56ca6cbd4c93dcd12310" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "weezl" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a32b378380f4e9869b22f0b5177c68a5519f03b3454fde0b291455ddbae266c" + +[[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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +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" diff --git a/third_party/cargo/vendor/gif-0.11.1/Cargo.toml b/third_party/cargo/vendor/gif-0.11.2/Cargo.toml similarity index 74% rename from third_party/cargo/vendor/gif-0.11.1/Cargo.toml rename to third_party/cargo/vendor/gif-0.11.2/Cargo.toml index e5bf448..ffef506 100644 --- a/third_party/cargo/vendor/gif-0.11.1/Cargo.toml +++ b/third_party/cargo/vendor/gif-0.11.2/Cargo.toml @@ -13,9 +13,9 @@ [package] edition = "2018" name = "gif" -version = "0.11.1" +version = "0.11.2" authors = ["nwin "] -exclude = ["tests/*", "benches/*.gif", "gif-afl/*"] +exclude = ["tests/crashtest/*", "tests/samples/*", "benches/*.gif", "gif-afl/*"] description = "GIF de- and encoder" homepage = "https://github.com/image-rs/image-gif" documentation = "https://docs.rs/gif" @@ -23,14 +23,31 @@ readme = "README.md" license = "MIT/Apache-2.0" repository = "https://github.com/image-rs/image-gif" +[[test]] +name = "check_testimages" +required-features = ["std"] + +[[test]] +name = "crashtest" +required-features = ["std"] + +[[test]] +name = "decode" +required-features = ["std"] + +[[test]] +name = "roundtrip" +required-features = ["std"] + [[bench]] name = "decode" harness = false +required-features = ["std"] [dependencies.color_quant] version = "1.0" [dependencies.weezl] -version = "0.1.0" +version = "0.1.4" [dev-dependencies.criterion] version = "0.3.1" diff --git a/third_party/cargo/vendor/gif-0.11.1/Changes.md b/third_party/cargo/vendor/gif-0.11.2/Changes.md similarity index 86% rename from third_party/cargo/vendor/gif-0.11.1/Changes.md rename to third_party/cargo/vendor/gif-0.11.2/Changes.md index 6f1e054..6eb3e83 100644 --- a/third_party/cargo/vendor/gif-0.11.1/Changes.md +++ b/third_party/cargo/vendor/gif-0.11.2/Changes.md @@ -1,3 +1,8 @@ +# v0.11.2 + +- Fix panic when LZW code size is invalid +- Added option to omit check for lzw end code + # v0.11.1 - Frames out-of-bounds of the screen descriptor are again accepted by default. diff --git a/third_party/cargo/vendor/gif-0.11.1/LICENSE-APACHE b/third_party/cargo/vendor/gif-0.11.2/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/gif-0.11.1/LICENSE-APACHE rename to third_party/cargo/vendor/gif-0.11.2/LICENSE-APACHE diff --git a/third_party/cargo/vendor/gif-0.11.1/LICENSE-MIT b/third_party/cargo/vendor/gif-0.11.2/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/gif-0.11.1/LICENSE-MIT rename to third_party/cargo/vendor/gif-0.11.2/LICENSE-MIT diff --git a/third_party/cargo/vendor/gif-0.11.1/README.md b/third_party/cargo/vendor/gif-0.11.2/README.md similarity index 84% rename from third_party/cargo/vendor/gif-0.11.1/README.md rename to third_party/cargo/vendor/gif-0.11.2/README.md index 86af3f7..3202b8d 100644 --- a/third_party/cargo/vendor/gif-0.11.1/README.md +++ b/third_party/cargo/vendor/gif-0.11.2/README.md @@ -1,4 +1,4 @@ -# GIF en- and decoding library [![Build Status](https://travis-ci.org/image-rs/image-gif.svg?branch=master)](https://travis-ci.org/image-rs/image-gif) +# GIF en- and decoding library [![Build Status](https://github.com/image-rs/image-gif/workflows/Rust%20CI/badge.svg)](https://github.com/image-rs/image-gif/actions) GIF en- and decoder written in Rust ([API Documentation](https://docs.rs/gif/)). @@ -9,7 +9,7 @@ This library provides all functions necessary to de- and encode GIF files. ## High level interface The high level interface consists of the two types -[`Encoder`](https://docs.rs/gif/0.10.1/gif/struct.Encoder.html) and [`Decoder`](https://docs.rs/gif/0.10.1/gif/struct.Decoder.html). +[`Encoder`](https://docs.rs/gif/*/gif/struct.Encoder.html) and [`Decoder`](https://docs.rs/gif/*/gif/struct.Decoder.html). ### Decoding GIF files @@ -65,7 +65,7 @@ for state in &beacon_states { } ``` -[`Frame::from_*`](https://docs.rs/gif/0.10.1/gif/struct.Frame.html) can be used to convert a true color image to a paletted +[`Frame::from_*`](https://docs.rs/gif/*/gif/struct.Frame.html) can be used to convert a true color image to a paletted image with a maximum of 256 colors: ```rust diff --git a/third_party/cargo/vendor/gif-0.11.1/benches/decode.rs b/third_party/cargo/vendor/gif-0.11.2/benches/decode.rs similarity index 100% rename from third_party/cargo/vendor/gif-0.11.1/benches/decode.rs rename to third_party/cargo/vendor/gif-0.11.2/benches/decode.rs diff --git a/third_party/cargo/vendor/gif-0.11.2/examples/explode.rs b/third_party/cargo/vendor/gif-0.11.2/examples/explode.rs new file mode 100644 index 0000000..caa3c34 --- /dev/null +++ b/third_party/cargo/vendor/gif-0.11.2/examples/explode.rs @@ -0,0 +1,44 @@ +//! Exports each GIF frame as a separate image. + +use std::env; +use std::fs::File; +use std::path::PathBuf; + +fn main() -> Result<(), Box> { + let input_path = PathBuf::from( + env::args_os() + .nth(1) + .ok_or("Specify a GIF path as the first argument")?, + ); + + let input = File::open(&input_path)?; + let mut options = gif::DecodeOptions::new(); + options.set_color_output(gif::ColorOutput::Indexed); + let mut decoder = options.read_info(input)?; + let screen_width = decoder.width(); + let screen_height = decoder.height(); + let global_pal = decoder.global_palette().unwrap_or_default().to_vec(); + + let output_file_stem = input_path.file_stem().unwrap().to_str().unwrap(); + let mut frame_number = 1; + while let Some(frame) = decoder.read_next_frame()? { + let output_path = format!("{}.{:03}.gif", output_file_stem, frame_number); + let mut output = File::create(&output_path)?; + let mut encoder = gif::Encoder::new(&mut output, screen_width, screen_height, &global_pal)?; + encoder.write_frame(&frame)?; + frame_number += 1; + + use gif::DisposalMethod::*; + let disposal = match frame.dispose { + Any => "any", + Keep => "keep", + Background => "background", + Previous => "previous", + }; + eprintln!( + "Written {} ({}x{}@{}x{} delay={} {})", + output_path, frame.width, frame.height, frame.top, frame.left, frame.delay, disposal + ); + } + Ok(()) +} diff --git a/third_party/cargo/vendor/gif-0.11.1/src/common.rs b/third_party/cargo/vendor/gif-0.11.2/src/common.rs similarity index 88% rename from third_party/cargo/vendor/gif-0.11.1/src/common.rs rename to third_party/cargo/vendor/gif-0.11.2/src/common.rs index 54fe7b6..c828b15 100644 --- a/third_party/cargo/vendor/gif-0.11.1/src/common.rs +++ b/third_party/cargo/vendor/gif-0.11.2/src/common.rs @@ -175,6 +175,12 @@ impl<'a> Default for Frame<'a> { impl Frame<'static> { /// Creates a frame from pixels in RGBA format. + /// + /// This is a lossy method. The `gif` format does not support arbitrary alpha but only a 1-bit + /// transparency mask per pixel. Any non-zero alpha value will be interpreted as a fully opaque + /// pixel. Additionally, only 256 colors can appear in a single frame. The palette will be + /// reduced by the NeuQuant algorithm if necessary. Different frames have independent palettes. + /// /// *Note: This method is not optimized for speed.* /// /// # Panics: @@ -184,10 +190,16 @@ impl Frame<'static> { } /// Creates a frame from pixels in RGBA format. + /// /// `speed` is a value in the range [1, 30]. /// The higher the value the faster it runs at the cost of image quality. /// A `speed` of 10 is a good compromise between speed and quality. /// + /// This is a lossy method. The `gif` format does not support arbitrary alpha but only a 1-bit + /// transparency mask per pixel. Any non-zero alpha value will be interpreted as a fully opaque + /// pixel. Additionally, only 256 colors can appear in a single frame. The palette will be + /// reduced by the NeuQuant algorithm if necessary. Different frames have independent palettes. + /// /// # Panics: /// * If the length of pixels does not equal `width * height * 4`. /// * If `speed < 1` or `speed > 30` @@ -258,6 +270,11 @@ impl Frame<'static> { } /// Creates a frame from pixels in RGB format. + /// + /// This is a lossy method. In the `gif` format only 256 colors can appear in a single frame. + /// The palette will be reduced by the NeuQuant algorithm if necessary. Different frames have + /// independent palettes. + /// /// *Note: This method is not optimized for speed.* /// /// # Panics: @@ -267,7 +284,13 @@ impl Frame<'static> { } /// Creates a frame from pixels in RGB format. + /// /// `speed` is a value in the range [1, 30]. + /// + /// This is a lossy method. In the `gif` format only 256 colors can appear in a single frame. + /// The palette will be reduced by the NeuQuant algorithm if necessary. Different frames have + /// independent palettes. + /// /// The higher the value the faster it runs at the cost of image quality. /// A `speed` of 10 is a good compromise between speed and quality. /// diff --git a/third_party/cargo/vendor/gif-0.11.1/src/encoder.rs b/third_party/cargo/vendor/gif-0.11.2/src/encoder.rs similarity index 99% rename from third_party/cargo/vendor/gif-0.11.1/src/encoder.rs rename to third_party/cargo/vendor/gif-0.11.2/src/encoder.rs index 08586e5..3a3ed5c 100644 --- a/third_party/cargo/vendor/gif-0.11.1/src/encoder.rs +++ b/third_party/cargo/vendor/gif-0.11.2/src/encoder.rs @@ -87,6 +87,7 @@ impl From for EncodingError { /// Number of repetitions +#[derive(Copy, Clone, Debug)] pub enum Repeat { /// Finite number of repetitions Finite(u16), diff --git a/third_party/cargo/vendor/gif-0.11.1/src/lib.rs b/third_party/cargo/vendor/gif-0.11.2/src/lib.rs similarity index 95% rename from third_party/cargo/vendor/gif-0.11.1/src/lib.rs rename to third_party/cargo/vendor/gif-0.11.2/src/lib.rs index 10eea92..0fbc783 100644 --- a/third_party/cargo/vendor/gif-0.11.1/src/lib.rs +++ b/third_party/cargo/vendor/gif-0.11.2/src/lib.rs @@ -1,4 +1,4 @@ -//! # GIF en- and decoding library [![Build Status](https://travis-ci.org/image-rs/image-gif.svg?branch=master)](https://travis-ci.org/image-rs/image-gif) +//! # GIF en- and decoding library [![Build Status](https://github.com/image-rs/image-gif/workflows/Rust%20CI/badge.svg)](https://github.com/image-rs/image-gif/actions) //! //! GIF en- and decoder written in Rust ([API Documentation](https://docs.rs/gif)). //! @@ -148,4 +148,4 @@ macro_rules! insert_as_doc { } // Provides the README.md as doc, to ensure the example works! -// insert_as_doc!(include_str!("../README.md")); +//insert_as_doc!(include_str!("../README.md")); diff --git a/third_party/cargo/vendor/gif-0.11.1/src/reader/decoder.rs b/third_party/cargo/vendor/gif-0.11.2/src/reader/decoder.rs similarity index 98% rename from third_party/cargo/vendor/gif-0.11.1/src/reader/decoder.rs rename to third_party/cargo/vendor/gif-0.11.2/src/reader/decoder.rs index 5755472..5b2cb30 100644 --- a/third_party/cargo/vendor/gif-0.11.1/src/reader/decoder.rs +++ b/third_party/cargo/vendor/gif-0.11.2/src/reader/decoder.rs @@ -192,6 +192,7 @@ pub struct StreamingDecoder { decode_buffer: Vec, skip_extensions: bool, check_frame_consistency: bool, + check_for_end_code: bool, version: &'static str, width: u16, height: u16, @@ -217,6 +218,7 @@ impl StreamingDecoder { decode_buffer: vec![], skip_extensions: true, check_frame_consistency: options.check_frame_consistency, + check_for_end_code: options.check_for_end_code, version: "", width: 0, height: 0, @@ -565,7 +567,6 @@ impl StreamingDecoder { "invalid minimal code size" )) } - // dbg!(code_size); self.lzw_reader = Some(LzwDecoder::new(BitOrder::Lsb, code_size)); goto!(DecodeSubBlock(b as usize), emit Decoded::Frame(self.current_frame_mut())) } @@ -603,7 +604,12 @@ impl StreamingDecoder { match decoded.status { Ok(LzwStatus::Done) | Ok(LzwStatus::Ok) => {}, Ok(LzwStatus::NoProgress) => { - return Err(io::Error::new(io::ErrorKind::InvalidData, "No end code in lzw stream").into()); + if self.check_for_end_code { + return Err(io::Error::new(io::ErrorKind::InvalidData, "No end code in lzw stream").into()); + } else { + self.current = None; + return goto!(0, FrameDecoded, emit Decoded::DataEnd); + } }, Err(err) => { return Err(io::Error::new(io::ErrorKind::InvalidData, &*format!("{:?}", err)).into()); diff --git a/third_party/cargo/vendor/gif-0.11.1/src/reader/mod.rs b/third_party/cargo/vendor/gif-0.11.2/src/reader/mod.rs similarity index 95% rename from third_party/cargo/vendor/gif-0.11.1/src/reader/mod.rs rename to third_party/cargo/vendor/gif-0.11.2/src/reader/mod.rs index 2ece66e..5b6e413 100644 --- a/third_party/cargo/vendor/gif-0.11.1/src/reader/mod.rs +++ b/third_party/cargo/vendor/gif-0.11.2/src/reader/mod.rs @@ -56,6 +56,7 @@ pub struct DecodeOptions { memory_limit: MemoryLimit, color_output: ColorOutput, check_frame_consistency: bool, + check_for_end_code: bool, } impl DecodeOptions { @@ -65,6 +66,7 @@ impl DecodeOptions { memory_limit: MemoryLimit(50_000_000), // 50 MB color_output: ColorOutput::Indexed, check_frame_consistency: false, + check_for_end_code: false, } } @@ -92,6 +94,21 @@ impl DecodeOptions { self.check_frame_consistency = check; } + /// Configure if LZW encoded blocks must end with a marker end code. + /// + /// The default is `false`. + /// + /// When turned on, all image data blocks—which are LZW encoded—must contain a special bit + /// sequence signalling the end of the data. LZW processing terminates when this code is + /// encountered. The specification states that it must be the last code output by the encoder + /// for an image. + /// + /// When turned off then image data blocks can simply end. Note that this might silently ignore + /// some bits of the last or second to last byte. + pub fn check_lzw_end_code(&mut self, check: bool) { + self.check_for_end_code = check; + } + /// Reads the logical screen descriptor including the global color palette /// /// Returns a `Decoder`. All decoder configuration has to be done beforehand. diff --git a/third_party/cargo/vendor/gif-0.11.1/src/traits.rs b/third_party/cargo/vendor/gif-0.11.2/src/traits.rs similarity index 100% rename from third_party/cargo/vendor/gif-0.11.1/src/traits.rs rename to third_party/cargo/vendor/gif-0.11.2/src/traits.rs diff --git a/third_party/cargo/vendor/gif-0.11.2/tests/check_testimages.rs b/third_party/cargo/vendor/gif-0.11.2/tests/check_testimages.rs new file mode 100644 index 0000000..89639f6 --- /dev/null +++ b/third_party/cargo/vendor/gif-0.11.2/tests/check_testimages.rs @@ -0,0 +1,170 @@ +extern crate gif; +extern crate glob; + +use std::collections::HashMap; +use std::fs::File; +use std::path::PathBuf; + +use std::io::BufReader; +use std::io::prelude::*; + +const BASE_PATH: [&'static str; 2] = [".", "tests"]; + +fn process_images(func: F) +where F: Fn(PathBuf) -> Result { + let base: PathBuf = BASE_PATH.iter().collect(); + let test_suites = &["samples"]; + let mut results = HashMap::new(); + let mut expected_failures = 0; + for suite in test_suites { + let mut path = base.clone(); + path.push(suite); + path.push("*.gif"); + let pattern = &*format!("{}", path.display()); + for path in glob::glob(pattern).unwrap().filter_map(Result::ok) { + print!("{:?}: ", path.clone()); + match func(path.clone()) { + Ok(crc) => { + results.insert(format!("{:?}", path), format!("{}", crc)); + println!("{}", crc) + }, + Err(_) if path.file_name().unwrap().to_str().unwrap().starts_with("x") => { + expected_failures += 1; + println!("Expected failure") + }, + err => panic!("{:?}", err) + } + } + } + let mut path = base.clone(); + path.push("results.txt"); + let mut ref_results = HashMap::new(); + let mut failures = 0; + for line in BufReader::new(File::open(path).unwrap()).lines() { + let line = line.unwrap(); + let parts: Vec<_> = line.split(": ").collect(); + if parts[1] == "Expected failure" { + failures += 1; + } else { + ref_results.insert(parts[0].to_string(), parts[1].to_string()); + } + } + assert_eq!(expected_failures, failures); + for (path, crc) in results.iter() { + assert_eq!( + ref_results.get(path).expect(&format!("reference for {:?} is missing", path)), + crc + ) + } +} + +#[test] +fn render_images() { + process_images(|path| { + let mut decoder = gif::DecodeOptions::new(); + decoder.set_color_output(gif::ColorOutput::RGBA); + let file = File::open(path)?; + let mut decoder = decoder.read_info(file)?; + let mut crc = Crc32::new(); + while let Some(frame) = decoder.read_next_frame()? { + // First sanity check: + assert_eq!( + frame.buffer.len(), + frame.width as usize + * frame.height as usize + * 4 + ); + crc.update(&*frame.buffer); + } + Ok(crc.checksum()) + }) +} + + +const CRC_TABLE: [u32; 256] = [ + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, + 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, + 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, + 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, + 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, + 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, + 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, + 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, + 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, + 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, + 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, + 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, + 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, + 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, + 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, + 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, + 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, + 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, + 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, + 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, + 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, + 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, + 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, + 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, + 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, + 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, + 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, + 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, + 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, + 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, + 0x2d02ef8d +]; + +/// Crc-32 checksum calculation +#[derive(Debug)] +pub struct Crc32 { + crc: u32, +} + +impl Crc32 { + /// Create a new hasher. + pub fn new() -> Crc32 { + Crc32 {crc: 0xFFFFFFFF} + } + + /// Resets the hasher. + pub fn reset(&mut self) { + *self = Self::new() + } + + /// Update the internal hasher with the bytes from ```buf``` + pub fn update(&mut self, buf: &[u8]) { + for &byte in buf { + let a = (self.crc ^ byte as u32) & 0xFF; + let b = self.crc >> 8; + + self.crc = CRC_TABLE[a as usize] ^ b; + } + } + + /// Return the computed hash. + pub fn checksum(&self) -> u32 { + self.crc ^ 0xFFFFFFFF + } +} diff --git a/third_party/cargo/vendor/gif-0.11.2/tests/crashtest.rs b/third_party/cargo/vendor/gif-0.11.2/tests/crashtest.rs new file mode 100644 index 0000000..ef67cb3 --- /dev/null +++ b/third_party/cargo/vendor/gif-0.11.2/tests/crashtest.rs @@ -0,0 +1,28 @@ +use std::{fs, io}; +use gif::DecodeOptions; + +#[test] +fn try_decode_crash_regression() { + let files = fs::read_dir(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/crashtest")).unwrap(); + let options = DecodeOptions::new(); + + for entry in files { + let entry = entry.unwrap(); + if let Some(ext) = entry.path().extension() { + if ext.to_str() != Some("gif") { + panic!("Unexpected file {} in crashtests, should end with .gif", entry.path().display()); + } + } else { + panic!("Unexpected file {} in crashtests, should end with .gif", entry.path().display()); + } + + let file_data = fs::read(entry.path()).unwrap(); + let _ = try_decode_file(&options, file_data); + } +} + +fn try_decode_file(options: &DecodeOptions, data: Vec) -> Result<(), gif::DecodingError> { + let mut reader = options.clone().read_info(io::Cursor::new(data))?; + while reader.read_next_frame()?.is_some() {} + Ok(()) +} diff --git a/third_party/cargo/vendor/gif-0.11.2/tests/decode.rs b/third_party/cargo/vendor/gif-0.11.2/tests/decode.rs new file mode 100644 index 0000000..6fc3aab --- /dev/null +++ b/third_party/cargo/vendor/gif-0.11.2/tests/decode.rs @@ -0,0 +1,84 @@ +use gif::{DecodeOptions, DisposalMethod, Encoder, Frame}; + +#[test] +fn frame_consistency_is_configurable() { + let image = create_image_with_oob_frames(); + + { + let options = DecodeOptions::new(); + let mut data = image.as_slice(); + let mut decoder = options.clone().read_info(&mut data).unwrap(); + assert!(decoder.read_next_frame().is_ok()); + assert!(decoder.read_next_frame().is_ok()); + } + + { + let mut options = DecodeOptions::new(); + options.check_frame_consistency(true); + let mut data = image.as_slice(); + let mut decoder = options.clone().read_info(&mut data).unwrap(); + assert!(decoder.read_next_frame().is_ok()); + assert!(decoder.read_next_frame().is_err()); + } + + { + let mut options = DecodeOptions::new(); + options.check_frame_consistency(false); + let mut data = image.as_slice(); + let mut decoder = options.clone().read_info(&mut data).unwrap(); + assert!(decoder.read_next_frame().is_ok()); + assert!(decoder.read_next_frame().is_ok()); + } +} + +fn create_image_with_oob_frames() -> Vec { + let mut data = vec![]; + let mut encoder = Encoder::new(&mut data, 2, 2, &[0, 0, 0]).unwrap(); + + let mut frame = Frame { + delay: 1, + dispose: DisposalMethod::Any, + transparent: None, + needs_user_input: false, + top: 0, + left: 0, + width: 2, + height: 2, + interlaced: false, + palette: None, + buffer: vec![0, 0, 0, 0].into(), + }; + + encoder.write_frame(&frame).unwrap(); + frame.top = 1; + frame.left = 1; + encoder.write_frame(&frame).unwrap(); + + drop(encoder); + data +} + +#[test] +fn check_for_end_code_is_configurable() { + // In this particular image, the image data of the 62nd frame has no end code. + let image: &[u8] = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/samples/gifplayer-muybridge.gif")); + + { + let options = DecodeOptions::new(); + let mut decoder = options.clone().read_info(&image[..]).unwrap(); + for _ in 0..61 { + assert!(decoder.read_next_frame().is_ok()); + } + assert!(decoder.read_next_frame().is_ok()); + } + + { + let mut options = DecodeOptions::new(); + options.check_lzw_end_code(true); + let mut decoder = options.clone().read_info(&image[..]).unwrap(); + for _ in 0..61 { + assert!(decoder.read_next_frame().is_ok()); + } + assert!(decoder.read_next_frame().is_err()); + } +} diff --git a/third_party/cargo/vendor/gif-0.11.2/tests/results.txt b/third_party/cargo/vendor/gif-0.11.2/tests/results.txt new file mode 100644 index 0000000..4dcd0ea --- /dev/null +++ b/third_party/cargo/vendor/gif-0.11.2/tests/results.txt @@ -0,0 +1,10 @@ +"tests/samples/alpha_gif_a.gif": 3871893825 +"tests/samples/anim-gr.gif": 291646878 +"tests/samples/beacon.gif": 2462153529 +"tests/samples/interlaced.gif": 2115495372 +"tests/samples/moon_impact.gif": 2438689726 +"tests/samples/sample_1.gif": 3275424619 +"tests/samples/2x2.gif": 3802149240 +"tests/samples/sample_big.gif": 4184562096 +"tests/samples/gifplayer-muybridge.gif": 4267078865 +"tests/samples/set_hsts.gif": 224161812 diff --git a/third_party/cargo/vendor/gif-0.11.2/tests/roundtrip.rs b/third_party/cargo/vendor/gif-0.11.2/tests/roundtrip.rs new file mode 100644 index 0000000..054ffa9 --- /dev/null +++ b/third_party/cargo/vendor/gif-0.11.2/tests/roundtrip.rs @@ -0,0 +1,55 @@ +use gif::{Decoder, Encoder, Frame}; + +#[test] +fn encode_roundtrip() { + const ORIGINAL: &'static [u8] = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/samples/2x2.gif")); + round_trip_from_image(ORIGINAL); +} + +fn round_trip_from_image(original: &[u8]) { + let (width, height, global_palette); + let frames: Vec = { + let mut decoder = Decoder::new(original).unwrap(); + width = decoder.width(); + height = decoder.height(); + global_palette = decoder + .global_palette() + .unwrap_or_default() + .to_vec(); + core::iter::from_fn(move || { + decoder.read_next_frame().unwrap().cloned() + }).collect() + }; + + let mut buffer = vec![]; + { + let mut encoder = Encoder::new(&mut buffer, width, height, &global_palette).unwrap(); + for frame in &frames { + encoder.write_frame(frame).unwrap(); + } + } + + { + let mut decoder = Decoder::new(&buffer[..]).expect("Invalid info encoded"); + assert_eq!(decoder.width(), width); + assert_eq!(decoder.height(), height); + assert_eq!(global_palette, decoder.global_palette().unwrap_or_default()); + let new_frames: Vec<_> = core::iter::from_fn(move || { + decoder.read_next_frame().unwrap().cloned() + }).collect(); + assert_eq!(new_frames.len(), frames.len(), "Diverging number of frames"); + for (new, reference) in new_frames.iter().zip(&frames) { + assert_eq!(new.delay, reference.delay); + assert_eq!(new.dispose, reference.dispose); + assert_eq!(new.transparent, reference.transparent); + assert_eq!(new.needs_user_input, reference.needs_user_input); + assert_eq!(new.top, reference.top); + assert_eq!(new.left, reference.left); + assert_eq!(new.width, reference.width); + assert_eq!(new.height, reference.height); + assert_eq!(new.interlaced, reference.interlaced); + assert_eq!(new.palette, reference.palette); + assert_eq!(new.buffer, reference.buffer); + } + } +} diff --git a/third_party/cargo/vendor/half-1.6.0/.cargo-checksum.json b/third_party/cargo/vendor/half-1.6.0/.cargo-checksum.json deleted file mode 100644 index 54419fa..0000000 --- a/third_party/cargo/vendor/half-1.6.0/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"CHANGELOG.md":"041a3a9e2de8d49834819183c77d45c246fef1714e40af3c043792d0e48c5f1c","Cargo.toml":"fff24bbc7fca14e1bff25cf9b53ef6351c3cb91e27f7cc9f9e3dd3570f0a643d","LICENSE-APACHE":"c144680885b29e4719e2a51f0aab5439a1e02d980692b5aaf086cae12727f28b","LICENSE-MIT":"54c0366c7f8643c8502618e7f02b4176f28c834a6b0315b969477720b65e183f","README.md":"a28ac0d5763a5b229a3f4f533f732a2d7bc91fbde44f062e750a632734c3d40f","appveyor.yml":"0cb2779da07ddbfb85f905f972017bc8f5fba8bc6575134d90e36cf5672046ac","benches/convert.rs":"eb47a49fd607b3ac07f620c41a1aa37c8492dd907ea408692b58e814fed27848","src/bfloat.rs":"78540b49248728f93f25dac07d9df705efc77ddf4c6942bd026080189fbc94bf","src/bfloat/convert.rs":"e41be00501e9f416ab48daba2a98dd73f3e5ababb44a8d24ca3b52d25b76ce44","src/binary16.rs":"adb5f62da29bab7ed8283d3e3f415d1802eefa09347762f893122e054fa4a3bf","src/binary16/convert.rs":"85a9e4b670a3043746365c443a1546333a160ae2a9312f0e64863a21b547ee00","src/lib.rs":"256e03f246516ae9513b3684ffd6ca89729838e8beca831bc11218286c9a4d8e","src/slice.rs":"14b29e28dac3aea172f7964f7f659a1cc85c4e7e51d06961768e82f79a76c1fe","src/vec.rs":"dd902e515126a71cfc5892c3cb0361c2a85874f22d3646fbd433098db73f2a96","tests/version-numbers.rs":"6a9cf4ddc12121a8926897a5abca44efbd137f4e0a0def171d18395e853c647a"},"package":"d36fab90f82edc3c747f9d438e06cf0a491055896f2a279638bb5beed6c40177"} \ No newline at end of file diff --git a/third_party/cargo/vendor/half-1.6.0/appveyor.yml b/third_party/cargo/vendor/half-1.6.0/appveyor.yml deleted file mode 100644 index 5147453..0000000 --- a/third_party/cargo/vendor/half-1.6.0/appveyor.yml +++ /dev/null @@ -1,156 +0,0 @@ -# Appveyor configuration template for Rust using rustup for Rust installation -# https://github.com/starkat99/appveyor-rust - -branches: - except: - - gh-pages - -## Operating System (VM environment) ## - -# Rust needs at least Visual Studio 2013 Appveyor OS for MSVC targets. -os: Visual Studio 2015 - -## Build Matrix ## - -# This configuration will setup a build for each channel & target combination (12 windows -# combinations in all). -# -# There are 3 channels: stable, beta, and nightly. -# -# Alternatively, the full version may be specified for the channel to build using that specific -# version (e.g. channel: 1.5.0) -# -# The values for target are the set of windows Rust build targets. Each value is of the form -# -# ARCH-pc-windows-TOOLCHAIN -# -# Where ARCH is the target architecture, either x86_64 or i686, and TOOLCHAIN is the linker -# toolchain to use, either msvc or gnu. See https://www.rust-lang.org/downloads.html#win-foot for -# a description of the toolchain differences. -# See https://github.com/rust-lang-nursery/rustup.rs/#toolchain-specification for description of -# toolchains and host triples. -# -# Comment out channel/target combos you do not wish to build in CI. -# -# You may use the `cargoflags` and `RUSTFLAGS` variables to set additional flags for cargo commands -# and rustc, respectively. For instance, you can uncomment the cargoflags lines in the nightly -# channels to enable unstable features when building for nightly. Or you could add additional -# matrix entries to test different combinations of features. -environment: - matrix: - ### MSVC Toolchains ### - - # Stable 64-bit MSVC - - channel: stable - target: x86_64-pc-windows-msvc - # Stable 32-bit MSVC - - channel: stable - target: i686-pc-windows-msvc - # Stable 64-bit MSVC w/ optional features - - channel: stable - target: x86_64-pc-windows-msvc - cargoflags: --features "std serde" - # Stable 64-bit MSVC w/ optional features - - channel: stable - target: x86_64-pc-windows-msvc - cargoflags: --features "alloc" - # Stable 32-bit MSVC w/ optional features - - channel: stable - target: i686-pc-windows-msvc - cargoflags: --features "std serde" - # Stable 32-bit MSVC w/ optional features - - channel: stable - target: i686-pc-windows-msvc - cargoflags: --features "alloc" - # Beta 64-bit MSVC - - channel: beta - target: x86_64-pc-windows-msvc - # Beta 32-bit MSVC - - channel: beta - target: i686-pc-windows-msvc - # Nightly 64-bit MSVC w/ nightly features - - channel: nightly - target: x86_64-pc-windows-msvc - cargoflags: --features "use-intrinsics" - # Nightly 32-bit MSVC w/ nightly features - - channel: nightly - target: i686-pc-windows-msvc - cargoflags: --features "use-intrinsics" - - ### GNU Toolchains ### - - # Stable 64-bit GNU - - channel: stable - target: x86_64-pc-windows-gnu - # Stable 32-bit GNU - - channel: stable - target: i686-pc-windows-gnu - # Stable 64-bit GNU w/ optional features - - channel: stable - target: x86_64-pc-windows-gnu - cargoflags: --features "std serde" - # Stable 64-bit GNU w/ optional features - - channel: stable - target: x86_64-pc-windows-gnu - cargoflags: --features "alloc" - # Stable 32-bit GNU w/ optional features - - channel: stable - target: i686-pc-windows-gnu - cargoflags: --features "std serde" - # Stable 32-bit GNU w/ optional features - - channel: stable - target: i686-pc-windows-gnu - cargoflags: --features "alloc" - # Beta 64-bit GNU - - channel: beta - target: x86_64-pc-windows-gnu - # Beta 32-bit GNU - - channel: beta - target: i686-pc-windows-gnu - # Nightly 64-bit GNU w/ nightly features - - channel: nightly - target: x86_64-pc-windows-gnu - cargoflags: --features "use-intrinsics" - # Nightly 32-bit GNU w/ nightly features - - channel: nightly - target: i686-pc-windows-gnu - cargoflags: --features "use-intrinsics" - -### Allowed failures ### - -# See Appveyor documentation for specific details. In short, place any channel or targets you wish -# to allow build failures on (usually nightly at least is a wise choice). This will prevent a build -# or test failure in the matching channels/targets from failing the entire build. -#matrix: -# allow_failures: -# - channel: nightly - -# If you only care about stable channel build failures, uncomment the following line: -#- channel: beta - -## Install Script ## - -# This is the most important part of the Appveyor configuration. This installs the version of Rust -# specified by the 'channel' and 'target' environment variables from the build matrix. This uses -# rustup to install Rust. -# -# For simple configurations, instead of using the build matrix, you can simply set the -# default-toolchain and default-host manually here. -install: - - appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe - - rustup-init -yv --default-toolchain %channel% --default-host %target% - - set PATH=%PATH%;%USERPROFILE%\.cargo\bin - - rustc -vV - - cargo -vV - -## Build Script ## - -# 'cargo test' takes care of building for us, so disable Appveyor's build stage. This prevents -# the "directory does not contain a project or solution file" error. -build: false - -# Uses 'cargo test' to run tests and build. Alternatively, the project may call compiled programs -#directly or perform other testing commands. Rust will automatically be placed in the PATH -# environment variable. -test_script: - - cargo test --verbose %cargoflags% diff --git a/third_party/cargo/vendor/half-1.7.1/.cargo-checksum.json b/third_party/cargo/vendor/half-1.7.1/.cargo-checksum.json new file mode 100644 index 0000000..447a878 --- /dev/null +++ b/third_party/cargo/vendor/half-1.7.1/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"7ff5673722a23617f48d376aa51afb6d9112bb8eab2b3de6d515ec8c9a3f6c0a","Cargo.toml":"ce80cb7053e91678531305ce421cbbab48593a239c452c1e2bc593676cef3d81","LICENSE-APACHE":"c144680885b29e4719e2a51f0aab5439a1e02d980692b5aaf086cae12727f28b","LICENSE-MIT":"54c0366c7f8643c8502618e7f02b4176f28c834a6b0315b969477720b65e183f","README.md":"4aca7034e3778045f8dffdf797a08c4d44fb6f6966b9fc05a030a703a8d4c030","benches/convert.rs":"eb47a49fd607b3ac07f620c41a1aa37c8492dd907ea408692b58e814fed27848","src/bfloat.rs":"09e530d071ff8a8e15ae9c6e509a2e7e63a8be5dbea5891fb7c4ab04a0bb34dd","src/bfloat/convert.rs":"e41be00501e9f416ab48daba2a98dd73f3e5ababb44a8d24ca3b52d25b76ce44","src/binary16.rs":"de3a5cb8242f921532dfea8211a34eba234a098d5f6ef61ceac2345a0327da6f","src/binary16/convert.rs":"85a9e4b670a3043746365c443a1546333a160ae2a9312f0e64863a21b547ee00","src/lib.rs":"8fc7305100ed655257ce55998592c07b1f69918940fe692002915f7ee8b63c19","src/slice.rs":"14b29e28dac3aea172f7964f7f659a1cc85c4e7e51d06961768e82f79a76c1fe","src/vec.rs":"dd902e515126a71cfc5892c3cb0361c2a85874f22d3646fbd433098db73f2a96","tests/version-numbers.rs":"6a9cf4ddc12121a8926897a5abca44efbd137f4e0a0def171d18395e853c647a"},"package":"62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3"} \ No newline at end of file diff --git a/third_party/cargo/vendor/half-1.6.0/BUILD.bazel b/third_party/cargo/vendor/half-1.7.1/BUILD.bazel similarity index 98% rename from third_party/cargo/vendor/half-1.6.0/BUILD.bazel rename to third_party/cargo/vendor/half-1.7.1/BUILD.bazel index a501ddf..399fa41 100644 --- a/third_party/cargo/vendor/half-1.6.0/BUILD.bazel +++ b/third_party/cargo/vendor/half-1.7.1/BUILD.bazel @@ -48,7 +48,7 @@ rust_library( "cargo-raze", "manual", ], - version = "1.6.0", + version = "1.7.1", # buildifier: leave-alone deps = [ ], diff --git a/third_party/cargo/vendor/half-1.6.0/CHANGELOG.md b/third_party/cargo/vendor/half-1.7.1/CHANGELOG.md similarity index 87% rename from third_party/cargo/vendor/half-1.6.0/CHANGELOG.md rename to third_party/cargo/vendor/half-1.7.1/CHANGELOG.md index 3488747..490cb6d 100644 --- a/third_party/cargo/vendor/half-1.6.0/CHANGELOG.md +++ b/third_party/cargo/vendor/half-1.7.1/CHANGELOG.md @@ -5,6 +5,23 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [1.7.1] - 2021-01-17 +### Fixed +- Docs.rs now generates docs for `bytemuck` and `num-traits` optional features. + +## [1.7.0] - 2021-01-17 +### Added +- Added optional implementations of `bytemuck` traits `Zeroable` and `Pod` under `bytemuck` cargo + feature. By [@charles-r-earp]. +- Added optional implementations of `num-traits` traits `ToPrimitive` and `FromPrimitive` under + `num-traits` cargo feature. By [@charles-r-earp]. +- Added implementations of `Binary`, `Octal`, `LowerHex`, and `UpperHex` string format traits to + format raw `f16`/`bf16` bytes to string. + +### Changed +- `Debug` trait implementation now formats `f16`/`bf16` as float instead of raw bytes hex. Use newly + implemented formatting traits to format in hex instead of `Debug`. Fixes [#37]. + ## [1.6.0] - 2020-05-09 ### Added @@ -145,6 +162,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. [#16]: https://github.com/starkat99/half-rs/issues/16 [#23]: https://github.com/starkat99/half-rs/issues/23 [#24]: https://github.com/starkat99/half-rs/issues/24 +[#37]: https://github.com/starkat99/half-rs/issues/37 [@tspiteri]: https://github.com/tspiteri [@PSeitz]: https://github.com/PSeitz @@ -153,9 +171,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. [@jfrimmel]: https://github.com/jfrimmel [@zserik]: https://github.com/zserik [@bzm3r]: https://github.com/bzm3r +[@charles-r-earp]: https://github.com/charles-r-earp -[Unreleased]: https://github.com/starkat99/half-rs/compare/v1.6.0...HEAD +[Unreleased]: https://github.com/starkat99/half-rs/compare/v1.7.1...HEAD +[1.7.1]: https://github.com/starkat99/half-rs/compare/v1.7.0...v1.7.1 +[1.7.0]: https://github.com/starkat99/half-rs/compare/v1.6.0...v1.7.0 [1.6.0]: https://github.com/starkat99/half-rs/compare/v1.5.0...v1.6.0 [1.5.0]: https://github.com/starkat99/half-rs/compare/v1.4.1...v1.5.0 [1.4.1]: https://github.com/starkat99/half-rs/compare/v1.4.0...v1.4.1 diff --git a/third_party/cargo/vendor/half-1.6.0/Cargo.toml b/third_party/cargo/vendor/half-1.7.1/Cargo.toml similarity index 84% rename from third_party/cargo/vendor/half-1.6.0/Cargo.toml rename to third_party/cargo/vendor/half-1.7.1/Cargo.toml index c122803..73f965d 100644 --- a/third_party/cargo/vendor/half-1.6.0/Cargo.toml +++ b/third_party/cargo/vendor/half-1.7.1/Cargo.toml @@ -13,8 +13,9 @@ [package] edition = "2018" name = "half" -version = "1.6.0" +version = "1.7.1" authors = ["Kathryn Long "] +exclude = ["/ci", "/*.yml"] description = "Half-precision floating point f16 and bf16 types for Rust implementing the IEEE 754-2008 standard binary16 and bfloat16 types." readme = "README.md" keywords = ["f16", "bfloat16", "no_std"] @@ -22,11 +23,22 @@ categories = ["no-std", "data-structures", "encoding"] license = "MIT/Apache-2.0" repository = "https://github.com/starkat99/half-rs" [package.metadata.docs.rs] -features = ["std", "serde"] +features = ["std", "serde", "bytemuck", "num-traits"] [[bench]] name = "convert" harness = false +[dependencies.bytemuck] +version = "1.4.1" +features = ["derive"] +optional = true +default-features = false + +[dependencies.num-traits] +version = "0.2.14" +optional = true +default-features = false + [dependencies.serde] version = "1.0" features = ["derive"] diff --git a/third_party/cargo/vendor/half-1.6.0/LICENSE-APACHE b/third_party/cargo/vendor/half-1.7.1/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/half-1.6.0/LICENSE-APACHE rename to third_party/cargo/vendor/half-1.7.1/LICENSE-APACHE diff --git a/third_party/cargo/vendor/half-1.6.0/LICENSE-MIT b/third_party/cargo/vendor/half-1.7.1/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/half-1.6.0/LICENSE-MIT rename to third_party/cargo/vendor/half-1.7.1/LICENSE-MIT diff --git a/third_party/cargo/vendor/half-1.6.0/README.md b/third_party/cargo/vendor/half-1.7.1/README.md similarity index 92% rename from third_party/cargo/vendor/half-1.6.0/README.md rename to third_party/cargo/vendor/half-1.7.1/README.md index 8de9417..c6afe22 100644 --- a/third_party/cargo/vendor/half-1.6.0/README.md +++ b/third_party/cargo/vendor/half-1.7.1/README.md @@ -13,7 +13,7 @@ minimal floating point storage and most major hardware does not implement them, This crate provides [`no_std`](https://rust-embedded.github.io/book/intro/no-std.html) support by default so can easily be used in embedded code where a smaller float format is most useful. -*Requries Rust 1.32 or greater.* If you need support for older versions of Rust, use versions 1.3 and earlier of this crate. +*Requires Rust 1.32 or greater.* If you need support for older versions of Rust, use versions 1.3 and earlier of this crate. See the [crate documentation](https://docs.rs/half/) for more details. @@ -36,6 +36,11 @@ not have hardware support. **Available only on Rust nightly channel.** Enabling the `std` feature enables runtime CPU feature detection when the `use-intrsincis` feature is also enabled. Without this feature detection, intrinsics are only used when compiler host target supports them. +- **`num-traits`** - Enable `ToPrimitive` and `FromPrimitive` trait implementations from the + `num-traits` crate. + +- **`bytemuck`** - Enable `Zeroable` and `Pod` trait implementations from the `bytemuck` crate. + ### More Documentation - [Crate API Reference](https://docs.rs/half/) diff --git a/third_party/cargo/vendor/half-1.6.0/benches/convert.rs b/third_party/cargo/vendor/half-1.7.1/benches/convert.rs similarity index 100% rename from third_party/cargo/vendor/half-1.6.0/benches/convert.rs rename to third_party/cargo/vendor/half-1.7.1/benches/convert.rs diff --git a/third_party/cargo/vendor/half-1.6.0/src/bfloat.rs b/third_party/cargo/vendor/half-1.7.1/src/bfloat.rs similarity index 92% rename from third_party/cargo/vendor/half-1.6.0/src/bfloat.rs rename to third_party/cargo/vendor/half-1.7.1/src/bfloat.rs index 09ad035..8d659f7 100644 --- a/third_party/cargo/vendor/half-1.6.0/src/bfloat.rs +++ b/third_party/cargo/vendor/half-1.7.1/src/bfloat.rs @@ -1,9 +1,14 @@ #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; +#[cfg(feature = "bytemuck")] +use bytemuck::{Pod, Zeroable}; + use core::{ cmp::Ordering, - fmt::{Debug, Display, Error, Formatter, LowerExp, UpperExp}, + fmt::{ + Binary, Debug, Display, Error, Formatter, LowerExp, LowerHex, Octal, UpperExp, UpperHex, + }, num::{FpCategory, ParseFloatError}, str::FromStr, }; @@ -28,6 +33,7 @@ pub(crate) mod convert; #[derive(Clone, Copy, Default)] #[repr(transparent)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "bytemuck", derive(Zeroable, Pod))] pub struct bf16(u16); impl bf16 { @@ -593,7 +599,7 @@ impl FromStr for bf16 { impl Debug for bf16 { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { - write!(f, "0x{:X}", self.0) + write!(f, "{:?}", self.to_f32()) } } @@ -615,6 +621,102 @@ impl UpperExp for bf16 { } } +impl Binary for bf16 { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { + write!(f, "{:b}", self.0) + } +} + +impl Octal for bf16 { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { + write!(f, "{:o}", self.0) + } +} + +impl LowerHex for bf16 { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { + write!(f, "{:x}", self.0) + } +} + +impl UpperHex for bf16 { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { + write!(f, "{:X}", self.0) + } +} + +#[cfg(feature = "num-traits")] +mod impl_num_traits { + use super::bf16; + use num_traits::{FromPrimitive, ToPrimitive}; + + impl ToPrimitive for bf16 { + fn to_i64(&self) -> Option { + Self::to_f32(*self).to_i64() + } + fn to_u64(&self) -> Option { + Self::to_f32(*self).to_u64() + } + fn to_i8(&self) -> Option { + Self::to_f32(*self).to_i8() + } + fn to_u8(&self) -> Option { + Self::to_f32(*self).to_u8() + } + fn to_i16(&self) -> Option { + Self::to_f32(*self).to_i16() + } + fn to_u16(&self) -> Option { + Self::to_f32(*self).to_u16() + } + fn to_i32(&self) -> Option { + Self::to_f32(*self).to_i32() + } + fn to_u32(&self) -> Option { + Self::to_f32(*self).to_u32() + } + fn to_f32(&self) -> Option { + Some(Self::to_f32(*self)) + } + fn to_f64(&self) -> Option { + Some(Self::to_f64(*self)) + } + } + + impl FromPrimitive for bf16 { + fn from_i64(n: i64) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_u64(n: u64) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_i8(n: i8) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_u8(n: u8) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_i16(n: i16) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_u16(n: u16) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_i32(n: i32) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_u32(n: u32) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_f32(n: f32) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_f64(n: f64) -> Option { + n.to_f64().map(|x| Self::from_f64(x)) + } + } +} + #[allow( clippy::cognitive_complexity, clippy::float_cmp, diff --git a/third_party/cargo/vendor/half-1.6.0/src/bfloat/convert.rs b/third_party/cargo/vendor/half-1.7.1/src/bfloat/convert.rs similarity index 100% rename from third_party/cargo/vendor/half-1.6.0/src/bfloat/convert.rs rename to third_party/cargo/vendor/half-1.7.1/src/bfloat/convert.rs diff --git a/third_party/cargo/vendor/half-1.6.0/src/binary16.rs b/third_party/cargo/vendor/half-1.7.1/src/binary16.rs similarity index 94% rename from third_party/cargo/vendor/half-1.6.0/src/binary16.rs rename to third_party/cargo/vendor/half-1.7.1/src/binary16.rs index d5164f0..59ef1dc 100644 --- a/third_party/cargo/vendor/half-1.6.0/src/binary16.rs +++ b/third_party/cargo/vendor/half-1.7.1/src/binary16.rs @@ -1,9 +1,14 @@ #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; +#[cfg(feature = "bytemuck")] +use bytemuck::{Pod, Zeroable}; + use core::{ cmp::Ordering, - fmt::{Debug, Display, Error, Formatter, LowerExp, UpperExp}, + fmt::{ + Binary, Debug, Display, Error, Formatter, LowerExp, LowerHex, Octal, UpperExp, UpperHex, + }, num::{FpCategory, ParseFloatError}, str::FromStr, }; @@ -25,8 +30,81 @@ pub(crate) mod convert; #[derive(Clone, Copy, Default)] #[repr(transparent)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "bytemuck", derive(Zeroable, Pod))] pub struct f16(u16); +#[cfg(feature = "num-traits")] +mod impl_num_traits { + use super::f16; + use num_traits::{FromPrimitive, ToPrimitive}; + + impl ToPrimitive for f16 { + fn to_i64(&self) -> Option { + Self::to_f32(*self).to_i64() + } + fn to_u64(&self) -> Option { + Self::to_f32(*self).to_u64() + } + fn to_i8(&self) -> Option { + Self::to_f32(*self).to_i8() + } + fn to_u8(&self) -> Option { + Self::to_f32(*self).to_u8() + } + fn to_i16(&self) -> Option { + Self::to_f32(*self).to_i16() + } + fn to_u16(&self) -> Option { + Self::to_f32(*self).to_u16() + } + fn to_i32(&self) -> Option { + Self::to_f32(*self).to_i32() + } + fn to_u32(&self) -> Option { + Self::to_f32(*self).to_u32() + } + fn to_f32(&self) -> Option { + Some(Self::to_f32(*self)) + } + fn to_f64(&self) -> Option { + Some(Self::to_f64(*self)) + } + } + + impl FromPrimitive for f16 { + fn from_i64(n: i64) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_u64(n: u64) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_i8(n: i8) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_u8(n: u8) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_i16(n: i16) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_u16(n: u16) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_i32(n: i32) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_u32(n: u32) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_f32(n: f32) -> Option { + n.to_f32().map(|x| Self::from_f32(x)) + } + fn from_f64(n: f64) -> Option { + n.to_f64().map(|x| Self::from_f64(x)) + } + } +} + #[deprecated( since = "1.4.0", note = "all constants moved to associated constants of [`f16`](../struct.f16.html)" @@ -830,7 +908,7 @@ impl FromStr for f16 { impl Debug for f16 { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { - write!(f, "0x{:X}", self.0) + write!(f, "{:?}", self.to_f32()) } } @@ -852,6 +930,30 @@ impl UpperExp for f16 { } } +impl Binary for f16 { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { + write!(f, "{:b}", self.0) + } +} + +impl Octal for f16 { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { + write!(f, "{:o}", self.0) + } +} + +impl LowerHex for f16 { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { + write!(f, "{:x}", self.0) + } +} + +impl UpperHex for f16 { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { + write!(f, "{:X}", self.0) + } +} + #[allow( clippy::cognitive_complexity, clippy::float_cmp, diff --git a/third_party/cargo/vendor/half-1.6.0/src/binary16/convert.rs b/third_party/cargo/vendor/half-1.7.1/src/binary16/convert.rs similarity index 100% rename from third_party/cargo/vendor/half-1.6.0/src/binary16/convert.rs rename to third_party/cargo/vendor/half-1.7.1/src/binary16/convert.rs diff --git a/third_party/cargo/vendor/half-1.6.0/src/lib.rs b/third_party/cargo/vendor/half-1.7.1/src/lib.rs similarity index 91% rename from third_party/cargo/vendor/half-1.6.0/src/lib.rs rename to third_party/cargo/vendor/half-1.7.1/src/lib.rs index de35758..3f24662 100644 --- a/third_party/cargo/vendor/half-1.6.0/src/lib.rs +++ b/third_party/cargo/vendor/half-1.7.1/src/lib.rs @@ -29,6 +29,9 @@ //! //! Support for [`serde`] crate `Serialize` and `Deserialize` traits is provided when the `serde` //! feature is enabled. This adds a dependency on [`serde`] crate so is an optional cargo feature. +//! Support for [`bytemuck`] crate `Zeroable` and `Pod` traits is provided with the `bytemuck` +//! feature. Support for the [`num-traits`] crate `ToPrimitive` and `FromPrimitive` traits is +//! provided with the `num-traits` feature. //! //! The crate uses `#[no_std]` by default, so can be used in embedded environments without using the //! Rust `std` library. A `std` feature is available, which enables additional utilities using the @@ -43,6 +46,8 @@ //! [`slice`]: slice/index.html //! [`prelude`]: prelude/index.html //! [`serde`]: https://crates.io/crates/serde +//! [`bytemuck`]: https://crates.io/crates/bytemuck +//! [`num-traits`]: https://crates.io/crates/num-traits //! [`vec`]: vec/index.html #![warn( @@ -66,7 +71,7 @@ ), feature(stdsimd, f16c_target_feature) )] -#![doc(html_root_url = "https://docs.rs/half/1.6.0")] +#![doc(html_root_url = "https://docs.rs/half/1.7.1")] #[cfg(all(feature = "alloc", not(feature = "std")))] extern crate alloc; diff --git a/third_party/cargo/vendor/half-1.6.0/src/slice.rs b/third_party/cargo/vendor/half-1.7.1/src/slice.rs similarity index 100% rename from third_party/cargo/vendor/half-1.6.0/src/slice.rs rename to third_party/cargo/vendor/half-1.7.1/src/slice.rs diff --git a/third_party/cargo/vendor/half-1.6.0/src/vec.rs b/third_party/cargo/vendor/half-1.7.1/src/vec.rs similarity index 100% rename from third_party/cargo/vendor/half-1.6.0/src/vec.rs rename to third_party/cargo/vendor/half-1.7.1/src/vec.rs diff --git a/third_party/cargo/vendor/half-1.6.0/tests/version-numbers.rs b/third_party/cargo/vendor/half-1.7.1/tests/version-numbers.rs similarity index 100% rename from third_party/cargo/vendor/half-1.6.0/tests/version-numbers.rs rename to third_party/cargo/vendor/half-1.7.1/tests/version-numbers.rs diff --git a/third_party/cargo/vendor/hermit-abi-0.1.17/.cargo-checksum.json b/third_party/cargo/vendor/hermit-abi-0.1.18/.cargo-checksum.json similarity index 51% rename from third_party/cargo/vendor/hermit-abi-0.1.17/.cargo-checksum.json rename to third_party/cargo/vendor/hermit-abi-0.1.18/.cargo-checksum.json index 0923578..2e5929f 100644 --- a/third_party/cargo/vendor/hermit-abi-0.1.17/.cargo-checksum.json +++ b/third_party/cargo/vendor/hermit-abi-0.1.18/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"57aa1eca2149cce3353a30c54f3811d9de010e84ead178d329f42a4c545fe5dc","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"322fadd63e558e5a10caf980cbedf83ac1546ba40fd992f54492e21ce54205af","rust-toolchain":"58bea07cb6d97f9cfcd5c8f98b1feca0fb81cce5b0bf29a8e70ed2641956e9a6","src/lib.rs":"410a9e2bc99747c9613058cff1c362dc2d3d94a8f8cf4107f98b4c3901cef241","src/tcplistener.rs":"c6e2db06d4265fa0956851e1c965336d60c53ab21573729aae76ecfe0ccc84c3","src/tcpstream.rs":"38a17de54213faf9de217f6146ff86ee75b67d4404a532b1419903269200936b"},"package":"5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8"} \ No newline at end of file +{"files":{"Cargo.toml":"6cd0350a8b7cf5f825b88b1cafc7a5e71781d91dc1c2e57646d909c689e9afed","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"322fadd63e558e5a10caf980cbedf83ac1546ba40fd992f54492e21ce54205af","rust-toolchain":"58bea07cb6d97f9cfcd5c8f98b1feca0fb81cce5b0bf29a8e70ed2641956e9a6","src/lib.rs":"1fe7da738cb27c5c0941f6d4079bac8eb3e81da2aeb71fcfb81e37584fddaad7","src/tcplistener.rs":"c6e2db06d4265fa0956851e1c965336d60c53ab21573729aae76ecfe0ccc84c3","src/tcpstream.rs":"38a17de54213faf9de217f6146ff86ee75b67d4404a532b1419903269200936b"},"package":"322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c"} \ No newline at end of file diff --git a/third_party/cargo/vendor/hermit-abi-0.1.17/BUILD.bazel b/third_party/cargo/vendor/hermit-abi-0.1.18/BUILD.bazel similarity index 92% rename from third_party/cargo/vendor/hermit-abi-0.1.17/BUILD.bazel rename to third_party/cargo/vendor/hermit-abi-0.1.18/BUILD.bazel index 606ac1a..be504a1 100644 --- a/third_party/cargo/vendor/hermit-abi-0.1.17/BUILD.bazel +++ b/third_party/cargo/vendor/hermit-abi-0.1.18/BUILD.bazel @@ -47,9 +47,9 @@ rust_library( "cargo-raze", "manual", ], - version = "0.1.17", + version = "0.1.18", # buildifier: leave-alone deps = [ - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ], ) diff --git a/third_party/cargo/vendor/hermit-abi-0.1.17/Cargo.toml b/third_party/cargo/vendor/hermit-abi-0.1.18/Cargo.toml similarity index 98% rename from third_party/cargo/vendor/hermit-abi-0.1.17/Cargo.toml rename to third_party/cargo/vendor/hermit-abi-0.1.18/Cargo.toml index 94d5513..4ddc9bd 100644 --- a/third_party/cargo/vendor/hermit-abi-0.1.17/Cargo.toml +++ b/third_party/cargo/vendor/hermit-abi-0.1.18/Cargo.toml @@ -13,7 +13,7 @@ [package] edition = "2018" name = "hermit-abi" -version = "0.1.17" +version = "0.1.18" authors = ["Stefan Lankes"] description = "hermit-abi is small interface to call functions from the unikernel RustyHermit.\nIt is used to build the target `x86_64-unknown-hermit`.\n" documentation = "https://hermitcore.github.io/rusty-hermit/hermit_abi" diff --git a/third_party/cargo/vendor/hermit-abi-0.1.17/LICENSE-APACHE b/third_party/cargo/vendor/hermit-abi-0.1.18/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/hermit-abi-0.1.17/LICENSE-APACHE rename to third_party/cargo/vendor/hermit-abi-0.1.18/LICENSE-APACHE diff --git a/third_party/cargo/vendor/const_fn-0.4.5/LICENSE-MIT b/third_party/cargo/vendor/hermit-abi-0.1.18/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/const_fn-0.4.5/LICENSE-MIT rename to third_party/cargo/vendor/hermit-abi-0.1.18/LICENSE-MIT diff --git a/third_party/cargo/vendor/hermit-abi-0.1.17/README.md b/third_party/cargo/vendor/hermit-abi-0.1.18/README.md similarity index 100% rename from third_party/cargo/vendor/hermit-abi-0.1.17/README.md rename to third_party/cargo/vendor/hermit-abi-0.1.18/README.md diff --git a/third_party/cargo/vendor/hermit-abi-0.1.17/rust-toolchain b/third_party/cargo/vendor/hermit-abi-0.1.18/rust-toolchain similarity index 100% rename from third_party/cargo/vendor/hermit-abi-0.1.17/rust-toolchain rename to third_party/cargo/vendor/hermit-abi-0.1.18/rust-toolchain diff --git a/third_party/cargo/vendor/hermit-abi-0.1.17/src/lib.rs b/third_party/cargo/vendor/hermit-abi-0.1.18/src/lib.rs similarity index 99% rename from third_party/cargo/vendor/hermit-abi-0.1.17/src/lib.rs rename to third_party/cargo/vendor/hermit-abi-0.1.18/src/lib.rs index 30bdca0..0b8c5b4 100644 --- a/third_party/cargo/vendor/hermit-abi-0.1.17/src/lib.rs +++ b/third_party/cargo/vendor/hermit-abi-0.1.18/src/lib.rs @@ -1,8 +1,7 @@ //! `hermit-abi` is small interface to call functions from the unikernel //! [RustyHermit](https://github.com/hermitcore/libhermit-rs). -#![cfg_attr(feature = "rustc-dep-of-std", no_std)] -#![feature(const_raw_ptr_to_usize_cast)] +#![no_std] extern crate libc; pub mod tcplistener; diff --git a/third_party/cargo/vendor/hermit-abi-0.1.17/src/tcplistener.rs b/third_party/cargo/vendor/hermit-abi-0.1.18/src/tcplistener.rs similarity index 100% rename from third_party/cargo/vendor/hermit-abi-0.1.17/src/tcplistener.rs rename to third_party/cargo/vendor/hermit-abi-0.1.18/src/tcplistener.rs diff --git a/third_party/cargo/vendor/hermit-abi-0.1.17/src/tcpstream.rs b/third_party/cargo/vendor/hermit-abi-0.1.18/src/tcpstream.rs similarity index 100% rename from third_party/cargo/vendor/hermit-abi-0.1.17/src/tcpstream.rs rename to third_party/cargo/vendor/hermit-abi-0.1.18/src/tcpstream.rs diff --git a/third_party/cargo/vendor/image-0.23.12/.cargo-checksum.json b/third_party/cargo/vendor/image-0.23.12/.cargo-checksum.json deleted file mode 100644 index 6960a10..0000000 --- a/third_party/cargo/vendor/image-0.23.12/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"CHANGES.md":"78dcda8d227005a49d585a30a08807df10d0727dc6e8ed5865a561d40ee5e50e","Cargo.toml":"c907dd31b86b9eb4fd28a607d6ca7028aaf09cd42443cb622a14b410d042ef3d","Cargo.toml.public-private-dependencies":"a53b163bb7984206c6ef2226f6c931f1fd60657c22ba5a973819f47e214d06a2","LICENSE":"c7766d2e29f88a4be81b6ac6216c62d2d0918c7d3f2fc98be6fecac8f6595e60","README.md":"3446057a91d4bf3daca981bcf9845114312f16a585cf41ab3a4b0ac6d69b4b37","benches/README.md":"87b2ea4d1cea80c1e24fc18f1222a7ee1a38f5a92e98110bb84a4827fb997b62","benches/decode.rs":"2da1d892d16af0faa3aed7bdb3b5af8550efd5619204071b2afce532f70ada86","benches/encode.rs":"0311da9b3628bda9b9b3e228f936f3df29de3ce9d5b82e09bf75da845c0eba1d","docs/2019-04-23-memory-unsafety.md":"b59a9af84bdb5efa1bc1f33c8aa22ff42590701817fb03f55ca2dd50af91bb8d","release.sh":"70f8d6272ab65f5ca80ac95e6ceeeb5041f9c183c87a1fdac2b7f2d16e0827d4","src/animation.rs":"cd4e81bf81f26c6e2ee4620dc4eb37045c782eb7bc6801b7edd2336478e96801","src/buffer.rs":"ad8ae1f9c2cd20c2dfc0a3bcff4305fa0695a7739d2758f7a677fe696ffaa20b","src/codecs/avif/mod.rs":"bd37d0852bf837f5e374e00c6bcd9c96d1163ebbe953a56f81a4c971ff5e4e18","src/codecs/bmp/decoder.rs":"cec72a8559ffbcf1b01db868b5c6273db7480f1fc7dcc0ca508d808d82668687","src/codecs/bmp/encoder.rs":"dbcc584af6b837588e79555491fb607434e7f4833f483e6e23d11fdf604b33ac","src/codecs/bmp/mod.rs":"9a524ca11763581bf04c6f0e617f36c7a4a091d9efb3dfc2cdbac0c33c89e42d","src/codecs/dds.rs":"7f9a02d72aa69fb77107ca64dd73960c626106dbbf40c26a669f8515774a390a","src/codecs/dxt.rs":"5a8abd22affbeed93920f5f7cece5306a7f48a09ff20e992c77ab5db172b0096","src/codecs/farbfeld.rs":"3bdaa9fc7f004ccf6a9d47ce4537e9e73554418dea4f4c4286db299f08ccea02","src/codecs/gif.rs":"9c2191b75a7f4bb8353ceb8d2bcc05ddf3670a8f9a41de810f8d1ba68625bb5b","src/codecs/hdr/decoder.rs":"a3a86cb3acf5ff34c37985fe1d50f9efb2970039b5f81574904bc6e60ec12044","src/codecs/hdr/encoder.rs":"7730a88ead57db5f33c9f5eb29ec557b62247b7d8f694f5f16319cbb10af161f","src/codecs/hdr/mod.rs":"96eb63b7e43f117cb46b8ffe705b477426dde75881f2dea63cab29ffd820e01d","src/codecs/ico/decoder.rs":"8b167de6b4a08602e98592e53dc2ae3fdf551c0ef112ca031d532a20b79cff25","src/codecs/ico/encoder.rs":"4c358d5c6d32fc0becc7acf4965ee4953534ed263c68662f5d921720aa33595b","src/codecs/ico/mod.rs":"242e003e22f0fe7280291baefd8e070fff0e1a566b00fdb70cc47e0402553df9","src/codecs/jpeg/decoder.rs":"55574738f396c8182954bd56d7e0c453ac3948eb69451527dff3e6d5bed1c467","src/codecs/jpeg/encoder.rs":"c2a050957d1798f51770bfe6a378698bf04de1cafe4bbdb75927660b45814606","src/codecs/jpeg/entropy.rs":"5f47d76f31c91f1c978ac640a98947227745271087aa9d14134973b2bde4d81a","src/codecs/jpeg/mod.rs":"44cd448f3b1ab6e22b6cc36704358873934f24281f667c01895e8fa809ffe550","src/codecs/jpeg/transform.rs":"3b7a5e8d96167438bdae453efb3b4b61dab54308f118fa65d539c0d35680ccea","src/codecs/png.rs":"c22519e0d4aeaa636bfb4c5f0d0cdd8977815ecb4ec8c2b4b5339e5985bcec70","src/codecs/pnm/autobreak.rs":"f52a14475c13c1a360f95cd53835d8a234c9b1fa8b675442d0485c5eaa42dfc6","src/codecs/pnm/decoder.rs":"219749be584e81116bc539a0678cd8cdb5ab2f18e5d53f6b3c87735535b8b69b","src/codecs/pnm/encoder.rs":"35abc48091dae84018db9d1fdd15d32ff8cb4cff68cd4d741b77a177118badfe","src/codecs/pnm/header.rs":"9b4bba3cbbbad3fdbf480c7c806589f18e397780f84540073f7a7367f63709be","src/codecs/pnm/mod.rs":"8ed7db0ed2a97cdb07d064ec7b7643691c6aab88644a0bf5d243dccdcc74c14d","src/codecs/tga/decoder.rs":"1adf6f551deba083d64c01fdb0764c95a71e7ceafa6e52512c934fbb11f704db","src/codecs/tga/encoder.rs":"24ed8d1c4a81fd25a76e0b9b747d9d3bab1a290b0764db9e553e04fe7a391efd","src/codecs/tga/header.rs":"0f4dd820939c4d674bc0d74a74dc307f64fefc133ecb0265e24a4e84f21bca33","src/codecs/tga/mod.rs":"e25e77180883c56657097d851427d4f1f3c2add5a9eec24e24bc42d65953b0df","src/codecs/tiff.rs":"f97d739bd6a08cc1b21d88e8de8a754b41e949117f4bc14402dc540a8b5f5210","src/codecs/webp/decoder.rs":"2009d52e2ca209afd2834461a9ff584e5c8d8f977f1fcd5ca6da185a324097e9","src/codecs/webp/mod.rs":"4ac8a930ccb1e2be5b6792cd33562c1e0c5a06f57216ca1030d6eec30d32348a","src/codecs/webp/transform.rs":"26e747e1bff0a8b88125ffc6d2a6e27ec2fcd1246a7d0e66c49f58ee80cc4847","src/codecs/webp/vp8.rs":"c53a1dce466412698caeb2912f5909c7608ebafe7dd41dce7c7e1dce69ffc9fe","src/color.rs":"3cbaab6dec0143c2b302849bb88d3a68f6da00dcc4593c6cb73814594d8f36db","src/dynimage.rs":"9fbe9c2186cdf6308d1c0e4d3dece8ec30f4eef27bf93dc9a205abab1680849e","src/error.rs":"5213b66822985bbaaadd3fb2962e8ec2163e38214c04e22eb6d376d020d6be80","src/flat.rs":"12ecceb7a0574de3ea7e0923d00acf7fdb8e702842a3fd97e4e5cd9ac73d57be","src/image.rs":"4dc09d443f5bc42bf3d0fe6fe211e0006c107d500ca65ad5c3baf16534506e66","src/imageops/affine.rs":"99a9884acd5a360d9487157b64472d3973515b238acd9598172399cc963be694","src/imageops/colorops.rs":"166e1eabd9ed672a06ad4b9818da86fbafd7f7e77560126a3ff288a2fad111f1","src/imageops/mod.rs":"ec4f4fb954472e6156d4a9c5662602e2bb2c9a0a578f1c956045abe8d95ed4b0","src/imageops/sample.rs":"3120471af9761e3bfca3397ce46cc2a21daf42002500e63734f8c41b2f087667","src/io/free_functions.rs":"d1c3a58fffad65af86e36fe734ecb80ac0c049adc5d7994928edae02ea819fff","src/io/mod.rs":"5a40ee3fefc65dc58d4fa807e612ac07a8f69a4a7fe36e7d2daef635a0179522","src/io/reader.rs":"b4558d4eb03ec25f2c2dd7cdd75b3ee0d499d51d2a512074aa17e1901884ccb7","src/lib.rs":"00a04c36e643abba1675df63a9427f7b71fd26be034db37b877f88c6e77f407a","src/math/mod.rs":"4f92a766a926546a9880b27210d3f403f470955bc8229774088acbd467bc018c","src/math/nq.rs":"5f8a3880de4ff6c23f5946e111eaa78a7a81407d6ad54ee805df079c747e920b","src/math/rect.rs":"10a6f8c76988ff7583f2824be6c3fe005a171777080e3ad0cbe169c6dc574edd","src/math/utils.rs":"fe0c4db1d08d314cbbaa40db80df43ad7bda0d3aff16fbb82644be4b3fbc9b26","src/traits.rs":"6681221fd815fe0d4fe54f8a595000f690fb4a6a8bfa544ef3359d687743c96d","src/utils/mod.rs":"bd6d294d9d13feb75570a533cfa456071340d32fa565873f2872c6517916251a"},"package":"7ce04077ead78e39ae8610ad26216aed811996b043d47beed5090db674f9e9b5"} \ No newline at end of file diff --git a/third_party/cargo/vendor/image-0.23.14/.cargo-checksum.json b/third_party/cargo/vendor/image-0.23.14/.cargo-checksum.json new file mode 100644 index 0000000..a70607a --- /dev/null +++ b/third_party/cargo/vendor/image-0.23.14/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGES.md":"51b812a2384ab0dd92240ccfdc50102531a5d66c1f138aaa52d01dffd81a975a","Cargo.toml":"9f4a04e940f439e858fd7d47163feddada9f7200d827355fcfbf418ffe6d1da5","Cargo.toml.public-private-dependencies":"a53b163bb7984206c6ef2226f6c931f1fd60657c22ba5a973819f47e214d06a2","LICENSE":"c7766d2e29f88a4be81b6ac6216c62d2d0918c7d3f2fc98be6fecac8f6595e60","README.md":"bf5eb39b5b8a327dc903ea0a655d71e7575b9878cb4c06e512464db0d72d689a","benches/README.md":"87b2ea4d1cea80c1e24fc18f1222a7ee1a38f5a92e98110bb84a4827fb997b62","benches/copy_from.rs":"0dbfaaf1037170f912833bd4c36ba23515d3c47b7008f47d43b82f967760e4ec","benches/decode.rs":"2da1d892d16af0faa3aed7bdb3b5af8550efd5619204071b2afce532f70ada86","benches/encode.rs":"0311da9b3628bda9b9b3e228f936f3df29de3ce9d5b82e09bf75da845c0eba1d","clippy.toml":"d7a417d90eaf33103036c79a5b178bbf6d12f042b0d89a3d5dad8146ac67b452","docs/2019-04-23-memory-unsafety.md":"b59a9af84bdb5efa1bc1f33c8aa22ff42590701817fb03f55ca2dd50af91bb8d","release.sh":"70f8d6272ab65f5ca80ac95e6ceeeb5041f9c183c87a1fdac2b7f2d16e0827d4","src/animation.rs":"a360b44a3a8edbd54d86d64283c846f6164c004ff3b5bb4ee869c30a9c2e8e61","src/buffer.rs":"220c3e31d98c59ad2138cb854a606211aac113333a48dea91a65a62d37c231b8","src/codecs/avif/decoder.rs":"8c6c943de855bf21799bdabf3d30a2d78caa79d33d71739a7d550bc9f7bcfa8e","src/codecs/avif/encoder.rs":"15975604c4a7764152303318a1b0c8a13bc28110342d63278267a93f5061fabb","src/codecs/avif/mod.rs":"31fcc5c582aefb2db95a8d95b6f99b4e69cbeb1cef16719390a84ee8002f432e","src/codecs/bmp/decoder.rs":"602328cae88625bfffc777b1c1c29f905997fb3471206143fd15ceb63ddd3839","src/codecs/bmp/encoder.rs":"dbcc584af6b837588e79555491fb607434e7f4833f483e6e23d11fdf604b33ac","src/codecs/bmp/mod.rs":"9a524ca11763581bf04c6f0e617f36c7a4a091d9efb3dfc2cdbac0c33c89e42d","src/codecs/dds.rs":"853be7abe2a4ee931343db2cf488c7d240656ccb1b311fd2c308ddc1f5728136","src/codecs/dxt.rs":"5a8abd22affbeed93920f5f7cece5306a7f48a09ff20e992c77ab5db172b0096","src/codecs/farbfeld.rs":"dd9d3b30acae529610231d82ac8f33c6f61cdfb0ef9a870af1d7ad63f9f8082e","src/codecs/gif.rs":"74227a3bd5a7e11123971382ab56dfa6311fcc301c99b34e0a64b13a2460d632","src/codecs/hdr/decoder.rs":"3faf44c5a76e9b092275fe5c1d9642f9f153bfaf8081c2a91f81ff1980c6c5b6","src/codecs/hdr/encoder.rs":"7730a88ead57db5f33c9f5eb29ec557b62247b7d8f694f5f16319cbb10af161f","src/codecs/hdr/mod.rs":"96eb63b7e43f117cb46b8ffe705b477426dde75881f2dea63cab29ffd820e01d","src/codecs/ico/decoder.rs":"87988909baa4069d90a1b5afb7f12de50b9ea7eee20976c78217affdf0486328","src/codecs/ico/encoder.rs":"4c358d5c6d32fc0becc7acf4965ee4953534ed263c68662f5d921720aa33595b","src/codecs/ico/mod.rs":"242e003e22f0fe7280291baefd8e070fff0e1a566b00fdb70cc47e0402553df9","src/codecs/jpeg/decoder.rs":"cf399c6d9c1f8fb497b47b6bdd92d7c8c4233b216f5a90dc97a7b6473d92d4bb","src/codecs/jpeg/encoder.rs":"c06964a19ed2bec02cb655015fb29c9c7174477f065f7c8ad19ea0433486dd9d","src/codecs/jpeg/entropy.rs":"48f5f4b4bcf283314b3c64669367e9835834bfdf048f78f7e006207060218435","src/codecs/jpeg/mod.rs":"44cd448f3b1ab6e22b6cc36704358873934f24281f667c01895e8fa809ffe550","src/codecs/jpeg/transform.rs":"3b7a5e8d96167438bdae453efb3b4b61dab54308f118fa65d539c0d35680ccea","src/codecs/png.rs":"c22519e0d4aeaa636bfb4c5f0d0cdd8977815ecb4ec8c2b4b5339e5985bcec70","src/codecs/pnm/autobreak.rs":"f52a14475c13c1a360f95cd53835d8a234c9b1fa8b675442d0485c5eaa42dfc6","src/codecs/pnm/decoder.rs":"00b4ef75967bbedfe2538a7d344399c893ff68ccf12e812e4920d618dd1b6f30","src/codecs/pnm/encoder.rs":"f3d5c9fc95491701af8841230dca21fd3e549c42b11102fbfa6d35da5c80ca3d","src/codecs/pnm/header.rs":"9b4bba3cbbbad3fdbf480c7c806589f18e397780f84540073f7a7367f63709be","src/codecs/pnm/mod.rs":"8ed7db0ed2a97cdb07d064ec7b7643691c6aab88644a0bf5d243dccdcc74c14d","src/codecs/tga/decoder.rs":"18da7b583a7af71445981abc708d7b943562a1f968bc8fea771ba81e0b25db3f","src/codecs/tga/encoder.rs":"24ed8d1c4a81fd25a76e0b9b747d9d3bab1a290b0764db9e553e04fe7a391efd","src/codecs/tga/header.rs":"0f4dd820939c4d674bc0d74a74dc307f64fefc133ecb0265e24a4e84f21bca33","src/codecs/tga/mod.rs":"e25e77180883c56657097d851427d4f1f3c2add5a9eec24e24bc42d65953b0df","src/codecs/tiff.rs":"c1321851db76af9de930360616c7cff4ab35ec4038e18685e0690d1b1816d905","src/codecs/webp/decoder.rs":"2009d52e2ca209afd2834461a9ff584e5c8d8f977f1fcd5ca6da185a324097e9","src/codecs/webp/mod.rs":"4ac8a930ccb1e2be5b6792cd33562c1e0c5a06f57216ca1030d6eec30d32348a","src/codecs/webp/transform.rs":"26e747e1bff0a8b88125ffc6d2a6e27ec2fcd1246a7d0e66c49f58ee80cc4847","src/codecs/webp/vp8.rs":"6d264cbe38eb833700c069c0cb753e97e6f60de5a1e60f139ff70603cc5fa49e","src/color.rs":"a925500c93238a2314fc1e875d44dd57a3459ef0e779f827d1a18691747a8322","src/dynimage.rs":"4e9058e05a3aa9eb953a8d0aec08df89e54e824ac8bfd24acdac8bf4e4f54b7c","src/error.rs":"5213b66822985bbaaadd3fb2962e8ec2163e38214c04e22eb6d376d020d6be80","src/flat.rs":"12ecceb7a0574de3ea7e0923d00acf7fdb8e702842a3fd97e4e5cd9ac73d57be","src/image.rs":"d165b133be59de97166dfbedf4d78d3bb74ed97a99cb22db4329fab80786c49f","src/imageops/affine.rs":"99a9884acd5a360d9487157b64472d3973515b238acd9598172399cc963be694","src/imageops/colorops.rs":"f4445dc8d81faf6c2b32d98a90303540b270d09a05069b03d0ac293e2c3f686f","src/imageops/mod.rs":"131b3631679a9c01b4854eb5e71eb660922bce2575943b6f141b878b3710ae25","src/imageops/sample.rs":"e04924c946df37e422f3110e8f00003b5b1e5627aff6dbdc76884c77caeb2b31","src/io/free_functions.rs":"d8afb4fa989a42689c01f775384cdaab80d77904a86c1d5d9ca48f2e48e06b25","src/io/mod.rs":"5a40ee3fefc65dc58d4fa807e612ac07a8f69a4a7fe36e7d2daef635a0179522","src/io/reader.rs":"b4558d4eb03ec25f2c2dd7cdd75b3ee0d499d51d2a512074aa17e1901884ccb7","src/lib.rs":"97f17593fafccadefa12b192945a9def3f8d8cc4095ee173d8947b80a0692d1f","src/math/mod.rs":"4f92a766a926546a9880b27210d3f403f470955bc8229774088acbd467bc018c","src/math/nq.rs":"5f8a3880de4ff6c23f5946e111eaa78a7a81407d6ad54ee805df079c747e920b","src/math/rect.rs":"10a6f8c76988ff7583f2824be6c3fe005a171777080e3ad0cbe169c6dc574edd","src/math/utils.rs":"940aefdeb67d08636534c7c2e6d6ebb2d15df8705077c64690204715e76088e8","src/traits.rs":"6681221fd815fe0d4fe54f8a595000f690fb4a6a8bfa544ef3359d687743c96d","src/utils/mod.rs":"2fce69ac2b3da91aa4f17ea6640b890a1f2c72cb55a40a875b808725b165638e"},"package":"24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1"} \ No newline at end of file diff --git a/third_party/cargo/vendor/image-0.23.12/BUILD.bazel b/third_party/cargo/vendor/image-0.23.14/BUILD.bazel similarity index 82% rename from third_party/cargo/vendor/image-0.23.12/BUILD.bazel rename to third_party/cargo/vendor/image-0.23.14/BUILD.bazel index 62ef8ee..ce11168 100644 --- a/third_party/cargo/vendor/image-0.23.12/BUILD.bazel +++ b/third_party/cargo/vendor/image-0.23.14/BUILD.bazel @@ -30,6 +30,8 @@ licenses([ # Generated Targets +# Unsupported target "copy_from" with type "bench" omitted + # Unsupported target "decode" with type "bench" omitted # Unsupported target "encode" with type "bench" omitted @@ -38,7 +40,7 @@ rust_library( name = "image", srcs = glob(["**/*.rs"]), aliases = { - "//third_party/cargo/vendor/jpeg-decoder-0.1.20:jpeg_decoder": "jpeg", + "//third_party/cargo/vendor/jpeg-decoder-0.1.22:jpeg_decoder": "jpeg", }, crate_features = [ "bmp", @@ -69,14 +71,14 @@ rust_library( "cargo-raze", "manual", ], - version = "0.23.12", + version = "0.23.14", # buildifier: leave-alone deps = [ - "//third_party/cargo/vendor/bytemuck-1.4.1:bytemuck", - "//third_party/cargo/vendor/byteorder-1.3.4:byteorder", + "//third_party/cargo/vendor/bytemuck-1.5.1:bytemuck", + "//third_party/cargo/vendor/byteorder-1.4.3:byteorder", "//third_party/cargo/vendor/color_quant-1.1.0:color_quant", - "//third_party/cargo/vendor/gif-0.11.1:gif", - "//third_party/cargo/vendor/jpeg-decoder-0.1.20:jpeg_decoder", + "//third_party/cargo/vendor/gif-0.11.2:gif", + "//third_party/cargo/vendor/jpeg-decoder-0.1.22:jpeg_decoder", "//third_party/cargo/vendor/num-iter-0.1.42:num_iter", "//third_party/cargo/vendor/num-rational-0.3.2:num_rational", "//third_party/cargo/vendor/num-traits-0.2.14:num_traits", diff --git a/third_party/cargo/vendor/image-0.23.12/CHANGES.md b/third_party/cargo/vendor/image-0.23.14/CHANGES.md similarity index 91% rename from third_party/cargo/vendor/image-0.23.12/CHANGES.md rename to third_party/cargo/vendor/image-0.23.14/CHANGES.md index 8ed153b..3698eda 100644 --- a/third_party/cargo/vendor/image-0.23.12/CHANGES.md +++ b/third_party/cargo/vendor/image-0.23.14/CHANGES.md @@ -10,6 +10,42 @@ Rust image aims to be a pure-Rust implementation of various popular image format ## Changes +### Version 0.23.14 + +- Unified gif blending in different decode methods, fixing out-of-bounds checks + in a number of weirdly positioned frames. +- Hardened TGA decoder against a number of malicious inputs. +- Fix forward incompatible usage of the panic macro. +- Fix load_rect for gif reaching `unreachable!()` code. + +- Added `ExtendedColorType::A8`. +- Allow TGA to load alpha-only images. +- Optimized load_rect to avoid unnecessary seeks. + +### Version 0.23.13 + +- Fix an inconsistency in supported formats of different methods for encoding + an image. +- Fix `thumbnail` choosing an empty image. It now always prefer non-empty image + dimensions. +- Fix integer overflow in calculating requires bytes for decoded image buffers + for farbfeld, hdr, and pnm decoders. These will now error early. +- Fix a panic decoding certain `jpeg` image without frames or meta data. +- Optimized the `jpeg` encoder. +- Optimized `GenericImage::copy_from` default impl in various cases. + +- Add `avif` decoders. You must enable it explicitly and it is not covered by + our usual MSRV policy of Rust 1.34. Instead, only latest stable is supported. +- Add `ImageFormat::{can_read, can_write}` +- Add `Frame::buffer_mut` +- Add speed and quality options on `avif` encoder. +- Add speed parameter to `gif` encoder. +- Expose control over sequence repeat to the `gif` encoder. +- Add `{contrast,brighten,huerotate}_in_place` functions in imageproc. + +- Relax `Default` impl of `ImageBuffer`, removing the bound on the color type. +- Derive Debug, Hash, PartialEq, Eq for DynamicImage + ### Version 0.23.12 - Fix a soundness issue affecting the impls of `Pixel::from_slice_mut`. This @@ -23,7 +59,7 @@ Rust image aims to be a pure-Rust implementation of various popular image format - Fix re-exporting `png::{CompressionType, FilterType}` to maintain SemVer compatibility with the `0.23` releases. -- Add ImageFormat::from_extension +- Add `ImageFormat::from_extension` - Add copyless DynamicImage to byte slice/vec conversion. - Add bit-depth specific `into_` and `to_` DynamicImage conversion methods. diff --git a/third_party/cargo/vendor/image-0.23.12/Cargo.toml b/third_party/cargo/vendor/image-0.23.14/Cargo.toml similarity index 86% rename from third_party/cargo/vendor/image-0.23.12/Cargo.toml rename to third_party/cargo/vendor/image-0.23.14/Cargo.toml index 4e968f5..9f5804c 100644 --- a/third_party/cargo/vendor/image-0.23.12/Cargo.toml +++ b/third_party/cargo/vendor/image-0.23.14/Cargo.toml @@ -13,7 +13,7 @@ [package] edition = "2018" name = "image" -version = "0.23.12" +version = "0.23.14" authors = ["The image-rs Developers"] exclude = ["src/png/testdata/*", "examples/*", "tests/*"] description = "Imaging library written in Rust. Provides basic filters and decoders for the most common image formats." @@ -37,6 +37,10 @@ harness = false name = "encode" path = "benches/encode.rs" harness = false + +[[bench]] +name = "copy_from" +harness = false [dependencies.bytemuck] version = "1" @@ -46,16 +50,28 @@ version = "1.3.2" [dependencies.color_quant] version = "1.1" +[dependencies.dav1d] +version = "0.6.0" +optional = true + +[dependencies.dcv-color-primitives] +version = "0.1.16" +optional = true + [dependencies.gif] version = "0.11.1" optional = true [dependencies.jpeg] -version = "0.1.17" +version = "0.1.22" optional = true default-features = false package = "jpeg-decoder" +[dependencies.mp4parse] +version = "0.11.5" +optional = true + [dependencies.num-iter] version = "0.1.32" @@ -101,7 +117,9 @@ version = "0.3" version = "0.9" [features] -avif = ["ravif", "rgb"] +avif = ["avif-encoder"] +avif-decoder = ["mp4parse", "dcv-color-primitives", "dav1d"] +avif-encoder = ["ravif", "rgb"] benchmarks = [] bmp = [] dds = ["dxt"] diff --git a/third_party/cargo/vendor/image-0.23.12/Cargo.toml.public-private-dependencies b/third_party/cargo/vendor/image-0.23.14/Cargo.toml.public-private-dependencies similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/Cargo.toml.public-private-dependencies rename to third_party/cargo/vendor/image-0.23.14/Cargo.toml.public-private-dependencies diff --git a/third_party/cargo/vendor/image-0.23.12/LICENSE b/third_party/cargo/vendor/image-0.23.14/LICENSE similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/LICENSE rename to third_party/cargo/vendor/image-0.23.14/LICENSE diff --git a/third_party/cargo/vendor/image-0.23.12/README.md b/third_party/cargo/vendor/image-0.23.14/README.md similarity index 92% rename from third_party/cargo/vendor/image-0.23.12/README.md rename to third_party/cargo/vendor/image-0.23.14/README.md index 25d5bf2..b06c459 100644 --- a/third_party/cargo/vendor/image-0.23.12/README.md +++ b/third_party/cargo/vendor/image-0.23.14/README.md @@ -27,7 +27,7 @@ All image processing functions provided operate on types that implement the `Gen | ICO | Yes | Yes | | TIFF | Baseline(no fax support) + LZW + PackBits | RGB(8), RGBA(8), Gray(8) | | WebP | Lossy(Luma channel only) | No | -| AVIF | No | Lossy | +| AVIF | Only 8-bit | Lossy | | PNM | PBM, PGM, PPM, standard PAM | Yes | | DDS | DXT1, DXT3, DXT5 | No | | TGA | Yes | RGB(8), RGBA(8), BGR(8), BGRA(8), Gray(8), GrayA(8) | @@ -56,6 +56,7 @@ The most important methods for decoders are... All pixels are parameterised by their component type. ## Images +Individual pixels within images are indexed with (0,0) at the top left corner. ### The [`GenericImageView`](https://docs.rs/image/*/image/trait.GenericImageView.html) and [`GenericImage`](https://docs.rs/image/*/image/trait.GenericImage.html) Traits Traits that provide methods for inspecting (`GenericImageView`) and manipulating (`GenericImage`) images, parameterised over the image's pixel type. @@ -119,6 +120,7 @@ For convenience `DynamicImage` reimplements all image processing functions. #### [`SubImage`](https://docs.rs/image/*/image/struct.SubImage.html) A view into another image, delimited by the coordinates of a rectangle. +The coordinates given set the position of the top left corner of the rectangle. This is used to perform image processing functions on a subregion of an image. ```rust @@ -134,22 +136,23 @@ assert!(subimg.dimensions() == (100, 100)); ## Image Processing Functions These are the functions defined in the `imageops` module. All functions operate on types that implement the `GenericImage` trait. +Note that some of the functions are very slow in debug mode. Make sure to use release mode if you experience any performance issues. + **blur**: Performs a Gaussian blur on the supplied image. -+ **brighten**: Brighten the supplied image -+ **huerotate**: Hue rotate the supplied image by degrees -+ **contrast**: Adjust the contrast of the supplied image -+ **crop**: Return a mutable view into an image ++ **brighten**: Brighten the supplied image. ++ **huerotate**: Hue rotate the supplied image by degrees. ++ **contrast**: Adjust the contrast of the supplied image. ++ **crop**: Return a mutable view into an image. + **filter3x3**: Perform a 3x3 box filter on the supplied image. -+ **flip_horizontal**: Flip an image horizontally -+ **flip_vertical**: Flip an image vertically -+ **grayscale**: Convert the supplied image to grayscale ++ **flip_horizontal**: Flip an image horizontally. ++ **flip_vertical**: Flip an image vertically. ++ **grayscale**: Convert the supplied image to grayscale. + **invert**: Invert each pixel within the supplied image This function operates in place. -+ **resize**: Resize the supplied image to the specified dimensions ++ **resize**: Resize the supplied image to the specified dimensions. + **rotate180**: Rotate an image 180 degrees clockwise. + **rotate270**: Rotate an image 270 degrees clockwise. + **rotate90**: Rotate an image 90 degrees clockwise. -+ **unsharpen**: Performs an unsharpen mask on the supplied image ++ **unsharpen**: Performs an unsharpen mask on the supplied image. For more options, see the [`imageproc`](https://crates.io/crates/imageproc) crate. diff --git a/third_party/cargo/vendor/image-0.23.12/benches/README.md b/third_party/cargo/vendor/image-0.23.14/benches/README.md similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/benches/README.md rename to third_party/cargo/vendor/image-0.23.14/benches/README.md diff --git a/third_party/cargo/vendor/image-0.23.14/benches/copy_from.rs b/third_party/cargo/vendor/image-0.23.14/benches/copy_from.rs new file mode 100644 index 0000000..113abe9 --- /dev/null +++ b/third_party/cargo/vendor/image-0.23.14/benches/copy_from.rs @@ -0,0 +1,14 @@ +use image::{GenericImage, ImageBuffer, Rgba}; +use criterion::{black_box, Criterion, criterion_group, criterion_main}; + +pub fn bench_copy_from(c: &mut Criterion) { + let src = ImageBuffer::from_pixel(2048, 2048, Rgba([255u8, 0, 0, 255])); + let mut dst = ImageBuffer::from_pixel(2048, 2048, Rgba([0u8, 0, 0, 255])); + + c.bench_function("copy_from", |b| { + b.iter(|| dst.copy_from(black_box(&src), 0, 0)) + }); +} + +criterion_group!(benches, bench_copy_from); +criterion_main!(benches); diff --git a/third_party/cargo/vendor/image-0.23.12/benches/decode.rs b/third_party/cargo/vendor/image-0.23.14/benches/decode.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/benches/decode.rs rename to third_party/cargo/vendor/image-0.23.14/benches/decode.rs diff --git a/third_party/cargo/vendor/image-0.23.12/benches/encode.rs b/third_party/cargo/vendor/image-0.23.14/benches/encode.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/benches/encode.rs rename to third_party/cargo/vendor/image-0.23.14/benches/encode.rs diff --git a/third_party/cargo/vendor/image-0.23.14/clippy.toml b/third_party/cargo/vendor/image-0.23.14/clippy.toml new file mode 100644 index 0000000..e299faf --- /dev/null +++ b/third_party/cargo/vendor/image-0.23.14/clippy.toml @@ -0,0 +1 @@ +msrv = "1.34.2" diff --git a/third_party/cargo/vendor/image-0.23.12/docs/2019-04-23-memory-unsafety.md b/third_party/cargo/vendor/image-0.23.14/docs/2019-04-23-memory-unsafety.md similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/docs/2019-04-23-memory-unsafety.md rename to third_party/cargo/vendor/image-0.23.14/docs/2019-04-23-memory-unsafety.md diff --git a/third_party/cargo/vendor/image-0.23.12/release.sh b/third_party/cargo/vendor/image-0.23.14/release.sh similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/release.sh rename to third_party/cargo/vendor/image-0.23.14/release.sh diff --git a/third_party/cargo/vendor/image-0.23.12/src/animation.rs b/third_party/cargo/vendor/image-0.23.14/src/animation.rs similarity index 98% rename from third_party/cargo/vendor/image-0.23.12/src/animation.rs rename to third_party/cargo/vendor/image-0.23.14/src/animation.rs index 33b8177..8724b07 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/animation.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/animation.rs @@ -83,6 +83,11 @@ impl Frame { &self.buffer } + /// Returns a mutable image buffer + pub fn buffer_mut(&mut self) -> &mut RgbaImage { + &mut self.buffer + } + /// Returns the image buffer pub fn into_buffer(self) -> RgbaImage { self.buffer diff --git a/third_party/cargo/vendor/image-0.23.12/src/buffer.rs b/third_party/cargo/vendor/image-0.23.14/src/buffer.rs similarity index 98% rename from third_party/cargo/vendor/image-0.23.12/src/buffer.rs rename to third_party/cargo/vendor/image-0.23.14/src/buffer.rs index 8817bcb..353f399 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/buffer.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/buffer.rs @@ -693,6 +693,7 @@ where /// The iterator yields the coordinates of each pixel /// along with a reference to them. /// The iteration order is x = 0 to width then y = 0 to height + /// Starting from the top left. pub fn enumerate_pixels(&self) -> EnumeratePixels

{ EnumeratePixels { pixels: self.pixels(), @@ -938,6 +939,21 @@ where } } +impl Default for ImageBuffer +where + P: Pixel, + Container: Default, +{ + fn default() -> Self { + Self { + width: 0, + height: 0, + _phantom: PhantomData, + data: Default::default(), + } + } +} + impl Deref for ImageBuffer where P: Pixel + 'static, @@ -1296,7 +1312,7 @@ pub(crate) type GrayAlpha16Image = ImageBuffer, Vec>; #[cfg(test)] mod test { use super::{ImageBuffer, RgbImage}; - use crate::color; + use crate::{color, Rgb}; #[test] /// Tests if image buffers from slices work @@ -1369,6 +1385,12 @@ mod test { assert_eq!(image.rows().count(), 1); assert_eq!(image.rows_mut().count(), 1); } + + #[test] + fn default() { + let image = ImageBuffer::, Vec>::default(); + assert_eq!(image.dimensions(), (0, 0)); + } } #[cfg(test)] diff --git a/third_party/cargo/vendor/image-0.23.14/src/codecs/avif/decoder.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/avif/decoder.rs new file mode 100644 index 0000000..7294147 --- /dev/null +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/avif/decoder.rs @@ -0,0 +1,163 @@ +//! Decoding of AVIF images. +/// +/// The [AVIF] specification defines an image derivative of the AV1 bitstream, an open video codec. +/// +/// [AVIF]: https://aomediacodec.github.io/av1-avif/ +use std::convert::TryFrom; +use std::error::Error; +use std::io::{self, Cursor, Read}; +use std::marker::PhantomData; +use std::mem; + +use crate::error::DecodingError; +use crate::{ColorType, ImageDecoder, ImageError, ImageFormat, ImageResult}; + +use dav1d::{PixelLayout, PlanarImageComponent}; +use dcv_color_primitives as dcp; +use mp4parse::read_avif; + +fn error_map>>(err: E) -> ImageError { + ImageError::Decoding(DecodingError::new(ImageFormat::Avif.into(), err)) +} + +/// AVIF Decoder. +/// +/// Reads one image into the chosen input. +pub struct AvifDecoder { + inner: PhantomData, + picture: dav1d::Picture, + alpha_picture: Option, +} + +impl AvifDecoder { + /// Create a new decoder that reads its input from `r`. + pub fn new(mut r: R) -> ImageResult { + let ctx = read_avif(&mut r).map_err(error_map)?; + let mut primary_decoder = dav1d::Decoder::new(); + primary_decoder + .send_data(ctx.primary_item(), None, None, None) + .map_err(error_map)?; + let picture = primary_decoder.get_picture().map_err(error_map)?; + let alpha_picture = if let Some(alpha_item) = ctx.alpha_item() { + let mut alpha_decoder = dav1d::Decoder::new(); + alpha_decoder + .send_data(alpha_item, None, None, None) + .map_err(error_map)?; + Some(alpha_decoder.get_picture().map_err(error_map)?) + } else { + None + }; + assert_eq!(picture.bit_depth(), 8); + Ok(AvifDecoder { + inner: PhantomData, + picture, + alpha_picture, + }) + } +} + +/// Wrapper struct around a `Cursor>` +pub struct AvifReader(Cursor>, PhantomData); +impl Read for AvifReader { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + self.0.read(buf) + } + fn read_to_end(&mut self, buf: &mut Vec) -> io::Result { + if self.0.position() == 0 && buf.is_empty() { + mem::swap(buf, self.0.get_mut()); + Ok(buf.len()) + } else { + self.0.read_to_end(buf) + } + } +} + +impl<'a, R: 'a + Read> ImageDecoder<'a> for AvifDecoder { + type Reader = AvifReader; + + fn dimensions(&self) -> (u32, u32) { + (self.picture.width(), self.picture.height()) + } + + fn color_type(&self) -> ColorType { + ColorType::Bgra8 + } + + fn into_reader(self) -> ImageResult { + let plane = self.picture.plane(PlanarImageComponent::Y); + Ok(AvifReader( + Cursor::new(plane.as_ref().to_vec()), + PhantomData, + )) + } + + fn read_image(self, buf: &mut [u8]) -> ImageResult<()> { + assert_eq!(u64::try_from(buf.len()), Ok(self.total_bytes())); + + dcp::initialize(); + + if self.picture.pixel_layout() != PixelLayout::I400 { + let pixel_format = match self.picture.pixel_layout() { + PixelLayout::I400 => todo!(), + PixelLayout::I420 => dcp::PixelFormat::I420, + PixelLayout::I422 => dcp::PixelFormat::I422, + PixelLayout::I444 => dcp::PixelFormat::I444, + PixelLayout::Unknown => panic!("Unknown pixel layout"), + }; + let src_format = dcp::ImageFormat { + pixel_format, + color_space: dcp::ColorSpace::Bt601, + num_planes: 3, + }; + let dst_format = dcp::ImageFormat { + pixel_format: dcp::PixelFormat::Bgra, + color_space: dcp::ColorSpace::Lrgb, + num_planes: 1, + }; + let (width, height) = self.dimensions(); + let planes = &[ + self.picture.plane(PlanarImageComponent::Y), + self.picture.plane(PlanarImageComponent::U), + self.picture.plane(PlanarImageComponent::V), + ]; + let src_buffers = planes.iter().map(AsRef::as_ref).collect::>(); + let strides = &[ + self.picture.stride(PlanarImageComponent::Y) as usize, + self.picture.stride(PlanarImageComponent::U) as usize, + self.picture.stride(PlanarImageComponent::V) as usize, + ]; + let dst_buffers = &mut [&mut buf[..]]; + dcp::convert_image( + width, + height, + &src_format, + Some(strides), + &src_buffers, + &dst_format, + None, + dst_buffers, + ) + .map_err(error_map)?; + } else { + let plane = self.picture.plane(PlanarImageComponent::Y); + buf.copy_from_slice(plane.as_ref()); + } + + if let Some(picture) = self.alpha_picture { + assert_eq!(picture.pixel_layout(), PixelLayout::I400); + let stride = picture.stride(PlanarImageComponent::Y) as usize; + let plane = picture.plane(PlanarImageComponent::Y); + let width = picture.width(); + for (buf, slice) in Iterator::zip( + buf.chunks_exact_mut(width as usize * 4), + plane.as_ref().chunks_exact(stride), + ) { + for i in 0..width as usize { + buf[3 + i * 4] = slice[i]; + } + } + } + + Ok(()) + } +} diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/avif/mod.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/avif/encoder.rs similarity index 80% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/avif/mod.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/avif/encoder.rs index ed8214d..75d0a5f 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/codecs/avif/mod.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/avif/encoder.rs @@ -5,6 +5,7 @@ /// [AVIF]: https://aomediacodec.github.io/av1-avif/ use std::borrow::Cow; use std::io::Write; +use std::cmp::min; use crate::{ColorType, ImageBuffer, ImageFormat, Pixel}; use crate::{ImageError, ImageResult}; @@ -14,7 +15,7 @@ use crate::error::{EncodingError, ParameterError, ParameterErrorKind, Unsupporte use bytemuck::{Pod, PodCastError, try_cast_slice, try_cast_slice_mut}; use num_traits::Zero; -use ravif::{Img, ColorSpace, Config, RGBA8, encode_rgba}; +use ravif::{Img, Config, RGBA8, encode_rgba}; use rgb::AsPixels; /// AVIF Encoder. @@ -23,12 +24,62 @@ use rgb::AsPixels; pub struct AvifEncoder { inner: W, fallback: Vec, + config: Config +} + +/// An enumeration over supported AVIF color spaces +#[derive(Debug, Copy, Clone, PartialEq, Eq)] +pub enum ColorSpace { + /// sRGB colorspace + Srgb, + /// BT.709 colorspace + Bt709, + + #[doc(hidden)] + __NonExhaustive(crate::utils::NonExhaustiveMarker), +} + +impl ColorSpace { + fn to_ravif(self) -> ravif::ColorSpace { + match self { + Self::Srgb => ravif::ColorSpace::RGB, + Self::Bt709 => ravif::ColorSpace::YCbCr, + Self::__NonExhaustive(marker) => match marker._private {}, + } + } } impl AvifEncoder { /// Create a new encoder that writes its output to `w`. pub fn new(w: W) -> Self { - AvifEncoder { inner: w, fallback: vec![] } + AvifEncoder::new_with_speed_quality(w, 1, 100) + } + + /// Create a new encoder with specified speed and quality, that writes its output to `w`. + /// `speed` accepts a value in the range 0-10, where 0 is the slowest and 10 is the fastest. + /// `quality` accepts a value in the range 0-100, where 0 is the worst and 100 is the best. + pub fn new_with_speed_quality(w: W, speed: u8, quality: u8) -> Self { + // Clamp quality and speed to range + let quality = min(quality, 100); + let speed = min(speed, 10); + + AvifEncoder { + inner: w, + fallback: vec![], + config: Config { + quality, + alpha_quality: quality, + speed, + premultiplied_alpha: false, + color_space: ravif::ColorSpace::RGB, + } + } + } + + /// Encode with the specified `color_space`. + pub fn with_colorspace(mut self, color_space: ColorSpace) -> Self { + self.config.color_space = color_space.to_ravif(); + self } /// Encode image data with the indicated color type. @@ -37,7 +88,8 @@ impl AvifEncoder { /// necessary. When data is suitably aligned, i.e. u16 channels to two bytes, then the /// conversion may be more efficient. pub fn write_image(mut self, data: &[u8], width: u32, height: u32, color: ColorType) -> ImageResult<()> { - let config = self.config(color); + self.set_color(color); + let config = self.config; // `ravif` needs strongly typed data so let's convert. We can either use a temporarily // owned version in our own buffer or zero-copy if possible by using the input buffer. // This requires going through `rgb`. @@ -50,14 +102,9 @@ impl AvifEncoder { Ok(()) } - fn config(&self, _color: ColorType) -> Config { - Config { - quality: 100, - alpha_quality: 100, - speed: 1, - premultiplied_alpha: false, - color_space: ColorSpace::RGB, - } + // Does not currently do anything. Mirrors behaviour of old config function. + fn set_color(&mut self, _color: ColorType) { + // self.config.color_space = ColorSpace::RGB; } fn encode_as_img<'buf>(&'buf mut self, data: &'buf [u8], width: u32, height: u32, color: ColorType) diff --git a/third_party/cargo/vendor/image-0.23.14/src/codecs/avif/mod.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/avif/mod.rs new file mode 100644 index 0000000..f74217c --- /dev/null +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/avif/mod.rs @@ -0,0 +1,14 @@ +//! Encoding of AVIF images. +/// +/// The [AVIF] specification defines an image derivative of the AV1 bitstream, an open video codec. +/// +/// [AVIF]: https://aomediacodec.github.io/av1-avif/ +#[cfg(feature = "avif-decoder")] +pub use self::decoder::AvifDecoder; +#[cfg(feature = "avif-encoder")] +pub use self::encoder::{AvifEncoder, ColorSpace}; + +#[cfg(feature = "avif-decoder")] +mod decoder; +#[cfg(feature = "avif-encoder")] +mod encoder; diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/bmp/decoder.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/bmp/decoder.rs similarity index 99% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/bmp/decoder.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/bmp/decoder.rs index 95b1092..ff5bb16 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/codecs/bmp/decoder.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/bmp/decoder.rs @@ -1467,7 +1467,7 @@ impl<'a, R: 'a + Read + Seek> ImageDecoderExt<'a> for BmpDecoder { progress_callback: F, ) -> ImageResult<()> { let start = self.reader.seek(SeekFrom::Current(0))?; - image::load_rect(x, y, width, height, buf, progress_callback, self, |_, _| unreachable!(), + image::load_rect(x, y, width, height, buf, progress_callback, self, |_, _| Ok(()), |s, buf| s.read_image_data(buf))?; self.reader.seek(SeekFrom::Start(start))?; Ok(()) @@ -1476,7 +1476,7 @@ impl<'a, R: 'a + Read + Seek> ImageDecoderExt<'a> for BmpDecoder { #[cfg(test)] mod test { - use super::Bitfield; + use super::*; #[test] fn test_bitfield_len() { @@ -1492,4 +1492,13 @@ mod test { } } } + + #[test] + fn read_rect() { + let f = std::fs::File::open("tests/images/bmp/images/Core_8_Bit.bmp").unwrap(); + let mut decoder = super::BmpDecoder::new(f).unwrap(); + + let mut buf: Vec = vec![0; 8 * 8 * 3]; + decoder.read_rect(0, 0, 8, 8, &mut *buf).unwrap(); + } } diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/bmp/encoder.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/bmp/encoder.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/bmp/encoder.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/bmp/encoder.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/bmp/mod.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/bmp/mod.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/bmp/mod.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/bmp/mod.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/dds.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/dds.rs similarity index 80% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/dds.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/dds.rs index db64c31..9cb0418 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/codecs/dds.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/dds.rs @@ -181,6 +181,23 @@ impl DdsDecoder { )) } }; + + if crate::utils::check_dimension_overflow( + header.width, + header.height, + variant.color_type().bytes_per_pixel(), + ) { + return Err(ImageError::Unsupported( + UnsupportedError::from_format_and_kind( + ImageFormat::Dds.into(), + UnsupportedErrorKind::GenericFeature(format!( + "Image dimensions ({}x{}) are too large", + header.width, header.height + )), + ), + )); + } + let inner = DxtDecoder::new(r, header.width, header.height, variant)?; Ok(Self { inner }) } else { @@ -219,3 +236,24 @@ impl<'a, R: 'a + Read> ImageDecoder<'a> for DdsDecoder { } } +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn dimension_overflow() { + // A DXT1 header set to 0xFFFF_FFFC width and height (the highest u32%4 == 0) + let header = vec![ + 0x44, 0x44, 0x53, 0x20, 0x7C, 0x0, 0x0, 0x0, 0x7, 0x10, 0x8, 0x0, 0xFC, 0xFF, 0xFF, 0xFF, 0xFC, + 0xFF, 0xFF, 0xFF, 0x0, 0xC0, 0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x49, 0x4D, + 0x41, 0x47, 0x45, 0x4D, 0x41, 0x47, 0x49, 0x43, 0x4B, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x44, + 0x58, 0x54, 0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + ]; + + assert!(DdsDecoder::new(&header[..]).is_err()); + } +} diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/dxt.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/dxt.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/dxt.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/dxt.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/farbfeld.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/farbfeld.rs similarity index 93% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/farbfeld.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/farbfeld.rs index b7703ae..bd2c2ed 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/codecs/farbfeld.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/farbfeld.rs @@ -63,13 +63,32 @@ impl FarbfeldReader { ))); } - Ok(FarbfeldReader { + let reader = FarbfeldReader { width: read_dimm(&mut inner)?, height: read_dimm(&mut inner)?, inner, current_offset: 0, cached_byte: None, - }) + }; + + if crate::utils::check_dimension_overflow( + reader.width, + reader.height, + // ColorType is always rgba16 + ColorType::Rgba16.bytes_per_pixel(), + ) { + return Err(ImageError::Unsupported( + UnsupportedError::from_format_and_kind( + ImageFormat::Farbfeld.into(), + UnsupportedErrorKind::GenericFeature(format!( + "Image dimensions ({}x{}) are too large", + reader.width, reader.height + )), + ), + )); + } + + Ok(reader) } } @@ -332,6 +351,13 @@ mod tests { assert_eq!(&out_buf[..exp.len()], &exp[..]); } + #[test] + fn dimension_overflow() { + let header = b"farbfeld\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"; + + assert!(FarbfeldDecoder::new(Cursor::new(header)).is_err()); + } + fn read_rect(x: u32, y: u32, width: u32, height: u32, exp_wide: &[u16]) { let mut out_buf = [0u8; 64]; FarbfeldDecoder::new(Cursor::new(RECTANGLE_IN)) diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/gif.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/gif.rs similarity index 65% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/gif.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/gif.rs index 6acb7ee..54da98e 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/codecs/gif.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/gif.rs @@ -94,51 +94,61 @@ impl<'a, R: 'a + Read> ImageDecoder<'a> for GifDecoder { fn read_image(mut self, buf: &mut [u8]) -> ImageResult<()> { assert_eq!(u64::try_from(buf.len()), Ok(self.total_bytes())); - let (f_width, f_height, left, top); + let frame = match self.reader.next_frame_info() + .map_err(ImageError::from_decoding)? { + Some(frame) => FrameInfo::new_from_frame(frame), + None => { + return Err(ImageError::Parameter(ParameterError::from_kind( + ParameterErrorKind::NoMoreData, + ))) + } + }; - if let Some(frame) = self.reader.next_frame_info().map_err(ImageError::from_decoding)? { - left = u32::from(frame.left); - top = u32::from(frame.top); - f_width = u32::from(frame.width); - f_height = u32::from(frame.height); + let (width, height) = self.dimensions(); + + if (frame.left, frame.top) == (0, 0) && (frame.width, frame.height) != self.dimensions() { + // If the frame matches the logical screen, directly read into it + self.reader.read_into_buffer(buf).map_err(ImageError::from_decoding)?; } else { - return Err(ImageError::Parameter( - ParameterError::from_kind(ParameterErrorKind::NoMoreData) - )); - } + // If the frame does not match the logical screen, read into an extra buffer + // and 'insert' the frame from left/top to logical screen width/height. + let mut frame_buffer = vec![0; self.reader.buffer_size()]; + self.reader.read_into_buffer(&mut frame_buffer[..]).map_err(ImageError::from_decoding)?; - self.reader.read_into_buffer(buf).map_err(ImageError::from_decoding)?; + let frame_buffer = ImageBuffer::from_raw(frame.width, frame.height, frame_buffer); + let image_buffer = ImageBuffer::from_raw(width, height, buf); - let (width, height) = (u32::from(self.reader.width()), u32::from(self.reader.height())); - if (left, top) != (0, 0) || (width, height) != (f_width, f_height) { - // This is somewhat of an annoying case. The image we read into `buf` doesn't take up - // the whole buffer and now we need to properly insert borders. For simplicity this code - // currently takes advantage of the `ImageBuffer::from_fn` function to make a second - // ImageBuffer that is properly positioned, and then copies it back into `buf`. - // - // TODO: Implement this without any allocation. - - // Recover the full image - let image_buffer = { - // See the comments inside `::next` about - // the error handling of `from_raw`. - let image = ImageBuffer::from_raw(f_width, f_height, &mut *buf).ok_or_else( - || ImageError::Unsupported(UnsupportedError::from_format_and_kind( + // `buffer_size` uses wrapping arithmetics, thus might not report the + // correct storage requirement if the result does not fit in `usize`. + // `ImageBuffer::from_raw` detects overflow and reports by returning `None`. + if frame_buffer.is_none() || image_buffer.is_none() { + return Err(ImageError::Unsupported( + UnsupportedError::from_format_and_kind( ImageFormat::Gif.into(), - UnsupportedErrorKind::GenericFeature(format!("Image dimensions ({}, {}) are too large", f_width, f_height)))))?; + UnsupportedErrorKind::GenericFeature(format!( + "Image dimensions ({}, {}) are too large", + frame.width, frame.height + )), + ), + )); + } - ImageBuffer::from_fn(width, height, |x, y| { - let x = x.wrapping_sub(left); - let y = y.wrapping_sub(top); - if x < image.width() && y < image.height() { - *image.get_pixel(x, y) - } else { - Rgba([0, 0, 0, 0]) - } - }) - }; - buf.copy_from_slice(&image_buffer.into_raw()); + let frame_buffer = frame_buffer.unwrap(); + let mut image_buffer = image_buffer.unwrap(); + + for (x, y, pixel) in image_buffer.enumerate_pixels_mut() { + let frame_x = x.wrapping_sub(frame.left); + let frame_y = y.wrapping_sub(frame.top); + + if frame_x < frame.width && frame_y < frame.height { + *pixel = *frame_buffer.get_pixel(frame_x, frame_y); + } else { + // this is only necessary in case the buffer is not zeroed + *pixel = Rgba([0, 0, 0, 0]); + } + } } + Ok(()) } } @@ -152,7 +162,6 @@ struct GifFrameIterator { non_disposed_frame: ImageBuffer, Vec>, } - impl GifFrameIterator { fn new(decoder: GifDecoder) -> GifFrameIterator { let (width, height) = decoder.dimensions(); @@ -174,32 +183,23 @@ impl GifFrameIterator { } } - impl Iterator for GifFrameIterator { type Item = ImageResult; fn next(&mut self) -> Option> { // begin looping over each frame - let (left, top, delay, dispose, f_width, f_height); - match self.reader.next_frame_info() { + let frame = match self.reader.next_frame_info() { Ok(frame_info) => { if let Some(frame) = frame_info { - left = u32::from(frame.left); - top = u32::from(frame.top); - f_width = u32::from(frame.width); - f_height = u32::from(frame.height); - - // frame.delay is in units of 10ms so frame.delay*10 is in ms - delay = Ratio::new(u32::from(frame.delay) * 10, 1); - dispose = frame.dispose; + FrameInfo::new_from_frame(frame) } else { // no more frames return None; } - }, + } Err(err) => return Some(Err(ImageError::from_decoding(err))), - } + }; let mut vec = vec![0; self.reader.buffer_size()]; if let Err(err) = self.reader.read_into_buffer(&mut vec) { @@ -211,13 +211,18 @@ impl Iterator for GifFrameIterator { // correct storage requirement if the result does not fit in `usize`. // on the other hand, `ImageBuffer::from_raw` detects overflow and // reports by returning `None`. - let mut frame_buffer = match ImageBuffer::from_raw(f_width, f_height, vec) { + let mut frame_buffer = match ImageBuffer::from_raw(frame.width, frame.height, vec) { Some(frame_buffer) => frame_buffer, None => { - return Some(Err(ImageError::Unsupported(UnsupportedError::from_format_and_kind( - ImageFormat::Gif.into(), - UnsupportedErrorKind::GenericFeature(format!("Image dimensions ({}, {}) are too large", f_width, f_height)), - )))) + return Some(Err(ImageError::Unsupported( + UnsupportedError::from_format_and_kind( + ImageFormat::Gif.into(), + UnsupportedErrorKind::GenericFeature(format!( + "Image dimensions ({}, {}) are too large", + frame.width, frame.height + )), + ), + ))) } }; @@ -253,22 +258,22 @@ impl Iterator for GifFrameIterator { // if `frame_buffer`'s frame exactly matches the entire image, then // use it directly, else create a new buffer to hold the composited // image. - let image_buffer = if (left, top) == (0, 0) + let image_buffer = if (frame.left, frame.top) == (0, 0) && (self.width, self.height) == frame_buffer.dimensions() { for (x, y, pixel) in frame_buffer.enumerate_pixels_mut() { let previous_pixel = self.non_disposed_frame.get_pixel_mut(x, y); - blend_and_dispose_pixel(dispose, previous_pixel, pixel); + blend_and_dispose_pixel(frame.disposal_method, previous_pixel, pixel); } frame_buffer } else { ImageBuffer::from_fn(self.width, self.height, |x, y| { - let frame_x = x.wrapping_sub(left); - let frame_y = y.wrapping_sub(top); + let frame_x = x.wrapping_sub(frame.left); + let frame_y = y.wrapping_sub(frame.top); let previous_pixel = self.non_disposed_frame.get_pixel_mut(x, y); if frame_x < frame_buffer.width() && frame_y < frame_buffer.height() { let mut pixel = *frame_buffer.get_pixel(frame_x, frame_y); - blend_and_dispose_pixel(dispose, previous_pixel, &mut pixel); + blend_and_dispose_pixel(frame.disposal_method, previous_pixel, &mut pixel); pixel } else { // out of bounds, return pixel from previous frame @@ -278,7 +283,7 @@ impl Iterator for GifFrameIterator { }; Some(Ok(animation::Frame::from_parts( - image_buffer, 0, 0, animation::Delay::from_ratio(delay), + image_buffer, 0,0, frame.delay, ))) } } @@ -289,10 +294,53 @@ impl<'a, R: Read + 'a> AnimationDecoder<'a> for GifDecoder { } } +struct FrameInfo { + left: u32, + top: u32, + width: u32, + height: u32, + disposal_method: DisposalMethod, + delay: animation::Delay, +} + +impl FrameInfo { + fn new_from_frame(frame: &Frame) -> FrameInfo { + FrameInfo { + left: u32::from(frame.left), + top: u32::from(frame.top), + width: u32::from(frame.width), + height: u32::from(frame.height), + disposal_method: frame.dispose, + // frame.delay is in units of 10ms so frame.delay*10 is in ms + delay: animation::Delay::from_ratio(Ratio::new(u32::from(frame.delay) * 10, 1)), + } + } +} + +/// Number of repetitions for a GIF animation +#[derive(Clone, Copy, Debug)] +pub enum Repeat { + /// Finite number of repetitions + Finite(u16), + /// Looping GIF + Infinite, +} + +impl Repeat { + pub(crate) fn to_gif_enum(&self) -> gif::Repeat { + match self { + Repeat::Finite(n) => gif::Repeat::Finite(*n), + Repeat::Infinite => gif::Repeat::Infinite, + } + } +} + /// GIF encoder. pub struct GifEncoder { w: Option, gif_encoder: Option>, + speed: i32, + repeat: Option, } /// GIF encoder @@ -309,12 +357,31 @@ pub type Encoder = GifEncoder; impl GifEncoder { /// Creates a new GIF encoder. pub fn new(w: W) -> GifEncoder { + Self::new_with_speed(w, 1) + } + + /// Create a new GIF encoder, and has the speed parameter `speed`. See + /// [`Frame::from_rgba_speed`](/gif/struct.Frame.html#method.from_rgb_speed) + /// for more information. + pub fn new_with_speed(w: W, speed: i32) -> GifEncoder { + assert!(speed >= 1 && speed <= 30, "speed needs to be in the range [1, 30]"); GifEncoder { w: Some(w), gif_encoder: None, + speed, + repeat: None, } } + /// Set the repeat behaviour of the encoded GIF + pub fn set_repeat(&mut self, repeat: Repeat) -> ImageResult<()> { + if let Some(ref mut encoder) = self.gif_encoder { + encoder.set_repeat(repeat.to_gif_enum()).map_err(ImageError::from_encoding)?; + } + self.repeat = Some(repeat); + Ok(()) + } + /// Encode a single image. pub fn encode( &mut self, @@ -379,7 +446,7 @@ impl GifEncoder { rbga_frame.height())?; // Create the gif::Frame from the animation::Frame - let mut frame = Frame::from_rgba(width, height, &mut *rbga_frame); + let mut frame = Frame::from_rgba_speed(width, height, &mut *rbga_frame, self.speed); // Saturate the conversion to u16::MAX instead of returning an error as that // would require a new special cased variant in ParameterErrorKind which most // likely couldn't be reused for other cases. This isn't a bad trade-off given @@ -408,8 +475,11 @@ impl GifEncoder { gif_encoder = encoder; } else { let writer = self.w.take().unwrap(); - let encoder = gif::Encoder::new(writer, frame.width, frame.height, &[]) + let mut encoder = gif::Encoder::new(writer, frame.width, frame.height, &[]) .map_err(ImageError::from_encoding)?; + if let Some(ref repeat) = self.repeat { + encoder.set_repeat(repeat.to_gif_enum()).map_err(ImageError::from_encoding)?; + } self.gif_encoder = Some(encoder); gif_encoder = self.gif_encoder.as_mut().unwrap() } @@ -435,3 +505,26 @@ impl ImageError { } } } + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn frames_exceeding_logical_screen_size() { + // This is a gif with 10x10 logical screen, but a 16x16 frame + 6px offset inside. + let data = vec![ + 0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x0A, 0x00, 0x0A, 0x00, 0xF0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0E, 0xFF, 0x1F, 0x21, 0xF9, 0x04, 0x09, 0x64, 0x00, 0x00, 0x00, 0x2C, + 0x06, 0x00, 0x06, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x02, 0x23, 0x84, 0x8F, 0xA9, + 0xBB, 0xE1, 0xE8, 0x42, 0x8A, 0x0F, 0x50, 0x79, 0xAE, 0xD1, 0xF9, 0x7A, 0xE8, 0x71, + 0x5B, 0x48, 0x81, 0x64, 0xD5, 0x91, 0xCA, 0x89, 0x4D, 0x21, 0x63, 0x89, 0x4C, 0x09, + 0x77, 0xF5, 0x6D, 0x14, 0x00, 0x3B, + ]; + + let decoder = GifDecoder::new(Cursor::new(data)).unwrap(); + let mut buf = vec![0u8; decoder.total_bytes() as usize]; + + assert!(decoder.read_image(&mut buf).is_ok()); + } +} diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/hdr/decoder.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/hdr/decoder.rs similarity index 97% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/hdr/decoder.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/hdr/decoder.rs index cadbcfd..0ccccb7 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/codecs/hdr/decoder.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/hdr/decoder.rs @@ -344,7 +344,7 @@ impl HdrDecoder { /// could consume file size worth of memory in the process. pub fn with_strictness(mut reader: R, strict: bool) -> ImageResult> { let mut attributes = HdrMetadata::new(); - + { // scope to make borrowck happy let r = &mut reader; @@ -395,6 +395,19 @@ impl HdrDecoder { } }; + // color type is always rgb8 + if crate::utils::check_dimension_overflow(width, height, ColorType::Rgb8.bytes_per_pixel()) { + return Err(ImageError::Unsupported( + UnsupportedError::from_format_and_kind( + ImageFormat::Hdr.into(), + UnsupportedErrorKind::GenericFeature(format!( + "Image dimensions ({}x{}) are too large", + width, height + )), + ), + )); + } + Ok(HdrDecoder { r: reader, @@ -1008,3 +1021,17 @@ pub fn read_raw_file>(path: P) -> ::std::io::Result> } Ok(ret) } + +#[cfg(test)] +mod test { + use super::*; + use std::io::Cursor; + + #[test] + fn dimension_overflow() { + let data = b"#?RADIANCE\nFORMAT=32-bit_rle_rgbe\n\n -Y 4294967295 +X 4294967295"; + + assert!(HdrAdapter::new(Cursor::new(data)).is_err()); + assert!(HdrAdapter::new_nonstrict(Cursor::new(data)).is_err()); + } +} diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/hdr/encoder.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/hdr/encoder.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/hdr/encoder.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/hdr/encoder.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/hdr/mod.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/hdr/mod.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/hdr/mod.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/hdr/mod.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/ico/decoder.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/ico/decoder.rs similarity index 88% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/ico/decoder.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/ico/decoder.rs index 86da65c..7b73221 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/codecs/ico/decoder.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/ico/decoder.rs @@ -116,9 +116,20 @@ enum InnerDecoder { struct DirEntry { width: u8, height: u8, + // We ignore some header fields as they will be replicated in the PNG, BMP and they are not + // necessary for determining the best_entry. + #[allow(unused)] color_count: u8, + // Wikipedia has this to say: + // Although Microsoft's technical documentation states that this value must be zero, the icon + // encoder built into .NET (System.Drawing.Icon.Save) sets this value to 255. It appears that + // the operating system ignores this value altogether. + #[allow(unused)] reserved: u8, + // We ignore some header fields as they will be replicated in the PNG, BMP and they are not + // necessary for determining the best_entry. + #[allow(unused)] num_color_planes: u16, bits_per_pixel: u16, @@ -148,32 +159,32 @@ fn read_entries(r: &mut R) -> ImageResult> { } fn read_entry(r: &mut R) -> ImageResult { - let mut entry = DirEntry::default(); - - entry.width = r.read_u8()?; - entry.height = r.read_u8()?; - entry.color_count = r.read_u8()?; - // Reserved value (not used) - entry.reserved = r.read_u8()?; - - // This may be either the number of color planes (0 or 1), or the horizontal coordinate - // of the hotspot for CUR files. - entry.num_color_planes = r.read_u16::()?; - if entry.num_color_planes > 256 { - return Err(DecoderError::IcoEntryTooManyPlanesOrHotspot.into()); - } - - // This may be either the bit depth (may be 0 meaning unspecified), - // or the vertical coordinate of the hotspot for CUR files. - entry.bits_per_pixel = r.read_u16::()?; - if entry.bits_per_pixel > 256 { - return Err(DecoderError::IcoEntryTooManyBitsPerPixelOrHotspot.into()); - } - - entry.image_length = r.read_u32::()?; - entry.image_offset = r.read_u32::()?; - - Ok(entry) + Ok(DirEntry { + width: r.read_u8()?, + height: r.read_u8()?, + color_count: r.read_u8()?, + reserved: r.read_u8()?, + num_color_planes: { + // This may be either the number of color planes (0 or 1), or the horizontal coordinate + // of the hotspot for CUR files. + let num = r.read_u16::()?; + if num > 256 { + return Err(DecoderError::IcoEntryTooManyPlanesOrHotspot.into()); + } + num + }, + bits_per_pixel: { + // This may be either the bit depth (may be 0 meaning unspecified), + // or the vertical coordinate of the hotspot for CUR files. + let num = r.read_u16::()?; + if num > 256 { + return Err(DecoderError::IcoEntryTooManyBitsPerPixelOrHotspot.into()); + } + num + }, + image_length: r.read_u32::()?, + image_offset: r.read_u32::()?, + }) } /// Find the entry with the highest (color depth, size). diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/ico/encoder.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/ico/encoder.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/ico/encoder.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/ico/encoder.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/ico/mod.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/ico/mod.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/ico/mod.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/ico/mod.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/jpeg/decoder.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/jpeg/decoder.rs similarity index 99% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/jpeg/decoder.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/jpeg/decoder.rs index 35f4bb3..6d2df08 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/codecs/jpeg/decoder.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/jpeg/decoder.rs @@ -21,7 +21,9 @@ impl JpegDecoder { let mut decoder = jpeg::Decoder::new(r); decoder.read_info().map_err(ImageError::from_jpeg)?; - let mut metadata = decoder.info().unwrap(); + let mut metadata = decoder.info().ok_or_else(|| { + ImageError::Decoding(DecodingError::from_format_hint(ImageFormat::Jpeg.into())) + })?; // We convert CMYK data to RGB before returning it to the user. if metadata.pixel_format == jpeg::PixelFormat::CMYK32 { diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/jpeg/encoder.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/jpeg/encoder.rs similarity index 96% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/jpeg/encoder.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/jpeg/encoder.rs index e8c7b06..70f7ba4 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/codecs/jpeg/encoder.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/jpeg/encoder.rs @@ -202,7 +202,7 @@ impl<'a, W: Write + 'a> BitWriter<'a, W> { self.write_bits(0x7F, 7) } - fn huffman_encode(&mut self, val: u8, table: &[(u8, u16)]) -> io::Result<()> { + fn huffman_encode(&mut self, val: u8, table: &[(u8, u16); 256]) -> io::Result<()> { let (size, code) = table[val as usize]; if size > 16 { @@ -216,8 +216,8 @@ impl<'a, W: Write + 'a> BitWriter<'a, W> { &mut self, block: &[i32; 64], prevdc: i32, - dctable: &[(u8, u16)], - actable: &[(u8, u16)], + dctable: &[(u8, u16); 256], + actable: &[(u8, u16); 256], ) -> io::Result { // Differential DC encoding let dcval = block[0]; @@ -327,10 +327,10 @@ pub struct JpegEncoder<'a, W: 'a> { components: Vec, tables: Vec<[u8; 64]>, - luma_dctable: Vec<(u8, u16)>, - luma_actable: Vec<(u8, u16)>, - chroma_dctable: Vec<(u8, u16)>, - chroma_actable: Vec<(u8, u16)>, + luma_dctable: Box<[(u8, u16); 256]>, + luma_actable: Box<[(u8, u16); 256]>, + chroma_dctable: Box<[(u8, u16); 256]>, + chroma_actable: Box<[(u8, u16); 256]>, pixel_density: PixelDensity, } @@ -356,11 +356,11 @@ impl<'a, W: Write> JpegEncoder<'a, W> { /// the quality parameter ```quality``` with a value in the range 1-100 /// where 1 is the worst and 100 is the best. pub fn new_with_quality(w: &mut W, quality: u8) -> JpegEncoder { - let ld = build_huff_lut(&STD_LUMA_DC_CODE_LENGTHS, &STD_LUMA_DC_VALUES); - let la = build_huff_lut(&STD_LUMA_AC_CODE_LENGTHS, &STD_LUMA_AC_VALUES); + let ld = Box::new(build_huff_lut(&STD_LUMA_DC_CODE_LENGTHS, &STD_LUMA_DC_VALUES)); + let la = Box::new(build_huff_lut(&STD_LUMA_AC_CODE_LENGTHS, &STD_LUMA_AC_VALUES)); - let cd = build_huff_lut(&STD_CHROMA_DC_CODE_LENGTHS, &STD_CHROMA_DC_VALUES); - let ca = build_huff_lut(&STD_CHROMA_AC_CODE_LENGTHS, &STD_CHROMA_AC_VALUES); + let cd = Box::new(build_huff_lut(&STD_CHROMA_DC_CODE_LENGTHS, &STD_CHROMA_DC_VALUES)); + let ca = Box::new(build_huff_lut(&STD_CHROMA_AC_CODE_LENGTHS, &STD_CHROMA_AC_VALUES)); let components = vec![ Component { @@ -863,6 +863,11 @@ fn copy_blocks_gray( mod tests { use std::io::Cursor; + #[cfg(feature = "benchmarks")] + extern crate test; + #[cfg(feature = "benchmarks")] + use test::{Bencher}; + use crate::{Bgra, ImageBuffer, ImageEncoder, ImageError}; use crate::color::ColorType; use crate::error::ParameterErrorKind::DimensionMismatch; @@ -1083,4 +1088,14 @@ mod tests { expected.extend_from_slice(&[0; 64]); assert_eq!(buf, expected) } + + #[cfg(feature = "benchmarks")] + #[bench] + fn bench_jpeg_encoder_new(b: &mut Bencher) { + b.iter(|| { + let mut y = vec![]; + let x = JpegEncoder::new(&mut y); + }) + } + } diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/jpeg/entropy.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/jpeg/entropy.rs similarity index 82% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/jpeg/entropy.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/jpeg/entropy.rs index fb0e744..0ce445d 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/codecs/jpeg/entropy.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/jpeg/entropy.rs @@ -1,9 +1,9 @@ /// Given an array containing the number of codes of each code length, /// this function generates the huffman codes lengths and their respective /// code lengths as specified by the JPEG spec. -fn derive_codes_and_sizes(bits: &[u8]) -> (Vec, Vec) { - let mut huffsize = vec![0u8; 256]; - let mut huffcode = vec![0u16; 256]; +fn derive_codes_and_sizes(bits: &[u8; 16]) -> ([u8; 256], [u16; 256]) { + let mut huffsize = [0u8; 256]; + let mut huffcode = [0u16; 256]; let mut k = 0; @@ -48,8 +48,8 @@ fn derive_codes_and_sizes(bits: &[u8]) -> (Vec, Vec) { (huffsize, huffcode) } -pub(crate) fn build_huff_lut(bits: &[u8], huffval: &[u8]) -> Vec<(u8, u16)> { - let mut lut = vec![(17u8, 0u16); 256]; +pub(crate) fn build_huff_lut(bits: &[u8; 16], huffval: &[u8]) -> [(u8, u16); 256] { + let mut lut = [(17u8, 0u16); 256]; let (huffsize, huffcode) = derive_codes_and_sizes(bits); for (i, &v) in huffval.iter().enumerate() { diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/jpeg/mod.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/jpeg/mod.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/jpeg/mod.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/jpeg/mod.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/jpeg/transform.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/jpeg/transform.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/jpeg/transform.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/jpeg/transform.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/png.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/png.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/png.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/png.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/pnm/autobreak.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/pnm/autobreak.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/pnm/autobreak.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/pnm/autobreak.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/pnm/decoder.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/pnm/decoder.rs similarity index 97% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/pnm/decoder.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/pnm/decoder.rs index cd19fdf..1f12b2d 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/codecs/pnm/decoder.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/pnm/decoder.rs @@ -240,12 +240,31 @@ impl PnmDecoder { _ => return Err(DecoderError::PnmMagicInvalid(magic).into()), }; - match subtype { + let decoder = match subtype { PNMSubtype::Bitmap(enc) => PnmDecoder::read_bitmap_header(buf, enc), PNMSubtype::Graymap(enc) => PnmDecoder::read_graymap_header(buf, enc), PNMSubtype::Pixmap(enc) => PnmDecoder::read_pixmap_header(buf, enc), PNMSubtype::ArbitraryMap => PnmDecoder::read_arbitrary_header(buf), + }?; + + if utils::check_dimension_overflow( + decoder.dimensions().0, + decoder.dimensions().1, + decoder.color_type().bytes_per_pixel(), + ) { + return Err(ImageError::Unsupported( + UnsupportedError::from_format_and_kind( + ImageFormat::Pnm.into(), + UnsupportedErrorKind::GenericFeature(format!( + "Image dimensions ({}x{}) are too large", + decoder.dimensions().0, + decoder.dimensions().1 + )), + ), + )); } + + Ok(decoder) } /// Extract the reader and header after an image has been read. @@ -1212,4 +1231,19 @@ ENDHDR _ => panic!("Decoded header is incorrect"), } } + + #[test] + fn dimension_overflow() { + let pamdata = b"P7 +# Comment line +MAXVAL 255 +TUPLTYPE RGB +DEPTH 3 +WIDTH 4294967295 +HEIGHT 4294967295 +ENDHDR +\xde\xad\xbe\xef\xde\xad\xbe\xef\xde\xad\xbe\xef"; + + assert!(PnmDecoder::new(&pamdata[..]).is_err()); + } } diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/pnm/encoder.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/pnm/encoder.rs similarity index 99% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/pnm/encoder.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/pnm/encoder.rs index 355f190..e50b7c2 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/codecs/pnm/encoder.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/pnm/encoder.rs @@ -661,12 +661,11 @@ impl<'a> TupleEncoding<'a> { samples: FlatSamples::U16(samples), } => samples .iter() - .map(|&sample| { + .try_for_each(|&sample| { writer .write_u16::(sample) .map_err(ImageError::IoError) - }) - .collect(), + }), TupleEncoding::Ascii { samples: FlatSamples::U8(samples), diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/pnm/header.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/pnm/header.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/pnm/header.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/pnm/header.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/pnm/mod.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/pnm/mod.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/pnm/mod.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/pnm/mod.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/tga/decoder.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/tga/decoder.rs similarity index 81% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/tga/decoder.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/tga/decoder.rs index c9df7b7..9c75e4c 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/codecs/tga/decoder.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/tga/decoder.rs @@ -37,9 +37,9 @@ impl ColorMap { } /// Get one entry from the color map - pub(crate) fn get(&self, index: usize) -> &[u8] { + pub(crate) fn get(&self, index: usize) -> Option<&[u8]> { let entry = self.start_offset + self.entry_size * index; - &self.bytes[entry..entry + self.entry_size] + self.bytes.get(entry..entry + self.entry_size) } } @@ -54,6 +54,7 @@ pub struct TgaDecoder { image_type: ImageType, color_type: ColorType, + original_color_type: Option, header: Header, color_map: Option, @@ -76,6 +77,7 @@ impl TgaDecoder { image_type: ImageType::Unknown, color_type: ColorType::L8, + original_color_type: None, header: Header::default(), color_map: None, @@ -153,6 +155,11 @@ impl TgaDecoder { (0, 24, true) => self.color_type = ColorType::Rgb8, (8, 8, false) => self.color_type = ColorType::La8, (0, 8, false) => self.color_type = ColorType::L8, + (8, 0, false) => { + // alpha-only image is treated as L8 + self.color_type = ColorType::L8; + self.original_color_type = Some(ExtendedColorType::A8); + }, _ => { return Err(ImageError::Unsupported( UnsupportedError::from_format_and_kind( @@ -179,6 +186,8 @@ impl TgaDecoder { fn read_color_map(&mut self) -> ImageResult<()> { if self.header.map_type == 1 { + // FIXME: we could reverse the map entries, which avoids having to reverse all pixels + // in the final output individually. self.color_map = Some(ColorMap::from_reader( &mut self.r, self.header.map_origin, @@ -190,7 +199,7 @@ impl TgaDecoder { } /// Expands indices into its mapped color - fn expand_color_map(&self, pixel_data: &[u8]) -> Vec { + fn expand_color_map(&self, pixel_data: &[u8]) -> io::Result> { #[inline] fn bytes_to_index(bytes: &[u8]) -> usize { let mut result = 0usize; @@ -203,14 +212,24 @@ impl TgaDecoder { let bytes_per_entry = (self.header.map_entry_size as usize + 7) / 8; let mut result = Vec::with_capacity(self.width * self.height * bytes_per_entry); - let color_map = self.color_map.as_ref().unwrap(); + if self.bytes_per_pixel == 0 { + return Err(io::ErrorKind::Other.into()); + } + + let color_map = self.color_map + .as_ref() + .ok_or_else(|| io::Error::from(io::ErrorKind::Other))?; for chunk in pixel_data.chunks(self.bytes_per_pixel) { let index = bytes_to_index(chunk); - result.extend(color_map.get(index).iter().cloned()); + if let Some(color) = color_map.get(index) { + result.extend(color.iter().cloned()); + } else { + return Err(io::ErrorKind::Other.into()); + } } - result + Ok(result) } /// Reads a run length encoded data for given number of bytes @@ -244,6 +263,13 @@ impl TgaDecoder { } } + if pixel_data.len() > num_bytes { + // FIXME: the last packet contained more data than we asked for! + // This is at least a warning. We truncate the data since some methods rely on the + // length to be accurate in the success case. + pixel_data.truncate(num_bytes); + } + Ok(pixel_data) } @@ -284,11 +310,11 @@ impl TgaDecoder { /// /// TGA files are stored in the BGRA encoding. This function swaps /// the blue and red bytes in the `pixels` array. - fn reverse_encoding(&mut self, pixels: &mut [u8]) { + fn reverse_encoding_in_output(&mut self, pixels: &mut [u8]) { // We only need to reverse the encoding of color images match self.color_type { ColorType::Rgb8 | ColorType::Rgba8 => { - for chunk in pixels.chunks_mut(self.bytes_per_pixel) { + for chunk in pixels.chunks_mut(self.color_type.bytes_per_pixel().into()) { chunk.swap(0, 2); } } @@ -304,6 +330,10 @@ impl TgaDecoder { /// This function checks the bit, and if it's 0, flips the image vertically. fn flip_vertically(&mut self, pixels: &mut [u8]) { if self.is_flipped_vertically() { + if self.height == 0 { + return; + } + let num_bytes = pixels.len(); let width_bytes = num_bytes / self.height; @@ -352,9 +382,9 @@ impl TgaDecoder { // expand the indices using the color map if necessary if self.image_type.is_color_mapped() { - pixel_data = self.expand_color_map(&pixel_data) + pixel_data = self.expand_color_map(&pixel_data)?; } - self.reverse_encoding(&mut pixel_data); + self.reverse_encoding_in_output(&mut pixel_data); // copy to the output buffer buf[..pixel_data.len()].copy_from_slice(&pixel_data); @@ -376,6 +406,10 @@ impl<'a, R: 'a + Read + Seek> ImageDecoder<'a> for TgaDecoder { self.color_type } + fn original_color_type(&self) -> ExtendedColorType { + self.original_color_type.unwrap_or_else(|| self.color_type().into()) + } + fn scanline_bytes(&self) -> u64 { // This cannot overflow because TGA has a maximum width of u16::MAX_VALUE and // `bytes_per_pixel` is a u8. @@ -392,24 +426,38 @@ impl<'a, R: 'a + Read + Seek> ImageDecoder<'a> for TgaDecoder { fn read_image(mut self, buf: &mut [u8]) -> ImageResult<()> { assert_eq!(u64::try_from(buf.len()), Ok(self.total_bytes())); + // In indexed images, we might need more bytes than pixels to read them. That's nonsensical + // to encode but we'll not want to crash. + let mut fallback_buf = vec![]; // read the pixels from the data region - let len = if self.image_type.is_encoded() { + let rawbuf = if self.image_type.is_encoded() { let pixel_data = self.read_all_encoded_data()?; - buf[0..pixel_data.len()].copy_from_slice(&pixel_data); - pixel_data.len() + if self.bytes_per_pixel <= usize::from(self.color_type.bytes_per_pixel()) { + buf[..pixel_data.len()].copy_from_slice(&pixel_data); + &buf[..pixel_data.len()] + } else { + fallback_buf = pixel_data; + &fallback_buf[..] + } } else { let num_raw_bytes = self.width * self.height * self.bytes_per_pixel; - self.r.by_ref().read_exact(&mut buf[0..num_raw_bytes])?; - num_raw_bytes + if self.bytes_per_pixel <= usize::from(self.color_type.bytes_per_pixel()) { + self.r.by_ref().read_exact(&mut buf[..num_raw_bytes])?; + &buf[..num_raw_bytes] + } else { + fallback_buf.resize(num_raw_bytes, 0u8); + self.r.by_ref().read_exact(&mut fallback_buf[..num_raw_bytes])?; + &fallback_buf[..num_raw_bytes] + } }; // expand the indices using the color map if necessary if self.image_type.is_color_mapped() { - let pixel_data = self.expand_color_map(&buf[0..len]); + let pixel_data = self.expand_color_map(rawbuf)?; buf.copy_from_slice(&pixel_data); } - self.reverse_encoding(buf); + self.reverse_encoding_in_output(buf); self.flip_vertically(buf); diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/tga/encoder.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/tga/encoder.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/tga/encoder.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/tga/encoder.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/tga/header.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/tga/header.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/tga/header.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/tga/header.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/tga/mod.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/tga/mod.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/tga/mod.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/tga/mod.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/tiff.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/tiff.rs similarity index 99% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/tiff.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/tiff.rs index 8380642..fd8fa7e 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/codecs/tiff.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/tiff.rs @@ -81,7 +81,7 @@ impl TiffDecoder fn check_sample_format(sample_format: u16) -> Result<(), ImageError> { match tiff::tags::SampleFormat::from_u16(sample_format) { - Some(tiff::tags::SampleFormat::Uint) => Ok({}), + Some(tiff::tags::SampleFormat::Uint) => Ok(()), Some(other) => { Err(ImageError::Unsupported(UnsupportedError::from_format_and_kind( ImageFormat::Tiff.into(), diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/webp/decoder.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/webp/decoder.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/webp/decoder.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/webp/decoder.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/webp/mod.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/webp/mod.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/webp/mod.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/webp/mod.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/webp/transform.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/webp/transform.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/webp/transform.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/webp/transform.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/codecs/webp/vp8.rs b/third_party/cargo/vendor/image-0.23.14/src/codecs/webp/vp8.rs similarity index 99% rename from third_party/cargo/vendor/image-0.23.12/src/codecs/webp/vp8.rs rename to third_party/cargo/vendor/image-0.23.14/src/codecs/webp/vp8.rs index 1d0fb9b..56b1732 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/codecs/webp/vp8.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/codecs/webp/vp8.rs @@ -1259,11 +1259,9 @@ impl Vp8Decoder { fn read_macroblock_header(&mut self, mbx: usize) -> ImageResult<(bool, MacroBlock)> { let mut mb = MacroBlock::default(); - mb.segmentid = if self.segments_enabled && self.segments_update_map { - self.b - .read_with_tree(&SEGMENT_ID_TREE, &self.segment_tree_probs, 0) as u8 - } else { - 0 + if self.segments_enabled && self.segments_update_map { + mb.segmentid = self.b + .read_with_tree(&SEGMENT_ID_TREE, &self.segment_tree_probs, 0) as u8; }; let skip_coeff = if self.prob_skip_false.is_some() { @@ -1436,7 +1434,7 @@ impl Vp8Decoder { i16::from(DCT_CAT_BASE[(category - DCT_CAT1) as usize]) + extra } - c => panic!(format!("unknown token: {}", c)), + c => panic!("unknown token: {}", c), }); skip = false; diff --git a/third_party/cargo/vendor/image-0.23.12/src/color.rs b/third_party/cargo/vendor/image-0.23.14/src/color.rs similarity index 99% rename from third_party/cargo/vendor/image-0.23.12/src/color.rs rename to third_party/cargo/vendor/image-0.23.14/src/color.rs index 771e43f..0166c08 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/color.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/color.rs @@ -91,6 +91,8 @@ impl ColorType { /// decoding from and encoding to such an image format. #[derive(Copy, PartialEq, Eq, Debug, Clone, Hash)] pub enum ExtendedColorType { + /// Pixel is 8-bit alpha + A8, /// Pixel is 1-bit luminance L1, /// Pixel is 1-bit luminance with an alpha channel @@ -152,6 +154,7 @@ impl ExtendedColorType { /// an opaque datum by the library. pub fn channel_count(self) -> u8 { match self { + ExtendedColorType::A8 | ExtendedColorType::L1 | ExtendedColorType::L2 | ExtendedColorType::L4 | diff --git a/third_party/cargo/vendor/image-0.23.12/src/dynimage.rs b/third_party/cargo/vendor/image-0.23.14/src/dynimage.rs similarity index 97% rename from third_party/cargo/vendor/image-0.23.12/src/dynimage.rs rename to third_party/cargo/vendor/image-0.23.14/src/dynimage.rs index cdb2c55..eabd16b 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/dynimage.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/dynimage.rs @@ -39,7 +39,7 @@ use crate::math::resize_dimensions; use crate::traits::Pixel; /// A Dynamic Image -#[derive(Clone)] +#[derive(Clone, Debug, Hash, PartialEq, Eq)] pub enum DynamicImage { /// Each pixel in this image is 8-bit Luma ImageLuma8(GrayImage), @@ -905,7 +905,7 @@ impl DynamicImage { // When no features are supported let w = w; #[allow(unused_variables,unused_mut)] - let mut bytes = self.to_bytes(); + let mut bytes = self.as_bytes(); #[allow(unused_variables)] let (width, height) = self.dimensions(); #[allow(unused_variables,unused_mut)] @@ -917,13 +917,16 @@ impl DynamicImage { #[cfg(feature = "png")] image::ImageOutputFormat::Png => { let p = png::PngEncoder::new(w); + let converted; match *self { DynamicImage::ImageBgra8(_) => { - bytes = self.to_rgba().iter().cloned().collect(); + converted = self.to_rgba().into_raw(); + bytes = &converted; color = color::ColorType::Rgba8; } DynamicImage::ImageBgr8(_) => { - bytes = self.to_rgb().iter().cloned().collect(); + converted = self.to_rgb().into_raw(); + bytes = &converted; color = color::ColorType::Rgb8; } _ => {} @@ -931,27 +934,32 @@ impl DynamicImage { p.encode(&bytes, width, height, color)?; Ok(()) } + #[cfg(feature = "pnm")] image::ImageOutputFormat::Pnm(subtype) => { let mut p = pnm::PnmEncoder::new(w).with_subtype(subtype); + let converted; match *self { DynamicImage::ImageBgra8(_) => { - bytes = self.to_rgba().iter().cloned().collect(); + converted = self.to_rgba().into_raw(); + bytes = &converted; color = color::ColorType::Rgba8; } DynamicImage::ImageBgr8(_) => { - bytes = self.to_rgb().iter().cloned().collect(); + converted = self.to_rgb().into_raw(); + bytes = &converted; color = color::ColorType::Rgb8; } _ => {} } - p.encode(&bytes[..], width, height, color)?; + p.encode(bytes, width, height, color)?; Ok(()) } + #[cfg(feature = "jpeg")] image::ImageOutputFormat::Jpeg(quality) => { let j = jpeg::JpegEncoder::new_with_quality(w, quality); - j.write_image(&bytes, width, height, color)?; + j.write_image(bytes, width, height, color)?; Ok(()) } @@ -965,31 +973,30 @@ impl DynamicImage { #[cfg(feature = "ico")] image::ImageOutputFormat::Ico => { let i = ico::IcoEncoder::new(w); - - i.encode(&bytes, width, height, color)?; + i.encode(bytes, width, height, color)?; Ok(()) } #[cfg(feature = "bmp")] image::ImageOutputFormat::Bmp => { let mut b = bmp::BmpEncoder::new(w); - b.encode(&bytes, width, height, color)?; + b.encode(bytes, width, height, color)?; Ok(()) } #[cfg(feature = "farbfeld")] image::ImageOutputFormat::Farbfeld => { - farbfeld::FarbfeldEncoder::new(w).write_image(&bytes, width, height, color) + farbfeld::FarbfeldEncoder::new(w).write_image(bytes, width, height, color) } #[cfg(feature = "tga")] image::ImageOutputFormat::Tga => { - tga::TgaEncoder::new(w).write_image(&bytes, width, height, color) + tga::TgaEncoder::new(w).write_image(bytes, width, height, color) } #[cfg(feature = "avif")] image::ImageOutputFormat::Avif => { - avif::AvifEncoder::new(w).write_image(&bytes, width, height, color) + avif::AvifEncoder::new(w).write_image(bytes, width, height, color) } image::ImageOutputFormat::Unsupported(msg) => { @@ -1162,30 +1169,20 @@ fn decoder_to_image<'a, I: ImageDecoder<'a>>(decoder: I) -> ImageResult Vec { use crate::traits::EncodableLayout; match *image { // TODO: consider transmuting - DynamicImage::ImageLuma8(ref a) => a.iter().cloned().collect(), - - DynamicImage::ImageLumaA8(ref a) => a.iter().cloned().collect(), - - DynamicImage::ImageRgb8(ref a) => a.iter().cloned().collect(), - - DynamicImage::ImageRgba8(ref a) => a.iter().cloned().collect(), - - DynamicImage::ImageBgr8(ref a) => a.iter().cloned().collect(), - - DynamicImage::ImageBgra8(ref a) => a.iter().cloned().collect(), - + DynamicImage::ImageLuma8(ref a) => a.as_raw().clone(), + DynamicImage::ImageLumaA8(ref a) => a.as_raw().clone(), + DynamicImage::ImageRgb8(ref a) => a.as_raw().clone(), + DynamicImage::ImageRgba8(ref a) => a.as_raw().clone(), + DynamicImage::ImageBgr8(ref a) => a.as_raw().clone(), + DynamicImage::ImageBgra8(ref a) => a.as_raw().clone(), DynamicImage::ImageLuma16(ref a) => a.as_bytes().to_vec(), - DynamicImage::ImageLumaA16(ref a) => a.as_bytes().to_vec(), - DynamicImage::ImageRgb16(ref a) => a.as_bytes().to_vec(), - DynamicImage::ImageRgba16(ref a) => a.as_bytes().to_vec(), } } @@ -1332,7 +1329,7 @@ mod bench { #[cfg(feature = "benchmarks")] fn bench_conversion(b: &mut test::Bencher) { let a = super::DynamicImage::ImageRgb8(crate::ImageBuffer::new(1000, 1000)); - b.iter(|| a.to_luma()); + b.iter(|| a.to_luma8()); b.bytes = 1000 * 1000 * 3 } } diff --git a/third_party/cargo/vendor/image-0.23.12/src/error.rs b/third_party/cargo/vendor/image-0.23.14/src/error.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/error.rs rename to third_party/cargo/vendor/image-0.23.14/src/error.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/flat.rs b/third_party/cargo/vendor/image-0.23.14/src/flat.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/flat.rs rename to third_party/cargo/vendor/image-0.23.14/src/flat.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/image.rs b/third_party/cargo/vendor/image-0.23.14/src/image.rs similarity index 89% rename from third_party/cargo/vendor/image-0.23.12/src/image.rs rename to third_party/cargo/vendor/image-0.23.14/src/image.rs index 74907ed..bb8635d 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/image.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/image.rs @@ -83,6 +83,7 @@ impl ImageFormat { let ext = ext.to_str()?.to_ascii_lowercase(); Some(match ext.as_str() { + "avif" => ImageFormat::Avif, "jpg" | "jpeg" => ImageFormat::Jpeg, "png" => ImageFormat::Png, "gif" => ImageFormat::Gif, @@ -120,7 +121,7 @@ impl ImageFormat { fn inner(path: &Path) -> ImageResult { let exact_ext = path.extension(); exact_ext - .and_then(|ext| ImageFormat::from_extension(ext)) + .and_then(ImageFormat::from_extension) .ok_or_else(|| { let format_hint = match exact_ext { None => ImageFormatHint::Unknown, @@ -133,6 +134,50 @@ impl ImageFormat { inner(path.as_ref()) } + /// Return if the ImageFormat can be decoded by the lib. + #[inline] + pub fn can_read(&self) -> bool { + // Needs to be updated once a new variant's decoder is added to free_functions.rs::load + match self { + ImageFormat::Png => true, + ImageFormat::Gif => true, + ImageFormat::Jpeg => true, + ImageFormat::WebP => true, + ImageFormat::Tiff => true, + ImageFormat::Tga => true, + ImageFormat::Dds => false, + ImageFormat::Bmp => true, + ImageFormat::Ico => true, + ImageFormat::Hdr => true, + ImageFormat::Pnm => true, + ImageFormat::Farbfeld => true, + ImageFormat::Avif => true, + ImageFormat::__NonExhaustive(marker) => match marker._private {}, + } + } + + /// Return if the ImageFormat can be encoded by the lib. + #[inline] + pub fn can_write(&self) -> bool { + // Needs to be updated once a new variant's encoder is added to free_functions.rs::save_buffer_with_format_impl + match self { + ImageFormat::Gif => true, + ImageFormat::Ico => true, + ImageFormat::Jpeg => true, + ImageFormat::Png => true, + ImageFormat::Bmp => true, + ImageFormat::Tiff => true, + ImageFormat::Tga => true, + ImageFormat::Pnm => true, + ImageFormat::Farbfeld => true, + ImageFormat::Avif => true, + ImageFormat::WebP => false, + ImageFormat::Hdr => false, + ImageFormat::Dds => false, + ImageFormat::__NonExhaustive(marker) => match marker._private {}, + } + } + /// Return a list of applicable extensions for this format. /// /// All currently recognized image formats specify at least on extension but for future @@ -157,7 +202,7 @@ impl ImageFormat { ImageFormat::Hdr => &["hdr"], ImageFormat::Farbfeld => &["ff"], // According to: https://aomediacodec.github.io/av1-avif/#mime-registration - ImageFormat::Avif => &["avif", "heif", "heifs", "hif"], + ImageFormat::Avif => &["avif"], ImageFormat::__NonExhaustive(marker) => match marker._private {}, } } @@ -342,11 +387,34 @@ pub(crate) fn load_rect<'a, D, F, F1, F2, E>(x: u32, y: u32, width: u32, height: let mut bytes_read = 0u64; let mut current_scanline = 0; let mut tmp = Vec::new(); + let mut tmp_scanline = None; { // Read a range of the image starting from byte number `start` and continuing until byte // number `end`. Updates `current_scanline` and `bytes_read` appropiately. - let mut read_image_range = |start: u64, end: u64| -> ImageResult<()> { + let mut read_image_range = |mut start: u64, end: u64| -> ImageResult<()> { + // If the first scanline we need is already stored in the temporary buffer, then handle + // it first. + let target_scanline = start / scanline_bytes; + if tmp_scanline == Some(target_scanline) { + let position = target_scanline * scanline_bytes; + let offset = start.saturating_sub(position); + let len = (end - start) + .min(scanline_bytes - offset) + .min(end - position); + + buf[(bytes_read as usize)..][..len as usize] + .copy_from_slice(&tmp[offset as usize..][..len as usize]); + bytes_read += len; + start += len; + + progress_callback(Progress {current: bytes_read, total: total_bytes}); + + if start == end { + return Ok(()); + } + } + let target_scanline = start / scanline_bytes; if target_scanline != current_scanline { seek_scanline(decoder, target_scanline)?; @@ -362,6 +430,7 @@ pub(crate) fn load_rect<'a, D, F, F1, F2, E>(x: u32, y: u32, width: u32, height: } else { tmp.resize(scanline_bytes as usize, 0u8); read_scanline(decoder, &mut tmp)?; + tmp_scanline = Some(current_scanline); let offset = start.saturating_sub(position); let len = (end - start) @@ -686,7 +755,7 @@ pub trait GenericImageView { x >= ix && x < ix + iw && y >= iy && y < iy + ih } - /// Returns the pixel located at (x, y) + /// Returns the pixel located at (x, y). Indexed from top left. /// /// # Panics /// @@ -695,7 +764,7 @@ pub trait GenericImageView { /// TODO: change this signature to &P fn get_pixel(&self, x: u32, y: u32) -> Self::Pixel; - /// Returns the pixel located at (x, y) + /// Returns the pixel located at (x, y). Indexed from top left. /// /// This function can be implemented in a way that ignores bounds checking. /// # Safety @@ -727,6 +796,7 @@ pub trait GenericImageView { /// Returns an subimage that is an immutable view into this image. /// You can use [`GenericImage::sub_image`] if you need a mutable view instead. + /// The coordinates set the position of the top left corner of the view. fn view(&self, x: u32, y: u32, width: u32, height: u32) -> SubImage<&Self::InnerImageView> { SubImage::new(self.inner(), x, y, width, height) } @@ -739,21 +809,21 @@ pub trait GenericImage: GenericImageView { /// indirections and it eases the use of nested SubImages. type InnerImage: GenericImage; - /// Gets a reference to the mutable pixel at location `(x, y)` + /// Gets a reference to the mutable pixel at location `(x, y)`. Indexed from top left. /// /// # Panics /// /// Panics if `(x, y)` is out of bounds. fn get_pixel_mut(&mut self, x: u32, y: u32) -> &mut Self::Pixel; - /// Put a pixel at location (x, y) + /// Put a pixel at location (x, y). Indexed from top left. /// /// # Panics /// /// Panics if `(x, y)` is out of bounds. fn put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel); - /// Puts a pixel at location (x, y) + /// Puts a pixel at location (x, y). Indexed from top left. /// /// This function can be implemented in a way that ignores bounds checking. /// # Safety @@ -797,8 +867,8 @@ pub trait GenericImage: GenericImageView { ))); } - for i in 0..other.width() { - for k in 0..other.height() { + for k in 0..other.height() { + for i in 0..other.width() { let p = other.get_pixel(i, k); self.put_pixel(i + x, k + y, p); } @@ -853,6 +923,7 @@ pub trait GenericImage: GenericImageView { /// Returns a mutable subimage that is a view into this image. /// If you want an immutable subimage instead, use [`GenericImageView::view`] + /// The coordinates set the position of the top left corner of the SubImage. fn sub_image( &mut self, x: u32, @@ -886,6 +957,7 @@ type DerefSubpixel = as Pixel>::Subpixel; impl SubImage { /// Construct a new subimage + /// The coordinates set the position of the top left corner of the SubImage. pub fn new(image: I, x: u32, y: u32, width: u32, height: u32) -> SubImage { SubImage { image, @@ -1137,6 +1209,45 @@ mod tests { } } + #[test] + fn test_load_rect_single_scanline() { + const DATA: [u8; 25] = [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]; + + struct MockDecoder; + impl<'a> ImageDecoder<'a> for MockDecoder { + type Reader = Box; + fn dimensions(&self) -> (u32, u32) {(5, 5)} + fn color_type(&self) -> ColorType { ColorType::L8 } + fn into_reader(self) -> ImageResult {unimplemented!()} + fn scanline_bytes(&self) -> u64 { 25 } + } + + // Ensure that seek scanline is called only once. + let mut seeks = 0; + let seek_scanline = |_d: &mut MockDecoder, n: u64| -> io::Result<()> { + seeks += 1; + assert_eq!(n, 0); + assert_eq!(seeks, 1); + Ok(()) + }; + + fn read_scanline(_m: &mut MockDecoder, buf: &mut [u8]) -> io::Result<()> { + buf.copy_from_slice(&DATA); + Ok(()) + } + + let mut output = [0; 26]; + load_rect(1, 1, 2, 4, &mut output, |_|{}, + &mut MockDecoder, + seek_scanline, read_scanline).unwrap(); + assert_eq!(output[0..9], [6, 7, 11, 12, 16, 17, 21, 22, 0]); + } + + #[test] fn test_image_format_from_path() { fn from_path(s: &str) -> ImageResult { @@ -1159,6 +1270,7 @@ mod tests { assert_eq!(from_path("./a.pAM").unwrap(), ImageFormat::Pnm); assert_eq!(from_path("./a.Ppm").unwrap(), ImageFormat::Pnm); assert_eq!(from_path("./a.pgm").unwrap(), ImageFormat::Pnm); + assert_eq!(from_path("./a.AViF").unwrap(), ImageFormat::Avif); assert!(from_path("./a.txt").is_err()); assert!(from_path("./a").is_err()); } @@ -1254,7 +1366,7 @@ mod tests { #[test] fn image_formats_are_recognized() { use ImageFormat::*; - const ALL_FORMATS: &'static [ImageFormat] = &[Png, Jpeg, Gif, WebP, Pnm, Tiff, Tga, Dds, Bmp, Ico, Hdr, Farbfeld]; + const ALL_FORMATS: &'static [ImageFormat] = &[Avif, Png, Jpeg, Gif, WebP, Pnm, Tiff, Tga, Dds, Bmp, Ico, Hdr, Farbfeld]; for &format in ALL_FORMATS { let mut file = Path::new("file.nothing").to_owned(); for ext in format.extensions_str() { diff --git a/third_party/cargo/vendor/image-0.23.12/src/imageops/affine.rs b/third_party/cargo/vendor/image-0.23.14/src/imageops/affine.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/imageops/affine.rs rename to third_party/cargo/vendor/image-0.23.14/src/imageops/affine.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/imageops/colorops.rs b/third_party/cargo/vendor/image-0.23.14/src/imageops/colorops.rs similarity index 74% rename from third_party/cargo/vendor/image-0.23.12/src/imageops/colorops.rs rename to third_party/cargo/vendor/image-0.23.14/src/imageops/colorops.rs index 63dab62..4441f92 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/imageops/colorops.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/imageops/colorops.rs @@ -1,14 +1,14 @@ //! Functions for altering and converting the color of pixelbufs -use num_traits::{Num, NumCast}; +use num_traits::{Bounded, Num, NumCast}; use std::f64::consts::PI; use crate::color::{Luma, Rgba}; use crate::image::{GenericImage, GenericImageView}; #[allow(deprecated)] use crate::math::nq; -use crate::utils::clamp; use crate::traits::{Pixel, Primitive}; +use crate::utils::clamp; use crate::ImageBuffer; type Subpixel = <::Pixel as Pixel>::Subpixel; @@ -50,6 +50,8 @@ pub fn invert(image: &mut I) { /// Adjust the contrast of the supplied image. /// ```contrast``` is the amount to adjust the contrast by. /// Negative values decrease the contrast and positive values increase the contrast. +/// +/// *[See also `contrast_in_place`.][contrast_in_place]* pub fn contrast(image: &I, contrast: f32) -> ImageBuffer> where I: GenericImageView, @@ -82,9 +84,43 @@ where out } +/// Adjust the contrast of the supplied image in place. +/// ```contrast``` is the amount to adjust the contrast by. +/// Negative values decrease the contrast and positive values increase the contrast. +/// +/// *[See also `contrast`.][contrast]* +pub fn contrast_in_place(image: &mut I, contrast: f32) +where + I: GenericImage, +{ + let (width, height) = image.dimensions(); + + let max = <::Subpixel as Bounded>::max_value(); + let max: f32 = NumCast::from(max).unwrap(); + + let percent = ((100.0 + contrast) / 100.0).powi(2); + + for y in 0..height { + for x in 0..width { + let f = image.get_pixel(x, y).map(|b| { + let c: f32 = NumCast::from(b).unwrap(); + + let d = ((c / max - 0.5) * percent + 0.5) * max; + let e = clamp(d, 0.0, max); + + NumCast::from(e).unwrap() + }); + + image.put_pixel(x, y, f); + } + } +} + /// Brighten the supplied image. /// ```value``` is the amount to brighten each pixel by. /// Negative values decrease the brightness and positive values increase it. +/// +/// *[See also `brighten_in_place`.][brighten_in_place]* pub fn brighten(image: &I, value: i32) -> ImageBuffer> where I: GenericImageView, @@ -116,10 +152,43 @@ where out } +/// Brighten the supplied image in place. +/// ```value``` is the amount to brighten each pixel by. +/// Negative values decrease the brightness and positive values increase it. +/// +/// *[See also `brighten`.][brighten]* +pub fn brighten_in_place(image: &mut I, value: i32) +where + I: GenericImage, +{ + let (width, height) = image.dimensions(); + + let max = <::Subpixel as Bounded>::max_value(); + let max: i32 = NumCast::from(max).unwrap(); + + for y in 0..height { + for x in 0..width { + let e = image.get_pixel(x, y).map_with_alpha( + |b| { + let c: i32 = NumCast::from(b).unwrap(); + let d = clamp(c + value, 0, max); + + NumCast::from(d).unwrap() + }, + |alpha| alpha, + ); + + image.put_pixel(x, y, e); + } + } +} + /// Hue rotate the supplied image. /// `value` is the degrees to rotate each pixel by. /// 0 and 360 do nothing, the rest rotates by the given degree value. /// just like the css webkit filter hue-rotate(180) +/// +/// *[See also `huerotate_in_place`.][huerotate_in_place]* pub fn huerotate(image: &I, value: i32) -> ImageBuffer> where I: GenericImageView, @@ -176,6 +245,67 @@ where out } +/// Hue rotate the supplied image in place. +/// `value` is the degrees to rotate each pixel by. +/// 0 and 360 do nothing, the rest rotates by the given degree value. +/// just like the css webkit filter hue-rotate(180) +/// +/// *[See also `huerotate`.][huerotate]* +pub fn huerotate_in_place(image: &mut I, value: i32) +where + I: GenericImage, +{ + let (width, height) = image.dimensions(); + + let angle: f64 = NumCast::from(value).unwrap(); + + let cosv = (angle * PI / 180.0).cos(); + let sinv = (angle * PI / 180.0).sin(); + let matrix: [f64; 9] = [ + // Reds + 0.213 + cosv * 0.787 - sinv * 0.213, + 0.715 - cosv * 0.715 - sinv * 0.715, + 0.072 - cosv * 0.072 + sinv * 0.928, + // Greens + 0.213 - cosv * 0.213 + sinv * 0.143, + 0.715 + cosv * 0.285 + sinv * 0.140, + 0.072 - cosv * 0.072 - sinv * 0.283, + // Blues + 0.213 - cosv * 0.213 - sinv * 0.787, + 0.715 - cosv * 0.715 + sinv * 0.715, + 0.072 + cosv * 0.928 + sinv * 0.072, + ]; + for y in 0..height { + for x in 0..width { + let pixel = image.get_pixel(x, y); + let (k1, k2, k3, k4) = pixel.channels4(); + let vec: (f64, f64, f64, f64) = ( + NumCast::from(k1).unwrap(), + NumCast::from(k2).unwrap(), + NumCast::from(k3).unwrap(), + NumCast::from(k4).unwrap(), + ); + + let r = vec.0; + let g = vec.1; + let b = vec.2; + + let new_r = matrix[0] * r + matrix[1] * g + matrix[2] * b; + let new_g = matrix[3] * r + matrix[4] * g + matrix[5] * b; + let new_b = matrix[6] * r + matrix[7] * g + matrix[8] * b; + let max = 255f64; + let outpixel = Pixel::from_channels( + NumCast::from(clamp(new_r, 0.0, max)).unwrap(), + NumCast::from(clamp(new_g, 0.0, max)).unwrap(), + NumCast::from(clamp(new_b, 0.0, max)).unwrap(), + NumCast::from(clamp(vec.3, 0.0, max)).unwrap(), + ); + + image.put_pixel(x, y, outpixel); + } + } +} + /// A color map pub trait ColorMap { /// The color type on which the map operates on diff --git a/third_party/cargo/vendor/image-0.23.12/src/imageops/mod.rs b/third_party/cargo/vendor/image-0.23.14/src/imageops/mod.rs similarity index 92% rename from third_party/cargo/vendor/image-0.23.12/src/imageops/mod.rs rename to third_party/cargo/vendor/image-0.23.14/src/imageops/mod.rs index 3286c25..d24845a 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/imageops/mod.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/imageops/mod.rs @@ -30,6 +30,7 @@ pub mod colorops; mod sample; /// Return a mutable view into an image +/// The coordinates set the position of the top left corner of the crop. pub fn crop( image: &mut I, x: u32, @@ -42,6 +43,7 @@ pub fn crop( } /// Return an immutable view into an image +/// The coordinates set the position of the top left corner of the crop. pub fn crop_imm( image: &I, x: u32, @@ -172,13 +174,11 @@ where /// ```no_run /// use image::{RgbaImage}; /// -/// fn main() { -/// let mut img = RgbaImage::new(1920, 1080); -/// let tile = image::open("tile.png").unwrap(); +/// let mut img = RgbaImage::new(1920, 1080); +/// let tile = image::open("tile.png").unwrap(); /// -/// image::imageops::tile(&mut img, &tile); -/// img.save("tiled_wallpaper.png").unwrap(); -/// } +/// image::imageops::tile(&mut img, &tile); +/// img.save("tiled_wallpaper.png").unwrap(); /// ``` pub fn tile(bottom: &mut I, top: &J) where @@ -200,14 +200,12 @@ where /// ```no_run /// use image::{Rgba, RgbaImage, Pixel}; /// -/// fn main() { -/// let mut img = RgbaImage::new(100, 100); -/// let start = Rgba::from_slice(&[0, 128, 0, 0]); -/// let end = Rgba::from_slice(&[255, 255, 255, 255]); +/// let mut img = RgbaImage::new(100, 100); +/// let start = Rgba::from_slice(&[0, 128, 0, 0]); +/// let end = Rgba::from_slice(&[255, 255, 255, 255]); /// -/// image::imageops::vertical_gradient(&mut img, start, end); -/// img.save("vertical_gradient.png").unwrap(); -/// } +/// image::imageops::vertical_gradient(&mut img, start, end); +/// img.save("vertical_gradient.png").unwrap(); pub fn vertical_gradient(img: &mut I, start: &P, stop: &P) where I: GenericImage, @@ -235,14 +233,12 @@ where /// ```no_run /// use image::{Rgba, RgbaImage, Pixel}; /// -/// fn main() { -/// let mut img = RgbaImage::new(100, 100); -/// let start = Rgba::from_slice(&[0, 128, 0, 0]); -/// let end = Rgba::from_slice(&[255, 255, 255, 255]); +/// let mut img = RgbaImage::new(100, 100); +/// let start = Rgba::from_slice(&[0, 128, 0, 0]); +/// let end = Rgba::from_slice(&[255, 255, 255, 255]); /// -/// image::imageops::horizontal_gradient(&mut img, start, end); -/// img.save("horizontal_gradient.png").unwrap(); -/// } +/// image::imageops::horizontal_gradient(&mut img, start, end); +/// img.save("horizontal_gradient.png").unwrap(); pub fn horizontal_gradient(img: &mut I, start: &P, stop: &P) where I: GenericImage, diff --git a/third_party/cargo/vendor/image-0.23.12/src/imageops/sample.rs b/third_party/cargo/vendor/image-0.23.14/src/imageops/sample.rs similarity index 92% rename from third_party/cargo/vendor/image-0.23.12/src/imageops/sample.rs rename to third_party/cargo/vendor/image-0.23.14/src/imageops/sample.rs index 1d5ef65..de4216c 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/imageops/sample.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/imageops/sample.rs @@ -105,6 +105,22 @@ pub(crate) struct Filter<'a> { pub(crate) support: f32, } +struct FloatNearest(f32); + +// to_i64, to_u64, and to_f64 implicitly affect all other lower conversions. +// Note that to_f64 by default calls to_i64 and thus needs to be overridden. +impl ToPrimitive for FloatNearest { + fn to_i64(&self) -> Option { + NumCast::from(self.0.round()) + } + fn to_u64(&self) -> Option { + NumCast::from(self.0.round()) + } + fn to_f64(&self) -> Option { + NumCast::from(self.0) + } +} + // sinc function: the ideal sampling filter. fn sinc(t: f32) -> f32 { let a = t * f32::consts::PI; @@ -261,10 +277,10 @@ where let (t1, t2, t3, t4) = (t.0 / sum, t.1 / sum, t.2 / sum, t.3 / sum); let t = Pixel::from_channels( - NumCast::from(clamp(t1, 0.0, max)).unwrap(), - NumCast::from(clamp(t2, 0.0, max)).unwrap(), - NumCast::from(clamp(t3, 0.0, max)).unwrap(), - NumCast::from(clamp(t4, 0.0, max)).unwrap(), + NumCast::from(FloatNearest(clamp(t1, 0.0, max))).unwrap(), + NumCast::from(FloatNearest(clamp(t2, 0.0, max))).unwrap(), + NumCast::from(FloatNearest(clamp(t3, 0.0, max))).unwrap(), + NumCast::from(FloatNearest(clamp(t4, 0.0, max))).unwrap(), ); out.put_pixel(outx, y, t); @@ -344,10 +360,10 @@ where let (t1, t2, t3, t4) = (t.0 / sum, t.1 / sum, t.2 / sum, t.3 / sum); let t = Pixel::from_channels( - NumCast::from(clamp(t1, 0.0, max)).unwrap(), - NumCast::from(clamp(t2, 0.0, max)).unwrap(), - NumCast::from(clamp(t3, 0.0, max)).unwrap(), - NumCast::from(clamp(t4, 0.0, max)).unwrap(), + NumCast::from(FloatNearest(clamp(t1, 0.0, max))).unwrap(), + NumCast::from(FloatNearest(clamp(t2, 0.0, max))).unwrap(), + NumCast::from(FloatNearest(clamp(t3, 0.0, max))).unwrap(), + NumCast::from(FloatNearest(clamp(t4, 0.0, max))).unwrap(), ); out.put_pixel(x, outy, t); @@ -870,4 +886,35 @@ mod tests { }); b.bytes = 193 * 193 * 4 + 256 * 256 * 4; } + + #[test] + #[cfg(feature = "png")] + fn resize_transparent_image() { + use super::FilterType::{CatmullRom, Gaussian, Lanczos3, Nearest, Triangle}; + use crate::imageops::crop_imm; + use crate::RgbaImage; + + fn assert_resize(image: &RgbaImage, filter: FilterType) { + let resized = resize(image, 16, 16, filter); + let cropped = crop_imm(&resized, 5, 5, 6, 6).to_image(); + for pixel in cropped.pixels() { + let alpha = pixel.0[3]; + assert!( + alpha != 254 && alpha != 253, + format!("alpha value: {}, {:?}", alpha, filter) + ); + } + } + + let path = concat!( + env!("CARGO_MANIFEST_DIR"), + "/tests/images/png/transparency/tp1n3p08.png" + ); + let img = crate::open(path).unwrap(); + let rgba8 = img.as_rgba8().unwrap(); + let filters = &[Nearest, Triangle, CatmullRom, Gaussian, Lanczos3]; + for filter in filters { + assert_resize(rgba8, filter.clone()); + } + } } diff --git a/third_party/cargo/vendor/image-0.23.12/src/io/free_functions.rs b/third_party/cargo/vendor/image-0.23.14/src/io/free_functions.rs similarity index 80% rename from third_party/cargo/vendor/image-0.23.12/src/io/free_functions.rs rename to third_party/cargo/vendor/image-0.23.14/src/io/free_functions.rs index 95c8e3f..ce37fd0 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/io/free_functions.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/io/free_functions.rs @@ -27,8 +27,8 @@ use crate::codecs::tiff; use crate::codecs::webp; #[cfg(feature = "farbfeld")] use crate::codecs::farbfeld; -#[cfg(feature = "avif")] -use crate::avif; +#[cfg(any(feature = "avif-encoder", feature = "avif-decoder"))] +use crate::codecs::avif; use crate::color; use crate::image; @@ -59,6 +59,8 @@ pub fn load(r: R, format: ImageFormat) -> ImageResult DynamicImage::from_decoder(avif::AvifDecoder::new(r)?), #[cfg(feature = "png")] image::ImageFormat::Png => DynamicImage::from_decoder(png::PngDecoder::new(r)?), #[cfg(feature = "gif")] @@ -105,6 +107,8 @@ pub(crate) fn image_dimensions_with_format_impl(fin: R, forma // Default is unreachable if all features are supported. // Code after the match is unreachable if none are. Ok(match format { + #[cfg(feature = "avif-decoder")] + image::ImageFormat::Avif => avif::AvifDecoder::new(fin)?.dimensions(), #[cfg(feature = "jpeg")] image::ImageFormat::Jpeg => jpeg::JpegDecoder::new(fin)?.dimensions(), #[cfg(feature = "png")] @@ -143,44 +147,8 @@ pub(crate) fn save_buffer_impl( color: color::ColorType, ) -> ImageResult<()> { let fout = &mut BufWriter::new(File::create(path)?); - let ext = path.extension() - .and_then(|s| s.to_str()) - .map_or("".to_string(), |s| s.to_ascii_lowercase()); - - match &*ext { - #[cfg(feature = "gif")] - "gif" => gif::GifEncoder::new(fout).encode(buf, width, height, color), - #[cfg(feature = "ico")] - "ico" => ico::IcoEncoder::new(fout).write_image(buf, width, height, color), - #[cfg(feature = "jpeg")] - "jpg" | "jpeg" => jpeg::JpegEncoder::new(fout).write_image(buf, width, height, color), - #[cfg(feature = "png")] - "png" => png::PngEncoder::new(fout).write_image(buf, width, height, color), - #[cfg(feature = "pnm")] - "pbm" => pnm::PnmEncoder::new(fout) - .with_subtype(pnm::PNMSubtype::Bitmap(pnm::SampleEncoding::Binary)) - .write_image(buf, width, height, color), - #[cfg(feature = "pnm")] - "pgm" => pnm::PnmEncoder::new(fout) - .with_subtype(pnm::PNMSubtype::Graymap(pnm::SampleEncoding::Binary)) - .write_image(buf, width, height, color), - #[cfg(feature = "pnm")] - "ppm" => pnm::PnmEncoder::new(fout) - .with_subtype(pnm::PNMSubtype::Pixmap(pnm::SampleEncoding::Binary)) - .write_image(buf, width, height, color), - #[cfg(feature = "pnm")] - "pam" => pnm::PnmEncoder::new(fout).write_image(buf, width, height, color), - #[cfg(feature = "bmp")] - "bmp" => bmp::BmpEncoder::new(fout).write_image(buf, width, height, color), - #[cfg(feature = "tiff")] - "tif" | "tiff" => tiff::TiffEncoder::new(fout) - .write_image(buf, width, height, color), - #[cfg(feature = "tga")] - "tga" => tga::TgaEncoder::new(fout).write_image(buf, width, height, color), - #[cfg(feature = "avif")] - "avif" => avif::AvifEncoder::new(fout).write_image(buf, width, height, color), - _ => Err(ImageError::Unsupported(ImageFormatHint::from(path).into())), - } + let format = ImageFormat::from_path(path)?; + save_buffer_with_format_impl(path, buf, width, height, color, format) } #[allow(unused_variables)] @@ -204,6 +172,31 @@ pub(crate) fn save_buffer_with_format_impl( image::ImageFormat::Jpeg => jpeg::JpegEncoder::new(fout).write_image(buf, width, height, color), #[cfg(feature = "png")] image::ImageFormat::Png => png::PngEncoder::new(fout).write_image(buf, width, height, color), + #[cfg(feature = "pnm")] + image::ImageFormat::Pnm => { + let ext = path.extension() + .and_then(|s| s.to_str()) + .map_or("".to_string(), |s| s.to_ascii_lowercase()); + match &*ext { + "pbm" => pnm::PnmEncoder::new(fout) + .with_subtype(pnm::PNMSubtype::Bitmap(pnm::SampleEncoding::Binary)) + .write_image(buf, width, height, color), + "pgm" => pnm::PnmEncoder::new(fout) + .with_subtype(pnm::PNMSubtype::Graymap(pnm::SampleEncoding::Binary)) + .write_image(buf, width, height, color), + "ppm" => pnm::PnmEncoder::new(fout) + .with_subtype(pnm::PNMSubtype::Pixmap(pnm::SampleEncoding::Binary)) + .write_image(buf, width, height, color), + "pam" => pnm::PnmEncoder::new(fout).write_image(buf, width, height, color), + _ => Err(ImageError::Unsupported(ImageFormatHint::Exact(format).into())), // Unsupported Pnm subtype. + } + }, + #[cfg(feature = "farbfeld")] + image::ImageFormat::Farbfeld => farbfeld::FarbfeldEncoder::new(fout).write_image(buf, width, height, color), + #[cfg(feature = "avif-encoder")] + image::ImageFormat::Avif => avif::AvifEncoder::new(fout).write_image(buf, width, height, color), + // #[cfg(feature = "hdr")] + // image::ImageFormat::Hdr => hdr::HdrEncoder::new(fout).encode(&[Rgb], width, height), // usize #[cfg(feature = "bmp")] image::ImageFormat::Bmp => bmp::BmpEncoder::new(fout).write_image(buf, width, height, color), #[cfg(feature = "tiff")] @@ -215,7 +208,7 @@ pub(crate) fn save_buffer_with_format_impl( } } -static MAGIC_BYTES: [(&[u8], ImageFormat); 19] = [ +static MAGIC_BYTES: [(&[u8], ImageFormat); 20] = [ (b"\x89PNG\r\n\x1a\n", ImageFormat::Png), (&[0xff, 0xd8, 0xff], ImageFormat::Jpeg), (b"GIF89a", ImageFormat::Gif), @@ -235,6 +228,7 @@ static MAGIC_BYTES: [(&[u8], ImageFormat); 19] = [ (b"P6", ImageFormat::Pnm), (b"P7", ImageFormat::Pnm), (b"farbfeld", ImageFormat::Farbfeld), + (b"\0\0\0 ftypavif", ImageFormat::Avif), ]; /// Guess image format from memory block diff --git a/third_party/cargo/vendor/image-0.23.12/src/io/mod.rs b/third_party/cargo/vendor/image-0.23.14/src/io/mod.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/io/mod.rs rename to third_party/cargo/vendor/image-0.23.14/src/io/mod.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/io/reader.rs b/third_party/cargo/vendor/image-0.23.14/src/io/reader.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/io/reader.rs rename to third_party/cargo/vendor/image-0.23.14/src/io/reader.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/lib.rs b/third_party/cargo/vendor/image-0.23.14/src/lib.rs similarity index 97% rename from third_party/cargo/vendor/image-0.23.12/src/lib.rs rename to third_party/cargo/vendor/image-0.23.14/src/lib.rs index 7889a92..109e644 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/lib.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/lib.rs @@ -91,6 +91,8 @@ #![cfg_attr(all(test, feature = "benchmarks"), feature(test))] // it's a bit of a pain otherwise #![allow(clippy::many_single_char_names)] +// it's a backwards compatibility break +#![allow(clippy::wrong_self_convention, clippy::enum_variant_names)] #[cfg(all(test, feature = "benchmarks"))] extern crate test; @@ -186,6 +188,7 @@ pub mod flat; /// | ICO | Yes | Yes | /// | TIFF | Baseline(no fax support) + LZW + PackBits | RGB8, RGBA8, Gray8 | /// | WebP | Lossy(Luma channel only) | No | +/// | AVIF | Only 8-bit | Lossy | /// | PNM | PBM, PGM, PPM, standard PAM | Yes | /// | DDS | DXT1, DXT3, DXT5 | No | /// | TGA | Yes | RGB8, RGBA8, BGR8, BGRA8, Gray8, GrayA8 | @@ -213,7 +216,7 @@ pub mod flat; /// /// Re-exports of dependencies that reach version `1` will be discussed when it happens. pub mod codecs { - #[cfg(feature = "avif")] + #[cfg(any(feature = "avif-encoder", feature = "avif-decoder"))] pub mod avif; #[cfg(feature = "bmp")] pub mod bmp; @@ -243,7 +246,7 @@ pub mod codecs { pub mod webp; } -#[cfg(feature = "avif")] +#[cfg(feature = "avif-encoder")] #[deprecated = "Use codecs::avif instead"] pub mod avif { //! Encoding of AVIF images. @@ -282,7 +285,7 @@ pub mod farbfeld { pub mod gif { //! Decoding of GIF Images #[allow(deprecated)] - pub use crate::codecs::gif::{Encoder, GifDecoder, GifEncoder, GifReader}; + pub use crate::codecs::gif::{Encoder, GifDecoder, GifEncoder, GifReader, Repeat}; } #[cfg(feature = "hdr")] #[deprecated = "Use codecs::hdr instead"] @@ -379,7 +382,7 @@ macro_rules! insert_as_doc { } // Provides the README.md as doc, to ensure the example works! -// insert_as_doc!(include_str!("../README.md")); +//insert_as_doc!(include_str!("../README.md")); // Copies data from `src` to `dst` // diff --git a/third_party/cargo/vendor/image-0.23.12/src/math/mod.rs b/third_party/cargo/vendor/image-0.23.14/src/math/mod.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/math/mod.rs rename to third_party/cargo/vendor/image-0.23.14/src/math/mod.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/math/nq.rs b/third_party/cargo/vendor/image-0.23.14/src/math/nq.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/math/nq.rs rename to third_party/cargo/vendor/image-0.23.14/src/math/nq.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/math/rect.rs b/third_party/cargo/vendor/image-0.23.14/src/math/rect.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/math/rect.rs rename to third_party/cargo/vendor/image-0.23.14/src/math/rect.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/math/utils.rs b/third_party/cargo/vendor/image-0.23.14/src/math/utils.rs similarity index 93% rename from third_party/cargo/vendor/image-0.23.12/src/math/utils.rs rename to third_party/cargo/vendor/image-0.23.14/src/math/utils.rs index b9b2ac5..f0fd65e 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/math/utils.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/math/utils.rs @@ -45,6 +45,7 @@ pub(crate) fn resize_dimensions(width: u32, height: u32, nwidth: u32, nheight: u } else { u64::from(width) * u64::from(nheight) / u64::from(height) }; + let intermediate = std::cmp::max(1, intermediate); if use_width { if intermediate <= u64::from(::std::u32::MAX) { (nwidth, intermediate as u32) @@ -93,6 +94,13 @@ mod test { assert!(result.1 == 250); } + #[test] + fn resize_never_rounds_to_zero() { + let result = super::resize_dimensions(1, 150, 128, 128, false); + assert!(result.0 > 0); + assert!(result.1 > 0); + } + #[test] fn resize_handles_overflow() { let result = super::resize_dimensions(100, ::std::u32::MAX, 200, ::std::u32::MAX, true); diff --git a/third_party/cargo/vendor/image-0.23.12/src/traits.rs b/third_party/cargo/vendor/image-0.23.14/src/traits.rs similarity index 100% rename from third_party/cargo/vendor/image-0.23.12/src/traits.rs rename to third_party/cargo/vendor/image-0.23.14/src/traits.rs diff --git a/third_party/cargo/vendor/image-0.23.12/src/utils/mod.rs b/third_party/cargo/vendor/image-0.23.14/src/utils/mod.rs similarity index 94% rename from third_party/cargo/vendor/image-0.23.12/src/utils/mod.rs rename to third_party/cargo/vendor/image-0.23.14/src/utils/mod.rs index 2377255..851fee3 100644 --- a/third_party/cargo/vendor/image-0.23.12/src/utils/mod.rs +++ b/third_party/cargo/vendor/image-0.23.14/src/utils/mod.rs @@ -63,6 +63,13 @@ pub(crate) fn expand_bits(bit_depth: u8, row_size: u32, buf: &[u8]) -> Vec { p } +/// Checks if the provided dimensions would cause an overflow. +#[allow(dead_code)] +// When no image formats that use it are enabled +pub(crate) fn check_dimension_overflow(width: u32, height: u32, bytes_per_pixel: u8) -> bool { + width as u64 * height as u64 > std::u64::MAX / bytes_per_pixel as u64 +} + #[allow(dead_code)] // When no image formats that use it are enabled pub(crate) fn vec_u16_into_u8(vec: Vec) -> Vec { diff --git a/third_party/cargo/vendor/iovec-0.1.4/BUILD.bazel b/third_party/cargo/vendor/iovec-0.1.4/BUILD.bazel index c73b832..f5febaf 100644 --- a/third_party/cargo/vendor/iovec-0.1.4/BUILD.bazel +++ b/third_party/cargo/vendor/iovec-0.1.4/BUILD.bazel @@ -56,7 +56,7 @@ rust_library( ( "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", ): [ - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ], "//conditions:default": [], }), diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/.cargo-checksum.json b/third_party/cargo/vendor/jpeg-decoder-0.1.20/.cargo-checksum.json deleted file mode 100644 index 6936028..0000000 --- a/third_party/cargo/vendor/jpeg-decoder-0.1.20/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"CHANGELOG.md":"1c792d769cb6a2876321bda9038f52ee948d3c6c24b280d35c0e1e53a949df93","Cargo.lock":"6e732ca0b69f06e9cc0f21404e894bc462049c2ce7297f170e90892f49c3c01b","Cargo.toml":"ef2a485fd80c6b77e0c46805619394f1e9776c22ca02bf85d5c11ef4a885a721","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"22b83fb92a50418c7df9564b9c179fa2a0e74f293bc58b72dd7e218fc0902143","README.md":"fc5c09eb92c453ff778ee5fa585d7509dcf36e3499c2e560a8922d38c0d4c651","appveyor.yml":"5861c1d97075d4a09aea38b0ade35c0a03498f41cdc4f8754122b3793ddb6493","benches/decoding_benchmark.rs":"047d3ac829ae15d931922f2ebeb614fdbf09994bd144e255f7800fa92b627ea8","benches/tower.jpg":"40b5ae0df66540ba3ac60edf2840b4b8edd0500706105f3b63083e3a8993119a","benches/tower_grayscale.jpg":"90519862a5bc59ca5702ff802a2f16e8cdcd28b124f891bb03556b920742d94e","benches/tower_progressive.jpg":"e87bac231e2c11b1aef6981358189ad5c51f67069a43131b1512ed823a7607c6","examples/decode.rs":"6526ad8c03f230c96f2f2fb10a2cba01fc367e98c59ab5f5433d0fab4bf41bbf","src/decoder.rs":"81b339ae7d2ee94b683f7c31dff091228e2f3dddd9536dd07982b8f0a5b950f4","src/error.rs":"6c6592579922a930001bea37ec32c3f7b135210df06ec055b9bbd3b6527723f7","src/huffman.rs":"4e90e96e3e35f4f3e076470053a57dc4597c1eba7111b80f91a25052c37876eb","src/idct.rs":"989f1de41cc19d8c0cb3dcd4650c30a97251ccec4a37314635946e5b6f0181db","src/lib.rs":"8fe73ef99b9297d2d30e1ba62074b2f02a01c78c227d428b2c0db85708b22651","src/marker.rs":"315e7f87d81c70d1faaff7480c6288ed1e970fcc0fa6328410aca216d67b0139","src/parser.rs":"e9e55d8e62b1c652f74478793f31ac9c0a08bd1849788c17172d08634e4bca23","src/upsampler.rs":"2bc768519ff3eb98d1aeb1731a7c3b65ab9f2812b41145f60b10b2f73561a9b5","src/worker/immediate.rs":"9953ea2274c5380fd83f65d639d55a80f1f48080b57917208094f82e2e6bb60f","src/worker/mod.rs":"863afcbd69b588ea61e131e85a7130d64a6573355cc5693b7144fb7039694c98","src/worker/threaded.rs":"765e8a3754e11f0ac6d36efa309d6f3f54d3104ca91c4cc0a125a47e61c66014"},"package":"cc797adac5f083b8ff0ca6f6294a999393d76e197c36488e2ef732c4715f6fa3"} \ No newline at end of file diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/Cargo.lock b/third_party/cargo/vendor/jpeg-decoder-0.1.20/Cargo.lock deleted file mode 100644 index 13e0860..0000000 --- a/third_party/cargo/vendor/jpeg-decoder-0.1.20/Cargo.lock +++ /dev/null @@ -1,639 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -[[package]] -name = "adler32" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "hermit-abi 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "autocfg" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "autocfg" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "bitflags" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "bstr" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-automata 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.112 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "bumpalo" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "byteorder" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "cast" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "clap" -version = "2.33.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crc32fast" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "criterion" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", - "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)", - "criterion-plot 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "csv 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", - "oorandom 11.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "plotters 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.112 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.112 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)", - "tinytemplate 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "criterion-plot" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-deque" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-queue" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-utils" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "csv" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bstr 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "csv-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.112 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "csv-core" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "deflate" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "either" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "hermit-abi" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "itertools" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "itoa" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "jpeg-decoder" -version = "0.1.20" -dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "criterion 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "png 0.16.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "js-sys" -version = "0.3.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "wasm-bindgen 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "libc" -version = "0.2.66" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "log" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "memchr" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "memoffset" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "miniz_oxide" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-traits" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num_cpus" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "hermit-abi 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "oorandom" -version = "11.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "plotters" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "js-sys 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "png" -version = "0.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "deflate 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", - "miniz_oxide 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "proc-macro2" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "quote" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rayon" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rayon-core" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "regex" -version = "1.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "regex-automata" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "regex-syntax" -version = "0.6.18" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ryu" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "same-file" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "scopeguard" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "serde" -version = "1.0.112" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "serde_derive" -version = "1.0.112" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "serde_json" -version = "1.0.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.112 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "syn" -version = "1.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tinytemplate" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "serde 1.0.112 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unicode-width" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unicode-xid" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "walkdir" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-macro 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bumpalo 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-shared 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-macro-support 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-backend 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-shared 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.63" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "web-sys" -version = "0.3.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "js-sys 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "winapi" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "winapi-util" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[metadata] -"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" -"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" -"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" -"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" -"checksum bstr 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931" -"checksum bumpalo 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" -"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" -"checksum cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" -"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" -"checksum clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" -"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" -"checksum criterion 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "63f696897c88b57f4ffe3c69d8e1a0613c7d0e6c4833363c8560fbde9c47b966" -"checksum criterion-plot 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ddeaf7989f00f2e1d871a26a110f3ed713632feac17f65f03ca938c542618b60" -"checksum crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3aa945d63861bfe624b55d153a39684da1e8c0bc8fba932f7ee3a3c16cea3ca" -"checksum crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" -"checksum crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dfd6515864a82d2f877b42813d4553292c6659498c9a2aa31bab5a15243c2700" -"checksum crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" -"checksum csv 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" -"checksum csv-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" -"checksum deflate 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e7e5d2a2273fed52a7f947ee55b092c4057025d7a3e04e5ecdbd25d6c3fb1bd7" -"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" -"checksum hermit-abi 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "b9586eedd4ce6b3c498bc3b4dd92fc9f11166aa908a914071953768066c67909" -"checksum itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" -"checksum itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" -"checksum js-sys 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "ce10c23ad2ea25ceca0093bd3192229da4c5b3c0f2de499c1ecac0d98d452177" -"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" -"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" -"checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" -"checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" -"checksum miniz_oxide 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" -"checksum num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" -"checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" -"checksum oorandom 11.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a170cebd8021a008ea92e4db85a72f80b35df514ec664b296fdcbb654eac0b2c" -"checksum plotters 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0d1685fbe7beba33de0330629da9d955ac75bd54f33d7b79f9a895590124f6bb" -"checksum png 0.16.5 (registry+https://github.com/rust-lang/crates.io-index)" = "34ccdd66f6fe4b2433b07e4728e9a013e43233120427046e93ceb709c3a439bf" -"checksum proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" -"checksum quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" -"checksum rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" -"checksum rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" -"checksum regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" -"checksum regex-automata 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" -"checksum regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)" = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" -"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" -"checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" -"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" -"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.112 (registry+https://github.com/rust-lang/crates.io-index)" = "736aac72d1eafe8e5962d1d1c3d99b0df526015ba40915cb3c49d042e92ec243" -"checksum serde_derive 1.0.112 (registry+https://github.com/rust-lang/crates.io-index)" = "bf0343ce212ac0d3d6afd9391ac8e9c9efe06b533c8d33f660f6390cc4093f57" -"checksum serde_json 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)" = "ec2c5d7e739bc07a3e73381a39d61fdb5f671c60c1df26a130690665803d8226" -"checksum syn 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)" = "b5304cfdf27365b7585c25d4af91b35016ed21ef88f17ced89c7093b43dba8b6" -"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -"checksum tinytemplate 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d3dc76004a03cec1c5932bca4cdc2e39aaa798e3f82363dd94f9adf6098c12f" -"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" -"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" -"checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" -"checksum wasm-bindgen 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)" = "4c2dc4aa152834bc334f506c1a06b866416a8b6697d5c9f75b9a689c8486def0" -"checksum wasm-bindgen-backend 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)" = "ded84f06e0ed21499f6184df0e0cb3494727b0c5da89534e0fcc55c51d812101" -"checksum wasm-bindgen-macro 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)" = "838e423688dac18d73e31edce74ddfac468e37b1506ad163ffaf0a46f703ffe3" -"checksum wasm-bindgen-macro-support 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)" = "3156052d8ec77142051a533cdd686cba889537b213f948cd1d20869926e68e92" -"checksum wasm-bindgen-shared 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)" = "c9ba19973a58daf4db6f352eda73dc0e289493cd29fb2632eb172085b6521acd" -"checksum web-sys 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "7b72fe77fd39e4bd3eaa4412fd299a0be6b3dfe9d2597e2f1c20beb968f41d17" -"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" -"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -"checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" -"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/worker/threaded.rs b/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/worker/threaded.rs deleted file mode 100644 index c2bd057..0000000 --- a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/worker/threaded.rs +++ /dev/null @@ -1,53 +0,0 @@ -use error::Result; -use std::sync::mpsc::{self, Sender}; -use std::thread; -use super::{RowData, Worker}; -use super::immediate::ImmediateWorker; - -enum WorkerMsg { - Start(RowData), - AppendRow((usize, Vec)), - GetResult((usize, Sender>)), -} - -pub struct ThreadedWorker { - sender: Sender, -} - -impl Worker for ThreadedWorker { - fn new() -> Result { - let thread_builder = thread::Builder::new().name("worker thread".to_owned()); - let (tx, rx) = mpsc::channel(); - - thread_builder.spawn(move || { - let mut worker = ImmediateWorker::new_immediate(); - - while let Ok(message) = rx.recv() { - match message { - WorkerMsg::Start(data) => { - worker.start_immediate(data); - }, - WorkerMsg::AppendRow(row) => { - worker.append_row_immediate(row); - }, - WorkerMsg::GetResult((index, chan)) => { - let _ = chan.send(worker.get_result_immediate(index)); - }, - } - } - })?; - - Ok(ThreadedWorker { sender: tx }) - } - fn start(&mut self, row_data: RowData) -> Result<()> { - Ok(self.sender.send(WorkerMsg::Start(row_data)).expect("jpeg-decoder worker thread error")) - } - fn append_row(&mut self, row: (usize, Vec)) -> Result<()> { - Ok(self.sender.send(WorkerMsg::AppendRow(row)).expect("jpeg-decoder worker thread error")) - } - fn get_result(&mut self, index: usize) -> Result> { - let (tx, rx) = mpsc::channel(); - self.sender.send(WorkerMsg::GetResult((index, tx))).expect("jpeg-decoder worker thread error"); - Ok(rx.recv().expect("jpeg-decoder worker thread error")) - } -} diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.22/.cargo-checksum.json b/third_party/cargo/vendor/jpeg-decoder-0.1.22/.cargo-checksum.json new file mode 100644 index 0000000..848b38c --- /dev/null +++ b/third_party/cargo/vendor/jpeg-decoder-0.1.22/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"e1e0ad408223109830cbc1bd3197476958c681b40c6bef1b6179ce281891f028","Cargo.lock":"3bda7fe5bb104c2a6657fa2f279f2d7074f40cd8b52acf32fda8e037d1cf30d4","Cargo.toml":"dfed633f8171de7bcb4df464169f873b1737ace3804d24598b5cbf2518af4e4c","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"22b83fb92a50418c7df9564b9c179fa2a0e74f293bc58b72dd7e218fc0902143","README.md":"fc5c09eb92c453ff778ee5fa585d7509dcf36e3499c2e560a8922d38c0d4c651","appveyor.yml":"5861c1d97075d4a09aea38b0ade35c0a03498f41cdc4f8754122b3793ddb6493","benches/decoding_benchmark.rs":"047d3ac829ae15d931922f2ebeb614fdbf09994bd144e255f7800fa92b627ea8","benches/tower.jpg":"40b5ae0df66540ba3ac60edf2840b4b8edd0500706105f3b63083e3a8993119a","benches/tower_grayscale.jpg":"90519862a5bc59ca5702ff802a2f16e8cdcd28b124f891bb03556b920742d94e","benches/tower_progressive.jpg":"e87bac231e2c11b1aef6981358189ad5c51f67069a43131b1512ed823a7607c6","examples/decode.rs":"6526ad8c03f230c96f2f2fb10a2cba01fc367e98c59ab5f5433d0fab4bf41bbf","src/decoder.rs":"355f03d7a60d3b374bea0c8b11d206d46aa471e455f997dd153ad7e54f0ad1af","src/error.rs":"6c6592579922a930001bea37ec32c3f7b135210df06ec055b9bbd3b6527723f7","src/huffman.rs":"d53076356a1d7083b51656ef13d186a4fd26cf522670f6d9de181f9b97fbf4c5","src/idct.rs":"488500993b42f6dea09c13d437cc8679e0113f0092bfd61c25f025b0639c3254","src/lib.rs":"092bfa6a18a48e4af1acc9b4383cbc1449400c26fab17cf8a3dd5edcc32c7bcc","src/marker.rs":"315e7f87d81c70d1faaff7480c6288ed1e970fcc0fa6328410aca216d67b0139","src/parser.rs":"8be4fdae9d95f7dee931fdf390df31fa0127bb70397d0c2fb50fbf8db6d3701a","src/upsampler.rs":"0a6e9bb73d92a8204f9f5fd57e775954a4b041a41485fd68c02b21b38b036583","src/worker/immediate.rs":"9953ea2274c5380fd83f65d639d55a80f1f48080b57917208094f82e2e6bb60f","src/worker/mod.rs":"91734e4dc62f6e19bff1afaf4b0f73f263e8813a824093e26b4254d52779d1b0","src/worker/multithreaded.rs":"92de20edb0b337ca60cec75872a4ecf89484296cfb2dc24c92bd1d753e734ae3"},"package":"229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2"} \ No newline at end of file diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/BUILD.bazel b/third_party/cargo/vendor/jpeg-decoder-0.1.22/BUILD.bazel similarity index 93% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/BUILD.bazel rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/BUILD.bazel index 41b06be..36b06c2 100644 --- a/third_party/cargo/vendor/jpeg-decoder-0.1.20/BUILD.bazel +++ b/third_party/cargo/vendor/jpeg-decoder-0.1.22/BUILD.bazel @@ -51,10 +51,9 @@ rust_library( "cargo-raze", "manual", ], - version = "0.1.20", + version = "0.1.22", # buildifier: leave-alone deps = [ - "//third_party/cargo/vendor/byteorder-1.3.4:byteorder", "//third_party/cargo/vendor/rayon-1.5.0:rayon", ], ) diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/CHANGELOG.md b/third_party/cargo/vendor/jpeg-decoder-0.1.22/CHANGELOG.md similarity index 89% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/CHANGELOG.md rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/CHANGELOG.md index d11a410..3379031 100644 --- a/third_party/cargo/vendor/jpeg-decoder-0.1.20/CHANGELOG.md +++ b/third_party/cargo/vendor/jpeg-decoder-0.1.22/CHANGELOG.md @@ -4,6 +4,18 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## Unreleased +## v0.1.22 (2021-01-27) + +- Fix panic on jpeg without frames. + +## v0.1.21 (2021-01-23) + +- Fix incorrect order of MCUs in non-interleaved streams +- DCT Progressive images with incomplete coefficient blocks are now rendered +- Fix a panic on invalid dimensions +- Reduce allocations and runtime of decoding +- Rework multi-threading to run a thread per component + ## v0.1.20 (2020-07-04) - Fix decoding of some progressive images failing diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.22/Cargo.lock b/third_party/cargo/vendor/jpeg-decoder-0.1.22/Cargo.lock new file mode 100644 index 0000000..c64f4b5 --- /dev/null +++ b/third_party/cargo/vendor/jpeg-decoder-0.1.22/Cargo.lock @@ -0,0 +1,636 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adler32" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" + +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "bstr" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931" +dependencies = [ + "lazy_static", + "memchr", + "regex-automata", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" + +[[package]] +name = "byteorder" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" + +[[package]] +name = "cast" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" +dependencies = [ + "rustc_version", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "clap" +version = "2.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" +dependencies = [ + "bitflags", + "textwrap", + "unicode-width", +] + +[[package]] +name = "crc32fast" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "criterion" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63f696897c88b57f4ffe3c69d8e1a0613c7d0e6c4833363c8560fbde9c47b966" +dependencies = [ + "atty", + "cast", + "clap", + "criterion-plot", + "csv", + "itertools", + "lazy_static", + "num-traits", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddeaf7989f00f2e1d871a26a110f3ed713632feac17f65f03ca938c542618b60" +dependencies = [ + "cast", + "itertools", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3aa945d63861bfe624b55d153a39684da1e8c0bc8fba932f7ee3a3c16cea3ca" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" +dependencies = [ + "autocfg 0.1.7", + "cfg-if", + "crossbeam-utils", + "lazy_static", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfd6515864a82d2f877b42813d4553292c6659498c9a2aa31bab5a15243c2700" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" +dependencies = [ + "autocfg 0.1.7", + "cfg-if", + "lazy_static", +] + +[[package]] +name = "csv" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" +dependencies = [ + "bstr", + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +dependencies = [ + "memchr", +] + +[[package]] +name = "deflate" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e5d2a2273fed52a7f947ee55b092c4057025d7a3e04e5ecdbd25d6c3fb1bd7" +dependencies = [ + "adler32", + "byteorder", +] + +[[package]] +name = "either" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" + +[[package]] +name = "hermit-abi" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9586eedd4ce6b3c498bc3b4dd92fc9f11166aa908a914071953768066c67909" +dependencies = [ + "libc", +] + +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" + +[[package]] +name = "jpeg-decoder" +version = "0.1.22" +dependencies = [ + "criterion", + "png", + "rayon", + "walkdir", +] + +[[package]] +name = "js-sys" +version = "0.3.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce10c23ad2ea25ceca0093bd3192229da4c5b3c0f2de499c1ecac0d98d452177" +dependencies = [ + "wasm-bindgen", +] + +[[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.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" + +[[package]] +name = "log" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "memchr" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" + +[[package]] +name = "memoffset" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" +dependencies = [ + "rustc_version", +] + +[[package]] +name = "miniz_oxide" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" +dependencies = [ + "adler32", +] + +[[package]] +name = "num-traits" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" +dependencies = [ + "autocfg 1.0.0", +] + +[[package]] +name = "num_cpus" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "oorandom" +version = "11.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a170cebd8021a008ea92e4db85a72f80b35df514ec664b296fdcbb654eac0b2c" + +[[package]] +name = "plotters" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d1685fbe7beba33de0330629da9d955ac75bd54f33d7b79f9a895590124f6bb" +dependencies = [ + "js-sys", + "num-traits", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "png" +version = "0.16.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ccdd66f6fe4b2433b07e4728e9a013e43233120427046e93ceb709c3a439bf" +dependencies = [ + "bitflags", + "crc32fast", + "deflate", + "miniz_oxide", +] + +[[package]] +name = "proc-macro2" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rayon" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" +dependencies = [ + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" +dependencies = [ + "crossbeam-deque", + "crossbeam-queue", + "crossbeam-utils", + "lazy_static", + "num_cpus", +] + +[[package]] +name = "regex" +version = "1.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +dependencies = [ + "byteorder", +] + +[[package]] +name = "regex-syntax" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" + +[[package]] +name = "same-file" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "serde" +version = "1.0.112" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736aac72d1eafe8e5962d1d1c3d99b0df526015ba40915cb3c49d042e92ec243" + +[[package]] +name = "serde_derive" +version = "1.0.112" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf0343ce212ac0d3d6afd9391ac8e9c9efe06b533c8d33f660f6390cc4093f57" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec2c5d7e739bc07a3e73381a39d61fdb5f671c60c1df26a130690665803d8226" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "syn" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5304cfdf27365b7585c25d4af91b35016ed21ef88f17ced89c7093b43dba8b6" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "tinytemplate" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d3dc76004a03cec1c5932bca4cdc2e39aaa798e3f82363dd94f9adf6098c12f" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "unicode-width" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" + +[[package]] +name = "unicode-xid" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" + +[[package]] +name = "walkdir" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c2dc4aa152834bc334f506c1a06b866416a8b6697d5c9f75b9a689c8486def0" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded84f06e0ed21499f6184df0e0cb3494727b0c5da89534e0fcc55c51d812101" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "838e423688dac18d73e31edce74ddfac468e37b1506ad163ffaf0a46f703ffe3" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3156052d8ec77142051a533cdd686cba889537b213f948cd1d20869926e68e92" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9ba19973a58daf4db6f352eda73dc0e289493cd29fb2632eb172085b6521acd" + +[[package]] +name = "web-sys" +version = "0.3.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b72fe77fd39e4bd3eaa4412fd299a0be6b3dfe9d2597e2f1c20beb968f41d17" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" +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" diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/Cargo.toml b/third_party/cargo/vendor/jpeg-decoder-0.1.22/Cargo.toml similarity index 94% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/Cargo.toml rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/Cargo.toml index 8585d14..2c87a88 100644 --- a/third_party/cargo/vendor/jpeg-decoder-0.1.20/Cargo.toml +++ b/third_party/cargo/vendor/jpeg-decoder-0.1.22/Cargo.toml @@ -12,7 +12,7 @@ [package] name = "jpeg-decoder" -version = "0.1.20" +version = "0.1.22" authors = ["Ulf Nilsson "] exclude = ["tests/*"] description = "JPEG decoder" @@ -25,9 +25,6 @@ repository = "https://github.com/image-rs/jpeg-decoder" [[bench]] name = "decoding_benchmark" harness = false -[dependencies.byteorder] -version = "1.0" - [dependencies.rayon] version = "1.0" optional = true diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/LICENSE-APACHE b/third_party/cargo/vendor/jpeg-decoder-0.1.22/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/LICENSE-APACHE rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/LICENSE-APACHE diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/LICENSE-MIT b/third_party/cargo/vendor/jpeg-decoder-0.1.22/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/LICENSE-MIT rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/LICENSE-MIT diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/README.md b/third_party/cargo/vendor/jpeg-decoder-0.1.22/README.md similarity index 100% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/README.md rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/README.md diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/appveyor.yml b/third_party/cargo/vendor/jpeg-decoder-0.1.22/appveyor.yml similarity index 100% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/appveyor.yml rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/appveyor.yml diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/benches/decoding_benchmark.rs b/third_party/cargo/vendor/jpeg-decoder-0.1.22/benches/decoding_benchmark.rs similarity index 100% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/benches/decoding_benchmark.rs rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/benches/decoding_benchmark.rs diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/benches/tower.jpg b/third_party/cargo/vendor/jpeg-decoder-0.1.22/benches/tower.jpg similarity index 100% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/benches/tower.jpg rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/benches/tower.jpg diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/benches/tower_grayscale.jpg b/third_party/cargo/vendor/jpeg-decoder-0.1.22/benches/tower_grayscale.jpg similarity index 100% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/benches/tower_grayscale.jpg rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/benches/tower_grayscale.jpg diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/benches/tower_progressive.jpg b/third_party/cargo/vendor/jpeg-decoder-0.1.22/benches/tower_progressive.jpg similarity index 100% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/benches/tower_progressive.jpg rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/benches/tower_progressive.jpg diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/examples/decode.rs b/third_party/cargo/vendor/jpeg-decoder-0.1.22/examples/decode.rs similarity index 100% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/examples/decode.rs rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/examples/decode.rs diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/decoder.rs b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/decoder.rs similarity index 79% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/src/decoder.rs rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/src/decoder.rs index 55a4f0b..dca4982 100644 --- a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/decoder.rs +++ b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/decoder.rs @@ -1,9 +1,10 @@ -use byteorder::ReadBytesExt; +use crate::read_u8; use error::{Error, Result, UnsupportedFeature}; use huffman::{fill_default_mjpeg_tables, HuffmanDecoder, HuffmanTable}; use marker::Marker; use parser::{AdobeColorTransform, AppData, CodingProcess, Component, Dimensions, EntropyCoding, FrameInfo, - parse_app, parse_com, parse_dht, parse_dqt, parse_dri, parse_sof, parse_sos, ScanInfo}; + parse_app, parse_com, parse_dht, parse_dqt, parse_dri, parse_sof, parse_sos, IccChunk, + ScanInfo}; use upsampler::Upsampler; use std::cmp; use std::io::Read; @@ -72,6 +73,8 @@ pub struct Decoder { is_jfif: bool, is_mjpeg: bool, + icc_markers: Vec, + // Used for progressive JPEGs. coefficients: Vec>, // Bitmask of which coefficients has been completely decoded. @@ -91,6 +94,7 @@ impl Decoder { color_transform: None, is_jfif: false, is_mjpeg: false, + icc_markers: Vec::new(), coefficients: Vec::new(), coefficients_finished: [0; MAX_COMPONENTS], } @@ -120,6 +124,39 @@ impl Decoder { } } + /// Returns the embeded icc profile if the image contains one. + pub fn icc_profile(&self) -> Option> { + let mut marker_present: [Option<&IccChunk>; 256] = [None; 256]; + let num_markers = self.icc_markers.len(); + if num_markers == 0 && num_markers < 256 { + return None; + } + // check the validity of the markers + for chunk in &self.icc_markers { + if usize::from(chunk.num_markers) != num_markers { + // all the lengths must match + return None; + } + if chunk.seq_no == 0 { + return None; + } + if marker_present[usize::from(chunk.seq_no)].is_some() { + // duplicate seq_no + return None; + } else { + marker_present[usize::from(chunk.seq_no)] = Some(chunk); + } + } + + // assemble them together by seq_no failing if any are missing + let mut data = Vec::new(); + // seq_no's start at 1 + for &chunk in marker_present.get(1..=num_markers)? { + data.extend_from_slice(&chunk?.data); + } + Some(data) + } + /// Tries to read metadata from the image without decoding it. /// /// If successful, the metadata can be obtained using the `info` method. @@ -128,19 +165,19 @@ impl Decoder { } /// Configure the decoder to scale the image during decoding. - /// + /// /// This efficiently scales the image by the smallest supported scale /// factor that produces an image larger than or equal to the requested /// size in at least one axis. The currently implemented scale factors /// are 1/8, 1/4, 1/2 and 1. - /// + /// /// To generate a thumbnail of an exact size, pass the desired size and /// then scale to the final size using a traditional resampling algorithm. pub fn scale(&mut self, requested_width: u16, requested_height: u16) -> Result<(u16, u16)> { self.read_info()?; let frame = self.frame.as_mut().unwrap(); let idct_size = crate::idct::choose_idct_size(frame.image_size, Dimensions{ width: requested_width, height: requested_height }); - frame.update_idct_size(idct_size); + frame.update_idct_size(idct_size)?; Ok((frame.output_size.width, frame.output_size.height)) } @@ -154,8 +191,8 @@ impl Decoder { // The metadata has already been read. return Ok(Vec::new()); } - else if self.frame.is_none() && (self.reader.read_u8()? != 0xFF || Marker::from_u8(self.reader.read_u8()?) != Some(Marker::SOI)) { - return Err(Error::Format("first two bytes is not a SOI marker".to_owned())); + else if self.frame.is_none() && (read_u8(&mut self.reader)? != 0xFF || Marker::from_u8(read_u8(&mut self.reader)?) != Some(Marker::SOI)) { + return Err(Error::Format("first two bytes are not an SOI marker".to_owned())); } let mut previous_marker = Marker::SOI; @@ -196,9 +233,6 @@ impl Decoder { if frame.precision != 8 { return Err(Error::Unsupported(UnsupportedFeature::SamplePrecision(frame.precision))); } - if frame.image_size.height == 0 { - return Err(Error::Unsupported(UnsupportedFeature::DNL)); - } if component_count != 1 && component_count != 3 && component_count != 4 { return Err(Error::Unsupported(UnsupportedFeature::ComponentCount(component_count as u8))); } @@ -339,6 +373,7 @@ impl Decoder { self.is_jfif = true; }, AppData::Avi1 => self.is_mjpeg = true, + AppData::Icc(icc) => self.icc_markers.push(icc), } } }, @@ -374,11 +409,51 @@ impl Decoder { previous_marker = marker; } - if planes.is_empty() || planes.iter().any(|plane| plane.is_empty()) { - return Err(Error::Format("no data found".to_owned())); + if self.frame.is_none() { + return Err(Error::Format("end of image encountered before frame".to_owned())); } let frame = self.frame.as_ref().unwrap(); + + // If we're decoding a progressive jpeg and a component is unfinished, render what we've got + if frame.coding_process == CodingProcess::DctProgressive && self.coefficients.len() == frame.components.len() { + for (i, component) in frame.components.iter().enumerate() { + // Only dealing with unfinished components + if self.coefficients_finished[i] == !0 { + continue; + } + + let quantization_table = match self.quantization_tables[component.quantization_table_index].clone() { + Some(quantization_table) => quantization_table, + None => continue, + }; + + // Get the worker prepared + if worker.is_none() { + worker = Some(PlatformWorker::new()?); + } + let worker = worker.as_mut().unwrap(); + let row_data = RowData { + index: i, + component: component.clone(), + quantization_table, + }; + worker.start(row_data)?; + + // Send the rows over to the worker and collect the result + let coefficients_per_mcu_row = usize::from(component.block_size.width) * usize::from(component.vertical_sampling_factor) * 64; + for mcu_y in 0..frame.mcu_size.height { + let row_coefficients = { + let offset = usize::from(mcu_y) * coefficients_per_mcu_row; + self.coefficients[i][offset .. offset + coefficients_per_mcu_row].to_vec() + }; + + worker.append_row((i, row_coefficients))?; + } + planes[i] = worker.get_result(i)?; + } + } + compute_image(&frame.components, planes, frame.output_size, self.is_jfif, self.color_transform) } @@ -388,21 +463,21 @@ impl Decoder { // libjpeg allows this though and there are images in the wild utilising it, so we are // forced to support this behavior. // Sony Ericsson P990i is an example of a device which produce this sort of JPEGs. - while self.reader.read_u8()? != 0xFF {} + while read_u8(&mut self.reader)? != 0xFF {} // Section B.1.1.2 // All markers are assigned two-byte codes: an X’FF’ byte followed by a // byte which is not equal to 0 or X’FF’ (see Table B.1). Any marker may // optionally be preceded by any number of fill bytes, which are bytes // assigned code X’FF’. - let mut byte = self.reader.read_u8()?; + let mut byte = read_u8(&mut self.reader)?; // Section B.1.1.2 // "Any marker may optionally be preceded by any number of fill bytes, which are bytes assigned code X’FF’." while byte == 0xFF { - byte = self.reader.read_u8()?; + byte = read_u8(&mut self.reader)?; } - + if byte != 0x00 && byte != 0xFF { return Ok(Marker::from_u8(byte).unwrap()); } @@ -453,9 +528,6 @@ impl Decoder { } } - let blocks_per_mcu: Vec = components.iter() - .map(|c| c.horizontal_sampling_factor as u16 * c.vertical_sampling_factor as u16) - .collect(); let is_progressive = frame.coding_process == CodingProcess::DctProgressive; let is_interleaved = components.len() > 1; let mut dummy_block = [0i16; 64]; @@ -473,70 +545,37 @@ impl Decoder { } } - for mcu_y in 0 .. frame.mcu_size.height { - for mcu_x in 0 .. frame.mcu_size.width { - for (i, component) in components.iter().enumerate() { - for j in 0 .. blocks_per_mcu[i] { - let (block_x, block_y) = if is_interleaved { - // Section A.2.3 - (mcu_x * component.horizontal_sampling_factor as u16 + j % component.horizontal_sampling_factor as u16, - mcu_y * component.vertical_sampling_factor as u16 + j / component.horizontal_sampling_factor as u16) - } - else { - // Section A.2.2 + // 4.8.2 + // When reading from the stream, if the data is non-interleaved then an MCU consists of + // exactly one block (effectively a 1x1 sample). + let (mcu_horizontal_samples, mcu_vertical_samples) = if is_interleaved { + let horizontal = components.iter().map(|component| component.horizontal_sampling_factor as u16).collect::>(); + let vertical = components.iter().map(|component| component.vertical_sampling_factor as u16).collect::>(); + (horizontal, vertical) + } else { + (vec![1], vec![1]) + }; - let blocks_per_row = component.block_size.width as usize; - let block_num = (mcu_y as usize * frame.mcu_size.width as usize + - mcu_x as usize) * blocks_per_mcu[i] as usize + j as usize; + // This also affects how many MCU values we read from stream. If it's a non-interleaved stream, + // the MCUs will be exactly the block count. + let (max_mcu_x, max_mcu_y) = if is_interleaved { + (frame.mcu_size.width, frame.mcu_size.height) + } else { + (components[0].block_size.width, components[0].block_size.height) + }; - let x = (block_num % blocks_per_row) as u16; - let y = (block_num / blocks_per_row) as u16; + for mcu_y in 0..max_mcu_y { + if mcu_y * 8 >= frame.image_size.height { + break; + } - if x * component.dct_scale as u16 >= component.size.width || y * component.dct_scale as u16 >= component.size.height { - continue; - } - - (x, y) - }; - - let block_offset = (block_y as usize * component.block_size.width as usize + block_x as usize) * 64; - let mcu_row_offset = mcu_y as usize * component.block_size.width as usize * component.vertical_sampling_factor as usize * 64; - let coefficients = if is_progressive { - &mut self.coefficients[scan.component_indices[i]][block_offset .. block_offset + 64] - } else if finished[i] { - &mut mcu_row_coefficients[i][block_offset - mcu_row_offset .. block_offset - mcu_row_offset + 64] - } else { - &mut dummy_block[..] - }; - - if scan.successive_approximation_high == 0 { - decode_block(&mut self.reader, - coefficients, - &mut huffman, - self.dc_huffman_tables[scan.dc_table_indices[i]].as_ref(), - self.ac_huffman_tables[scan.ac_table_indices[i]].as_ref(), - scan.spectral_selection.clone(), - scan.successive_approximation_low, - &mut eob_run, - &mut dc_predictors[i])?; - } - else { - decode_block_successive_approximation(&mut self.reader, - coefficients, - &mut huffman, - self.ac_huffman_tables[scan.ac_table_indices[i]].as_ref(), - scan.spectral_selection.clone(), - scan.successive_approximation_low, - &mut eob_run)?; - } - } + for mcu_x in 0..max_mcu_x { + if mcu_x * 8 >= frame.image_size.width { + break; } if self.restart_interval > 0 { - let is_last_mcu = mcu_x == frame.mcu_size.width - 1 && mcu_y == frame.mcu_size.height - 1; - mcus_left_until_restart -= 1; - - if mcus_left_until_restart == 0 && !is_last_mcu { + if mcus_left_until_restart == 0 { match huffman.take_marker(&mut self.reader)? { Some(Marker::RST(n)) => { if n != expected_rst_num { @@ -556,16 +595,86 @@ impl Decoder { None => return Err(Error::Format(format!("no marker found where RST{} was expected", expected_rst_num))), } } + + mcus_left_until_restart -= 1; + } + + for (i, component) in components.iter().enumerate() { + for v_pos in 0..mcu_vertical_samples[i] { + for h_pos in 0..mcu_horizontal_samples[i] { + let coefficients = if is_progressive { + let block_y = (mcu_y * mcu_vertical_samples[i] + v_pos) as usize; + let block_x = (mcu_x * mcu_horizontal_samples[i] + h_pos) as usize; + let block_offset = (block_y * component.block_size.width as usize + block_x) * 64; + &mut self.coefficients[scan.component_indices[i]][block_offset..block_offset + 64] + } else if finished[i] { + // Because the worker thread operates in batches as if we were always interleaved, we + // need to distinguish between a single-shot buffer and one that's currently in process + // (for a non-interleaved) stream + let mcu_batch_current_row = if is_interleaved { + 0 + } else { + mcu_y % component.vertical_sampling_factor as u16 + }; + + let block_y = (mcu_batch_current_row * mcu_vertical_samples[i] + v_pos) as usize; + let block_x = (mcu_x * mcu_horizontal_samples[i] + h_pos) as usize; + let block_offset = (block_y * component.block_size.width as usize + block_x) * 64; + &mut mcu_row_coefficients[i][block_offset..block_offset + 64] + } else { + &mut dummy_block[..] + }; + + if scan.successive_approximation_high == 0 { + decode_block(&mut self.reader, + coefficients, + &mut huffman, + self.dc_huffman_tables[scan.dc_table_indices[i]].as_ref(), + self.ac_huffman_tables[scan.ac_table_indices[i]].as_ref(), + scan.spectral_selection.clone(), + scan.successive_approximation_low, + &mut eob_run, + &mut dc_predictors[i])?; + } + else { + decode_block_successive_approximation(&mut self.reader, + coefficients, + &mut huffman, + self.ac_huffman_tables[scan.ac_table_indices[i]].as_ref(), + scan.spectral_selection.clone(), + scan.successive_approximation_low, + &mut eob_run)?; + } + } + } } } // Send the coefficients from this MCU row to the worker thread for dequantization and idct. for (i, component) in components.iter().enumerate() { if finished[i] { + // In the event of non-interleaved streams, if we're still building the buffer out, + // keep going; don't send it yet. We also need to ensure we don't skip over the last + // row(s) of the image. + if !is_interleaved && (mcu_y + 1) * 8 < frame.image_size.height { + if (mcu_y + 1) % component.vertical_sampling_factor as u16 > 0 { + continue; + } + } + let coefficients_per_mcu_row = component.block_size.width as usize * component.vertical_sampling_factor as usize * 64; let row_coefficients = if is_progressive { - let offset = mcu_y as usize * coefficients_per_mcu_row; + // Because non-interleaved streams will have multiple MCU rows concatenated together, + // the row for calculating the offset is different. + let worker_mcu_y = if is_interleaved { + mcu_y + } else { + // Explicitly doing floor-division here + mcu_y / component.vertical_sampling_factor as u16 + }; + + let offset = worker_mcu_y as usize * coefficients_per_mcu_row; self.coefficients[scan.component_indices[i]][offset .. offset + coefficients_per_mcu_row].to_vec() } else { mem::replace(&mut mcu_row_coefficients[i], vec![0i16; coefficients_per_mcu_row]) @@ -616,14 +725,11 @@ fn decode_block(reader: &mut R, let value = huffman.decode(reader, dc_table.unwrap())?; let diff = match value { 0 => 0, + 1..=11 => huffman.receive_extend(reader, value)?, _ => { // Section F.1.2.1.1 // Table F.1 - if value > 11 { - return Err(Error::Format("invalid DC difference magnitude category".to_owned())); - } - - huffman.receive_extend(reader, value)? + return Err(Error::Format("invalid DC difference magnitude category".to_owned())); }, }; @@ -812,8 +918,8 @@ fn compute_image(components: &[Component], output_size: Dimensions, is_jfif: bool, color_transform: Option) -> Result> { - if data.iter().any(|data| data.is_empty()) { - return Err(Error::Format("not all components has data".to_owned())); + if data.is_empty() || data.iter().any(Vec::is_empty) { + return Err(Error::Format("not all components have data".to_owned())); } if components.len() == 1 { @@ -911,7 +1017,7 @@ fn choose_color_convert_func(component_count: usize, match color_transform { Some(AdobeColorTransform::Unknown) => Ok(color_convert_line_cmyk), Some(_) => Ok(color_convert_line_ycck), - None => Err(Error::Format("4 components without Adobe APP14 metadata to tell color space".to_owned())), + None => Err(Error::Format("4 components without Adobe APP14 metadata to indicate color space".to_owned())), } }, _ => panic!(), @@ -974,6 +1080,5 @@ fn ycbcr_to_rgb(y: u8, cb: u8, cr: u8) -> (u8, u8, u8) { fn clamp_to_u8(value: i32) -> i32 { let value = std::cmp::max(value, 0); - let value = std::cmp::min(value, 255); - value + std::cmp::min(value, 255) } diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/error.rs b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/error.rs similarity index 100% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/src/error.rs rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/src/error.rs diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/huffman.rs b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/huffman.rs similarity index 97% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/src/huffman.rs rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/src/huffman.rs index 7502869..fff176f 100644 --- a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/huffman.rs +++ b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/huffman.rs @@ -1,9 +1,8 @@ -use byteorder::ReadBytesExt; +use crate::read_u8; use error::{Error, Result}; use marker::Marker; use parser::ScanInfo; use std::io::Read; -use std::iter::repeat; const LUT_BITS: u8 = 8; @@ -122,11 +121,11 @@ impl HuffmanDecoder { // Fill with zero bits if we have reached the end. let byte = match self.marker { Some(_) => 0, - None => reader.read_u8()?, + None => read_u8(reader)?, }; if byte == 0xFF { - let mut next_byte = reader.read_u8()?; + let mut next_byte = read_u8(reader)?; // Check for byte stuffing. if next_byte != 0x00 { @@ -137,7 +136,7 @@ impl HuffmanDecoder { // Section B.1.1.2 // "Any marker may optionally be preceded by any number of fill bytes, which are bytes assigned code X’FF’." while next_byte == 0xFF { - next_byte = reader.read_u8()?; + next_byte = read_u8(reader)?; } match next_byte { @@ -254,8 +253,7 @@ fn derive_huffman_codes(bits: &[u8; 16]) -> Result<(Vec, Vec)> { let huffsize = bits.iter() .enumerate() .fold(Vec::new(), |mut acc, (i, &value)| { - let mut repeated_size: Vec = repeat((i + 1) as u8).take(value as usize).collect(); - acc.append(&mut repeated_size); + acc.extend(std::iter::repeat((i + 1) as u8).take(value as usize)); acc }); diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/idct.rs b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/idct.rs similarity index 99% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/src/idct.rs rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/src/idct.rs index c457532..aac478e 100644 --- a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/idct.rs +++ b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/idct.rs @@ -2,10 +2,7 @@ // One example is tests/crashtest/images/imagetestsuite/b0b8914cc5f7a6eff409f16d8cc236c5.jpg // That's why wrapping operators are needed. use crate::parser::Dimensions; -use std::{ - convert::TryFrom, - num::Wrapping, -}; +use std::{convert::TryFrom, num::Wrapping}; pub(crate) fn choose_idct_size(full_size: Dimensions, requested_size: Dimensions) -> usize { fn scaled(len: u16, scale: usize) -> u16 { ((len as u32 * scale as u32 - 1) / 8 + 1) as u16 } @@ -16,7 +13,7 @@ pub(crate) fn choose_idct_size(full_size: Dimensions, requested_size: Dimensions } } - return 8; + 8 } #[test] @@ -54,7 +51,6 @@ pub fn dequantize_and_idct_block_8x8( output_linestride: usize, output: &mut [u8] ) { - debug_assert_eq!(coefficients.len(), 64); let output = output .chunks_mut(output_linestride); dequantize_and_idct_block_8x8_inner(coefficients, quantization_table, output) @@ -76,6 +72,9 @@ fn dequantize_and_idct_block_8x8_inner<'a, I>( output.len() ); + // optimizer hint to eliminate bounds checks within loops + assert!(coefficients.len() == 64); + let mut temp = [Wrapping(0); 64]; // columns diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/lib.rs b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/lib.rs similarity index 78% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/src/lib.rs rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/src/lib.rs index f79c1d9..a5e2b55 100644 --- a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/lib.rs +++ b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/lib.rs @@ -29,7 +29,6 @@ #![deny(missing_docs)] #![forbid(unsafe_code)] -extern crate byteorder; #[cfg(feature="rayon")] extern crate rayon; @@ -44,3 +43,15 @@ mod marker; mod parser; mod upsampler; mod worker; + +fn read_u8(reader: &mut R) -> std::io::Result { + let mut buf = [0]; + reader.read_exact(&mut buf)?; + Ok(buf[0]) +} + +fn read_u16_from_be(reader: &mut R) -> std::io::Result { + let mut buf = [0, 0]; + reader.read_exact(&mut buf)?; + Ok(u16::from_be_bytes(buf)) +} diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/marker.rs b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/marker.rs similarity index 100% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/src/marker.rs rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/src/marker.rs diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/parser.rs b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/parser.rs similarity index 88% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/src/parser.rs rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/src/parser.rs index 823778e..aac469f 100644 --- a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/parser.rs +++ b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/parser.rs @@ -1,5 +1,5 @@ -use byteorder::{BigEndian, ReadBytesExt}; -use error::{Error, Result}; +use crate::{read_u16_from_be, read_u8}; +use error::{Error, Result, UnsupportedFeature}; use huffman::{HuffmanTable, HuffmanTableClass}; use marker::Marker; use marker::Marker::*; @@ -70,6 +70,7 @@ pub enum AppData { Adobe(AdobeColorTransform), Jfif, Avi1, + Icc(IccChunk), } // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/JPEG.html#Adobe @@ -81,19 +82,27 @@ pub enum AdobeColorTransform { // YCbCrK YCCK, } +#[derive(Debug)] +pub struct IccChunk { + pub num_markers: u8, + pub seq_no: u8, + pub data: Vec, +} impl FrameInfo { - pub(crate) fn update_idct_size(&mut self, idct_size: usize) { + pub(crate) fn update_idct_size(&mut self, idct_size: usize) -> Result<()> { for component in &mut self.components { component.dct_scale = idct_size; } - update_component_sizes(self.image_size, &mut self.components); + update_component_sizes(self.image_size, &mut self.components)?; self.output_size = Dimensions { width: (self.image_size.width as f32 * idct_size as f32 / 8.0).ceil() as u16, height: (self.image_size.height as f32 * idct_size as f32 / 8.0).ceil() as u16 }; + + Ok(()) } } @@ -101,7 +110,7 @@ fn read_length(reader: &mut R, marker: Marker) -> Result { assert!(marker.has_length()); // length is including itself. - let length = reader.read_u16::()? as usize; + let length = usize::from(read_u16_from_be(reader)?); if length < 2 { return Err(Error::Format(format!("encountered {:?} with invalid length {}", marker, length))); @@ -147,7 +156,7 @@ pub fn parse_sof(reader: &mut R, marker: Marker) -> Result { _ => panic!(), }; - let precision = reader.read_u8()?; + let precision = read_u8(reader)?; match precision { 8 => {}, @@ -163,18 +172,21 @@ pub fn parse_sof(reader: &mut R, marker: Marker) -> Result { }, } - let height = reader.read_u16::()?; - let width = reader.read_u16::()?; + let height = read_u16_from_be(reader)?; + let width = read_u16_from_be(reader)?; // height: // "Value 0 indicates that the number of lines shall be defined by the DNL marker and // parameters at the end of the first scan (see B.2.5)." + if height == 0 { + return Err(Error::Unsupported(UnsupportedFeature::DNL)); + } if width == 0 { return Err(Error::Format("zero width in frame header".to_owned())); } - let component_count = reader.read_u8()?; + let component_count = read_u8(reader)?; if component_count == 0 { return Err(Error::Format("zero component count in frame header".to_owned())); @@ -190,14 +202,14 @@ pub fn parse_sof(reader: &mut R, marker: Marker) -> Result { let mut components: Vec = Vec::with_capacity(component_count as usize); for _ in 0 .. component_count { - let identifier = reader.read_u8()?; + let identifier = read_u8(reader)?; // Each component's identifier must be unique. if components.iter().any(|c| c.identifier == identifier) { return Err(Error::Format(format!("duplicate frame component identifier {}", identifier))); } - let byte = reader.read_u8()?; + let byte = read_u8(reader)?; let horizontal_sampling_factor = byte >> 4; let vertical_sampling_factor = byte & 0x0f; @@ -208,7 +220,7 @@ pub fn parse_sof(reader: &mut R, marker: Marker) -> Result { return Err(Error::Format(format!("invalid vertical sampling factor {}", vertical_sampling_factor))); } - let quantization_table_index = reader.read_u8()?; + let quantization_table_index = read_u8(reader)?; if quantization_table_index > 3 || (coding_process == CodingProcess::Lossless && quantization_table_index != 0) { return Err(Error::Format(format!("invalid quantization table index {}", quantization_table_index))); @@ -225,7 +237,7 @@ pub fn parse_sof(reader: &mut R, marker: Marker) -> Result { }); } - let mcu_size = update_component_sizes(Dimensions { width, height }, &mut components); + let mcu_size = update_component_sizes(Dimensions { width, height }, &mut components)?; Ok(FrameInfo { is_baseline: is_baseline, @@ -241,29 +253,33 @@ pub fn parse_sof(reader: &mut R, marker: Marker) -> Result { } /// Returns ceil(x/y), requires x>0 -fn ceil_div(x: u32, y: u32) -> u16 { - assert!(x>0 && y>0, "invalid dimensions"); - (1 + ((x - 1) / y)) as u16 +fn ceil_div(x: u32, y: u32) -> Result { + if x == 0 || y == 0 { + // TODO Determine how this error is reached. Can we validate input + // earlier and error out then? + return Err(Error::Format("invalid dimensions".to_owned())); + } + Ok((1 + ((x - 1) / y)) as u16) } -fn update_component_sizes(size: Dimensions, components: &mut [Component]) -> Dimensions { +fn update_component_sizes(size: Dimensions, components: &mut [Component]) -> Result { let h_max = components.iter().map(|c| c.horizontal_sampling_factor).max().unwrap() as u32; let v_max = components.iter().map(|c| c.vertical_sampling_factor).max().unwrap() as u32; let mcu_size = Dimensions { - width: ceil_div(size.width as u32, h_max * 8), - height: ceil_div(size.height as u32, v_max * 8), + width: ceil_div(size.width as u32, h_max * 8)?, + height: ceil_div(size.height as u32, v_max * 8)?, }; for component in components { - component.size.width = ceil_div(size.width as u32 * component.horizontal_sampling_factor as u32 * component.dct_scale as u32, h_max * 8); - component.size.height = ceil_div(size.height as u32 * component.vertical_sampling_factor as u32 * component.dct_scale as u32, v_max * 8); + component.size.width = ceil_div(size.width as u32 * component.horizontal_sampling_factor as u32 * component.dct_scale as u32, h_max * 8)?; + component.size.height = ceil_div(size.height as u32 * component.vertical_sampling_factor as u32 * component.dct_scale as u32, v_max * 8)?; component.block_size.width = mcu_size.width * component.horizontal_sampling_factor as u16; component.block_size.height = mcu_size.height * component.vertical_sampling_factor as u16; } - mcu_size + Ok(mcu_size) } #[test] @@ -279,7 +295,7 @@ fn test_update_component_sizes() { }]; let mcu = update_component_sizes( Dimensions { width: 800, height: 280 }, - &mut components); + &mut components).unwrap(); assert_eq!(mcu, Dimensions { width: 50, height: 18 }); assert_eq!(components[0].block_size, Dimensions { width: 100, height: 36 }); assert_eq!(components[0].size, Dimensions { width: 800, height: 280 }); @@ -292,7 +308,7 @@ pub fn parse_sos(reader: &mut R, frame: &FrameInfo) -> Result return Err(Error::Format("zero length in SOS".to_owned())); } - let component_count = reader.read_u8()?; + let component_count = read_u8(reader)?; if component_count == 0 || component_count > 4 { return Err(Error::Format(format!("invalid component count {} in scan header", component_count))); @@ -307,7 +323,7 @@ pub fn parse_sos(reader: &mut R, frame: &FrameInfo) -> Result let mut ac_table_indices = Vec::with_capacity(component_count as usize); for _ in 0 .. component_count { - let identifier = reader.read_u8()?; + let identifier = read_u8(reader)?; let component_index = match frame.components.iter().position(|c| c.identifier == identifier) { Some(value) => value, @@ -324,7 +340,7 @@ pub fn parse_sos(reader: &mut R, frame: &FrameInfo) -> Result return Err(Error::Format("the scan component order does not follow the order in the frame header".to_owned())); } - let byte = reader.read_u8()?; + let byte = read_u8(reader)?; let dc_table_index = byte >> 4; let ac_table_index = byte & 0x0f; @@ -348,10 +364,10 @@ pub fn parse_sos(reader: &mut R, frame: &FrameInfo) -> Result return Err(Error::Format("scan with more than one component and more than 10 blocks per MCU".to_owned())); } - let spectral_selection_start = reader.read_u8()?; - let spectral_selection_end = reader.read_u8()?; + let spectral_selection_start = read_u8(reader)?; + let spectral_selection_end = read_u8(reader)?; - let byte = reader.read_u8()?; + let byte = read_u8(reader)?; let successive_approximation_high = byte >> 4; let successive_approximation_low = byte & 0x0f; @@ -404,7 +420,7 @@ pub fn parse_dqt(reader: &mut R) -> Result<[Option<[u16; 64]>; 4]> { // Each DQT segment may contain multiple quantization tables. while length > 0 { - let byte = reader.read_u8()?; + let byte = read_u8(reader)?; let precision = (byte >> 4) as usize; let index = (byte & 0x0f) as usize; @@ -428,10 +444,10 @@ pub fn parse_dqt(reader: &mut R) -> Result<[Option<[u16; 64]>; 4]> { let mut table = [0u16; 64]; - for i in 0 .. 64 { - table[i] = match precision { - 0 => reader.read_u8()? as u16, - 1 => reader.read_u16::()?, + for item in table.iter_mut() { + *item = match precision { + 0 => u16::from(read_u8(reader)?), + 1 => read_u16_from_be(reader)?, _ => unreachable!(), }; } @@ -455,7 +471,7 @@ pub fn parse_dht(reader: &mut R, is_baseline: Option) -> Result<( // Each DHT segment may contain multiple huffman tables. while length > 17 { - let byte = reader.read_u8()?; + let byte = read_u8(reader)?; let class = byte >> 4; let index = (byte & 0x0f) as usize; @@ -511,7 +527,7 @@ pub fn parse_dri(reader: &mut R) -> Result { return Err(Error::Format("DRI with invalid length".to_owned())); } - Ok(reader.read_u16::()?) + Ok(read_u16_from_be(reader)?) } // Section B.2.4.5 @@ -545,7 +561,27 @@ pub fn parse_app(reader: &mut R, marker: Marker) -> Result { + if length > 14 { + let mut buffer = [0u8; 14]; + reader.read_exact(&mut buffer)?; + bytes_read = buffer.len(); + + // http://www.color.org/ICC_Minor_Revision_for_Web.pdf + // B.4 Embedding ICC profiles in JFIF files + if &buffer[0..12] == b"ICC_PROFILE\0" { + let mut data = vec![0; length - bytes_read]; + reader.read_exact(&mut data)?; + bytes_read += data.len(); + result = Some(AppData::Icc(IccChunk { + seq_no: buffer[12], + num_markers: buffer[13], + data, + })); + } + } + } APP(14) => { if length >= 12 { let mut buffer = [0u8; 12]; diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/upsampler.rs b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/upsampler.rs similarity index 99% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/src/upsampler.rs rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/src/upsampler.rs index 31224a5..1f05e0b 100644 --- a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/upsampler.rs +++ b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/upsampler.rs @@ -128,9 +128,7 @@ impl Upsample for UpsamplerH1V1 { output: &mut [u8]) { let input = &input[row * row_stride ..]; - for i in 0 .. output_width { - output[i] = input[i]; - } + output[..output_width].copy_from_slice(&input[..output_width]); } } diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/worker/immediate.rs b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/worker/immediate.rs similarity index 100% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/src/worker/immediate.rs rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/src/worker/immediate.rs diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/worker/mod.rs b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/worker/mod.rs similarity index 87% rename from third_party/cargo/vendor/jpeg-decoder-0.1.20/src/worker/mod.rs rename to third_party/cargo/vendor/jpeg-decoder-0.1.22/src/worker/mod.rs index f6fc019..44245ee 100644 --- a/third_party/cargo/vendor/jpeg-decoder-0.1.20/src/worker/mod.rs +++ b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/worker/mod.rs @@ -1,8 +1,8 @@ -mod threaded; mod immediate; +mod multithreaded; #[cfg(not(any(target_arch = "asmjs", target_arch = "wasm32")))] -pub use self::threaded::ThreadedWorker as PlatformWorker; +pub use self::multithreaded::MultiThreadedWorker as PlatformWorker; #[cfg(any(target_arch = "asmjs", target_arch = "wasm32"))] pub use self::immediate::ImmediateWorker as PlatformWorker; diff --git a/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/worker/multithreaded.rs b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/worker/multithreaded.rs new file mode 100644 index 0000000..c1e5046 --- /dev/null +++ b/third_party/cargo/vendor/jpeg-decoder-0.1.22/src/worker/multithreaded.rs @@ -0,0 +1,87 @@ +//! This module implements per-component parallelism. +//! It should be possible to implement per-row parallelism as well, +//! which should also boost performance of grayscale images +//! and allow scaling to more cores. +//! However, that would be more complex, so we use this as a starting point. + +use decoder::MAX_COMPONENTS; +use error::Result; +use std::{mem, sync::mpsc::{self, Sender}}; +use std::thread; +use super::{RowData, Worker}; +use super::immediate::ImmediateWorker; + +enum WorkerMsg { + Start(RowData), + AppendRow(Vec), + GetResult(Sender>), +} +pub struct MultiThreadedWorker { + senders: [Option>; MAX_COMPONENTS] +} + +impl Worker for MultiThreadedWorker { + fn new() -> Result { + Ok(MultiThreadedWorker { + senders: [None, None, None, None] + }) + } + fn start(&mut self, row_data: RowData) -> Result<()> { + // if there is no worker thread for this component yet, start one + let component = row_data.index; + if let None = self.senders[component] { + let sender = spawn_worker_thread(component)?; + self.senders[component] = Some(sender); + } + // we do the "take out value and put it back in once we're done" dance here + // and in all other message-passing methods because there's not that many rows + // and this should be cheaper than spawning MAX_COMPONENTS many threads up front + let sender = mem::replace(&mut self.senders[component], None).unwrap(); + sender.send(WorkerMsg::Start(row_data)).expect("jpeg-decoder worker thread error"); + self.senders[component] = Some(sender); + Ok(()) + } + fn append_row(&mut self, row: (usize, Vec)) -> Result<()> { + let component = row.0; + let sender = mem::replace(&mut self.senders[component], None).unwrap(); + sender.send(WorkerMsg::AppendRow(row.1)).expect("jpeg-decoder worker thread error"); + self.senders[component] = Some(sender); + Ok(()) + } + fn get_result(&mut self, index: usize) -> Result> { + let (tx, rx) = mpsc::channel(); + let sender = mem::replace(&mut self.senders[index], None).unwrap(); + sender.send(WorkerMsg::GetResult(tx)).expect("jpeg-decoder worker thread error"); + Ok(rx.recv().expect("jpeg-decoder worker thread error")) + } +} + +fn spawn_worker_thread(component: usize) -> Result> { + let thread_builder = thread::Builder::new().name(format!("worker thread for component {}", component)); + let (tx, rx) = mpsc::channel(); + + thread_builder.spawn(move || { + let mut worker = ImmediateWorker::new_immediate(); + + while let Ok(message) = rx.recv() { + match message { + WorkerMsg::Start(mut data) => { + // we always set component index to 0 for worker threads + // because they only ever handle one per thread and we don't want them + // to attempt to access nonexistent components + data.index = 0; + worker.start_immediate(data); + }, + WorkerMsg::AppendRow(row) => { + worker.append_row_immediate((0, row)); + }, + WorkerMsg::GetResult(chan) => { + let _ = chan.send(worker.get_result_immediate(0)); + break; + }, + } + } + })?; + + Ok(tx) +} \ No newline at end of file diff --git a/third_party/cargo/vendor/libc-0.2.82/.cargo-checksum.json b/third_party/cargo/vendor/libc-0.2.82/.cargo-checksum.json deleted file mode 100644 index 37fc20f..0000000 --- a/third_party/cargo/vendor/libc-0.2.82/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"CONTRIBUTING.md":"50547f85785c64798a3bb93515b795603a78fa131fb92c7e2d1e4d7b463eb829","Cargo.toml":"ec49783befd675ed3cc3544cc5912e04375669a7edc920ecabf830b356942b62","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"a8d47ff51ca256f56a8932dba07660672dbfe3004257ca8de708aac1415937a1","README.md":"73041c7dda55cca7e18bcaf115d28090c8d3c2373a19ecef82fadeab292a607b","build.rs":"e487789ca77b0015d75cecb253286d4a1406f11b1ae538929414fc0506842bef","rustfmt.toml":"8a654d5787585ca8f2c20580737336fc327f411a07b0dbd4870adf6e9bdf624f","src/cloudabi/aarch64.rs":"b8550bf1fd7344972aa4db29441486f39f31482d0327534981dbb75959c29114","src/cloudabi/arm.rs":"c197e2781c2839808bd6fcef219a29705b27b992d3ef920e9cf6ac96e2022bbf","src/cloudabi/mod.rs":"d5d4488e8c0b8227f516fe13810f550a2a72af3bdfe769200ad8687c8755bdf6","src/cloudabi/x86.rs":"33eb97f272d2201f3838ae74d444583c7de8f67856852ca375293b20bbd05636","src/cloudabi/x86_64.rs":"400d85d4fe39e26cf2e6ece9ee31c75fe9e88c4bcf4d836ca9f765c05c9c5be3","src/fixed_width_ints.rs":"34c60f12ec5eeb90f13ec3b954427532111c2446e69617616a97aefc1086a9f1","src/fuchsia/aarch64.rs":"378776a9e40766154a54c94c2a7b4675b5c302a38e6e42da99e67bfbaee60e56","src/fuchsia/align.rs":"ae1cf8f011a99737eabeb14ffff768e60f13b13363d7646744dbb0f443dab3d6","src/fuchsia/mod.rs":"5b7dcb9f9e44331bbcffbf9d879ae6371d7c524a23ed6a98d9352d73a3281c23","src/fuchsia/no_align.rs":"303f3f1b255e0088b5715094353cf00476131d8e94e6aebb3f469557771c8b8a","src/fuchsia/x86_64.rs":"93a3632b5cf67d2a6bcb7dc0a558605252d5fe689e0f38d8aa2ec5852255ac87","src/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/hermit/mod.rs":"d3bfce41e4463d4be8020a2d063c9bfa8b665f45f1cc6cbf3163f5d01e7cb21f","src/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/lib.rs":"8aeb4106f57e956eb51f7a8dd06f299695c8738cf8adc20ac786b524615cedb5","src/macros.rs":"7844312c233a6889fa15395fe3106f6a8f6229211104a92f33ea3c9536eef763","src/psp.rs":"a621e34d2d31d9b29c725897b846122acce4763ac2017a1fe2200b133e5ad064","src/sgx.rs":"16a95cdefc81c5ee00d8353a60db363c4cc3e0f75abcd5d0144723f2a306ed1b","src/switch.rs":"9da3dd39b3de45a7928789926e8572d00e1e11a39e6f7289a1349aadce90edba","src/unix/align.rs":"2cdc7c826ef7ae61f5171c5ae8c445a743d86f1a7f2d9d7e4ceeec56d6874f65","src/unix/bsd/apple/b32/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b32/mod.rs":"6a4ce300da0d2b0db04b18548286603ffe4b47d679a41cf60f1902895894aa1f","src/unix/bsd/apple/b64/aarch64/align.rs":"f0c321265dd7671f16106b84951ac7dd77ed2e65c6623cbf2d29e76531984770","src/unix/bsd/apple/b64/aarch64/mod.rs":"46d5d061c7a74cbc09cbdfb3bee9a600867bf4e04c0e4d0ca6c817e6033b32e1","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":"cc6878dd130c3f255418e4da74992ae9ba6a3cdb0530772de76c518077d3b12a","src/unix/bsd/apple/mod.rs":"071c4c59c4f8f60cc942ceecc98f05eaab2a34de71aa8d1a5e4813a799274c9c","src/unix/bsd/freebsdlike/dragonfly/errno.rs":"8295b8bb0dfd38d2cdb4d9192cdeeb534cc6c3b208170e64615fa3e0edb3e578","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"6b25421a27239d46983278d2f93d9e90dc125677b420c881a0b79e1b541584da","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"14f0bd6693967d4fedec904f7042bd51f2138cb843ec4df18c911b357417cdd2","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":"45d8ba0bdca685ea6bc0c601f60a0d39cb1513c3ccb57edc6bc9d97a46040f3b","src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs":"410b4ed9319274a08c4cbb8d84737e37c0f0d299b2271cc3b7a05d991fc4cc82","src/unix/bsd/freebsdlike/freebsd/mod.rs":"a583a4c1808febad62d1db3c8a599f52ae2e5900480f40f6fc0f502bb2cb5ddd","src/unix/bsd/freebsdlike/freebsd/powerpc64.rs":"2dae3ecc87eac3b11657aa98915def55fc4b5c0de11fe26aae23329a54628a9a","src/unix/bsd/freebsdlike/freebsd/x86.rs":"c5005e3249eb7c93cfbac72a9e9272320d80ce7983da990ceb05a447f59a02c5","src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs":"0e1f69a88fca1c32874b1daf5db3d446fefbe518dca497f096cc9168c39dde70","src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs":"6132aa0973454379674ea6cbc77e6eace1e1032dd9f38182071388a036f1bc08","src/unix/bsd/freebsdlike/mod.rs":"b6be7822a69713966c21efb879eb45f6f9e20c1b4342b524a587ed7350a5b063","src/unix/bsd/mod.rs":"dc1266cecc531375a10beb7721b77db4e390dde821eb4bb085369b16b6f519b0","src/unix/bsd/netbsdlike/mod.rs":"48dd60524119c1e09b255d5472d091e7e7b2b29eab04be51b4b1e740bd022859","src/unix/bsd/netbsdlike/netbsd/aarch64.rs":"b38fc046f9a40fea28bd26328b96629f4d5d63d7524936bd6af1865d401a8716","src/unix/bsd/netbsdlike/netbsd/arm.rs":"58cdbb70b0d6f536551f0f3bb3725d2d75c4690db12c26c034e7d6ec4a924452","src/unix/bsd/netbsdlike/netbsd/mod.rs":"a70f3c73b423bf44b06f16e44934ce3536517e60b3a4e256f41340a9e5dded40","src/unix/bsd/netbsdlike/netbsd/powerpc.rs":"ee7ff5d89d0ed22f531237b5059aa669df93a3b5c489fa641465ace8d405bf41","src/unix/bsd/netbsdlike/netbsd/sparc64.rs":"9489f4b3e4566f43bb12dfb92238960613dac7f6a45cc13068a8d152b902d7d9","src/unix/bsd/netbsdlike/netbsd/x86.rs":"20692320e36bfe028d1a34d16fe12ca77aa909cb02bda167376f98f1a09aefe7","src/unix/bsd/netbsdlike/netbsd/x86_64.rs":"135509edeaf3fb3f102d89d51ff1a8f82323497336a8dc7e1f0f23b5c2434b73","src/unix/bsd/netbsdlike/openbsd/aarch64.rs":"1dd5449dd1fd3d51e30ffdeeaece91d0aaf05c710e0ac699fecc5461cfa2c28e","src/unix/bsd/netbsdlike/openbsd/mod.rs":"0a64323d35bf7fa32ccfbce69733e958e97a5fc9abdc8d65d9415b619bbff31f","src/unix/bsd/netbsdlike/openbsd/sparc64.rs":"d04fd287afbaa2c5df9d48c94e8374a532a3ba491b424ddf018270c7312f4085","src/unix/bsd/netbsdlike/openbsd/x86.rs":"6f7f5c4fde2a2259eb547890cbd86570cea04ef85347d7569e94e679448bec87","src/unix/bsd/netbsdlike/openbsd/x86_64.rs":"e59b7fd65f68f8e857eec39e0c03bac1d3af6ddc26c9ba58494336b83659bb9b","src/unix/haiku/b32.rs":"69ae47fc52c6880e85416b4744500d5655c9ec6131cb737f3b649fceaadce15a","src/unix/haiku/b64.rs":"73e64db09275a8da8d50a13cce2cfa2b136036ddf3a930d2939f337fc995900b","src/unix/haiku/mod.rs":"8b8a62f392c23fe4fd1c334ca6c2828617ece19f0a59115d116d957fa348eb74","src/unix/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/unix/hermit/mod.rs":"2d8d3ce0299931199011bb73136bebbddf88edf7d263cc39d26dbfaaa1a14228","src/unix/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/unix/linux_like/android/b32/arm.rs":"155994121906903a2e0afad895f0b3b7546f6e54d6305a3336ce2c4dfafbfdfa","src/unix/linux_like/android/b32/mod.rs":"6b3fd3e1eb21e50d000f496729b40968b1c728f5f10d4fb18a9aef44bff383ff","src/unix/linux_like/android/b32/x86/align.rs":"812914e4241df82e32b12375ca3374615dc3a4bdd4cf31f0423c5815320c0dab","src/unix/linux_like/android/b32/x86/mod.rs":"5b1e9fcd77ca5f939acb7fb5f5da12f305b0377698d8b8989feb236e26360aa0","src/unix/linux_like/android/b64/aarch64/align.rs":"2179c3b1608fa4bf68840482bfc2b2fa3ee2faf6fcae3770f9e505cddca35c7b","src/unix/linux_like/android/b64/aarch64/mod.rs":"db23f94bc3ed46a0967dde748f0d4566fc885cc6171d0555007f3398ff99a708","src/unix/linux_like/android/b64/mod.rs":"c56f1213b01cbf63ec68810bf14b30490bd44d2d5b927ec439d45c8ec2cd282e","src/unix/linux_like/android/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/android/b64/x86_64/mod.rs":"e84176d838e663d351450bad218715db1fafbb531e47ea0e262cbb45829dae89","src/unix/linux_like/android/mod.rs":"1f7e382c01d1af765a617ac63a5164ce9cc45e2cc962191960d724b9df2c5508","src/unix/linux_like/emscripten/align.rs":"86c95cbed7a7161b1f23ee06843e7b0e2340ad92b2cb86fe2a8ef3e0e8c36216","src/unix/linux_like/emscripten/mod.rs":"0770f13ce30b98752d5e868332bf5a55bee8389108fe9d91cf2c2bf71c237093","src/unix/linux_like/emscripten/no_align.rs":"0128e4aa721a9902754828b61b5ec7d8a86619983ed1e0544a85d35b1051fad6","src/unix/linux_like/linux/align.rs":"213e70ebed2703e14a9cf17666b21ecbf180b7bff7fa22fdbb36dbbd52df326d","src/unix/linux_like/linux/gnu/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/gnu/b32/arm/align.rs":"3fed009dc9af3cc81be7087da9d2d7d1f39845e4497e290259c5cdbae25f039d","src/unix/linux_like/linux/gnu/b32/arm/mod.rs":"9e18ad197709bce3aab40537b6ea371ff13f3be7be1d50ff97964f937c517646","src/unix/linux_like/linux/gnu/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/gnu/b32/mips/mod.rs":"5cf043f5342c37b1cf50bc09de9baaa8d120a8827640f328a74ebbff1fe5aca0","src/unix/linux_like/linux/gnu/b32/mod.rs":"d86a7bb02f97a1129c870905c536769770dfb233184e4cff6b395ad512e5300b","src/unix/linux_like/linux/gnu/b32/powerpc.rs":"5457ff8f90fb777cfc3cbe6c0c6a3b3f8eaecb28e66fffc53390e82010030ebe","src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs":"7b2528fdcdbbfb5cd350b27a3f66a6950fb94be1c924c1156a1d93e8950496a1","src/unix/linux_like/linux/gnu/b32/sparc/align.rs":"21adbed27df73e2d1ed934aaf733a643003d7baf2bde9c48ea440895bcca6d41","src/unix/linux_like/linux/gnu/b32/sparc/mod.rs":"0a4aec7eb78dcac864ed33a2a0d60ae285c7572ec9e475828e158fa6f43593a3","src/unix/linux_like/linux/gnu/b32/x86/align.rs":"e4bafdc4a519a7922a81b37a62bbfd1177a2f620890eef8f1fbc47162e9eb413","src/unix/linux_like/linux/gnu/b32/x86/mod.rs":"b1005390da3ed2d95b612fdcc4b69f11165ce31cfbf50674fe877ed47ad1b431","src/unix/linux_like/linux/gnu/b64/aarch64/align.rs":"2179c3b1608fa4bf68840482bfc2b2fa3ee2faf6fcae3770f9e505cddca35c7b","src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs":"97b1d8a5a5bc3c8cd81c35ec8989002959983f674778e812f5b80ac6a3cdceac","src/unix/linux_like/linux/gnu/b64/mips64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/mips64/mod.rs":"e86403f310a14fc5355dd78746ac55056c91fa7cd3248d5d8a18430b4940cb2d","src/unix/linux_like/linux/gnu/b64/mod.rs":"b90d87f76bff37707a1725551fe45d70d0c106e01b1dbbcd5f60460e0a19b4c3","src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs":"8aaaa4d9a5f79a7413930632c47382e845789dd9a191dc8bf084c8041ee350b1","src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs":"b954a060f88cd03d0ca8bdeb864046230d0c52e2d2ab97394430f1356a357a82","src/unix/linux_like/linux/gnu/b64/s390x.rs":"818bdc54fdcb9d83190d78f31d0f4a082d06ded112ccb40daa1ab4c541ee58d5","src/unix/linux_like/linux/gnu/b64/sparc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs":"22e57216290614616c671f35e24e881d6fcf9839dbfa8d2833a1a77ada28d156","src/unix/linux_like/linux/gnu/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs":"c084edff71fa74f7ceb743c116f76a9996d311c06475d53b0de68958991e1b9b","src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs":"74deaf2135168fd8a8fe3382a443d3800b95ea833e94150b265cc59a24872166","src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs":"60ff6e9aca19226714cf0c7f58f4388f5f046cf099cc4f61f9a2913d94d7e846","src/unix/linux_like/linux/gnu/mod.rs":"e3da1c79d1f0c0c2bf022f2667c9b55d5cf8907bc0c5e8668d3cc95f8ac204d3","src/unix/linux_like/linux/gnu/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/mod.rs":"3f7e58dd79738ab1cf0724cc2239a259fccc4429cb0b2106cdef1b7a101ed1c8","src/unix/linux_like/linux/musl/b32/arm/align.rs":"3e8ac052c1043764776b54c93ba4260e061df998631737a897d9d47d54f7b80c","src/unix/linux_like/linux/musl/b32/arm/mod.rs":"4269bfda82f0af7bb849f74d381bfadc61e1d1eec86b9506cee5c3ba13c9490a","src/unix/linux_like/linux/musl/b32/hexagon.rs":"7c6c481f70da1fe6ca759f363784e130041f3d87906c45910fc1142b5ef17970","src/unix/linux_like/linux/musl/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/musl/b32/mips/mod.rs":"f7adecc4a36b4eb484c168b6c21e73f02ee23f607c0a0351f773f9d9c83b8400","src/unix/linux_like/linux/musl/b32/mod.rs":"8ede3985e6243882814ce91e8ce543e7edbafc0cee5932816072b6f14207a671","src/unix/linux_like/linux/musl/b32/powerpc.rs":"cf286cbf4d2076aaa82662ace2b5c333480410fa59af5cb4542d59f04da84b31","src/unix/linux_like/linux/musl/b32/x86/align.rs":"08e77fbd7435d7dec2ff56932433bece3f02e47ce810f89004a275a86d39cbe1","src/unix/linux_like/linux/musl/b32/x86/mod.rs":"014a3854f2dc8f8e0d10ab78193b1c4ce827cae84e5ecdac16b2bd7fa39cbce5","src/unix/linux_like/linux/musl/b64/aarch64/align.rs":"798a9229d70ce235394f2dd625f6c4c1e10519a94382dc5b091952b638ae2928","src/unix/linux_like/linux/musl/b64/aarch64/mod.rs":"9870fd9a953c98b775c9e17a29a66bbe8019a6236eb69a0272f42232a226521d","src/unix/linux_like/linux/musl/b64/mips64.rs":"4bfd8ee1f22a163a7037e1e401d143573bcb14cc3321da0698528e9c0b68c81a","src/unix/linux_like/linux/musl/b64/mod.rs":"8b76e92a1505ad785d4aa0b7739e0b93647a1e81910949b49cedb6c88468be9c","src/unix/linux_like/linux/musl/b64/powerpc64.rs":"ed9b879bb9cdc526ad83815875edeb4cad4e8829086dfba2578277c265336229","src/unix/linux_like/linux/musl/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/musl/b64/x86_64/mod.rs":"4c9fd4792b575a5b90d909c0e60283b705a51fa38bce13eab068645e34321f1f","src/unix/linux_like/linux/musl/mod.rs":"f89babf227c1e021dff04f39fb4e4cd71b8f7fa598ae8b336b8b2deb10ff38f9","src/unix/linux_like/linux/no_align.rs":"5ed04c53bf9d27da9b4d65ba7625c6ac53330162683d1b3df98950caafa3507b","src/unix/linux_like/mod.rs":"e65c49d9ee229aee11118758e36beebd90629e2e0c59647786cb0e472837d705","src/unix/mod.rs":"7e8e10e956ae38e5829720df90db4133ec0433d3bf53c83b02c5534d47c9dc02","src/unix/newlib/aarch64/mod.rs":"bb269c1468a9676442554600e87417079a787fe6220dfc23b3109639259e8710","src/unix/newlib/align.rs":"28aaf87fafbc6b312622719d472d8cf65f9e5467d15339df5f73e66d8502b28a","src/unix/newlib/arm/mod.rs":"c71be856bfd7f576b2db28af9f680211cbe6c1cac7d537bbc8020b39591af07c","src/unix/newlib/mod.rs":"2f771ab23df36ab0c7a117e854483a917aaf9c5cbb9eded1bdda35827cdaf734","src/unix/newlib/no_align.rs":"7123dcec13604a11b7765c380ff3a4d0da19c39f4b03919de7857723c0cf1502","src/unix/newlib/powerpc/mod.rs":"2d0f7af28b47f7a2a6c210ebd1c1f33ed8eac62e56b5af2b856de2ad3fdc5187","src/unix/newlib/xtensa/mod.rs":"4c72003c5e692e648c7e798358c49af6901e68850dbba0624af84c40baf208f5","src/unix/no_align.rs":"c06e95373b9088266e0b14bba0954eef95f93fb2b01d951855e382d22de78e53","src/unix/redox/mod.rs":"b865c65438e102403708fa8a299d02ea635bda0879a256d99fadd0092d42f224","src/unix/solarish/compat.rs":"3f13657fc072462b85b5f937f0db1427c41acb2a714cc4f78fefba1ea8036846","src/unix/solarish/illumos.rs":"c42db942ab90813ecc7b2b32dea0e173e1e349e2e049a06021fd0dbc090c2c30","src/unix/solarish/mod.rs":"ca460056aca88af4f89296888d5c35df651f32456294a25d6343eb066f28b315","src/unix/solarish/solaris.rs":"3d3cc14b47839da1e4ec117bce1395e22ef86d8d1eb1fdcc6464d2fd8267efb4","src/unix/uclibc/align.rs":"a8540e1cce5913a45bc8d7422b79e86c0b12740e8a679478e0e4d863a31f8cc1","src/unix/uclibc/arm/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/uclibc/arm/mod.rs":"d67dd46bc6f417169fc6a23832bde7ccdafc5d1bcb08b10debdd82edaf75d529","src/unix/uclibc/arm/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/uclibc/mips/mips32/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/uclibc/mips/mips32/mod.rs":"a045ebc6619f540adf670b88a987abd2d6e42e440a552e8cfe9f8c77f397e873","src/unix/uclibc/mips/mips32/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/uclibc/mips/mips64/align.rs":"a7bdcb18a37a2d91e64d5fad83ea3edc78f5412adb28f77ab077dbb26dd08b2d","src/unix/uclibc/mips/mips64/mod.rs":"e3085ba56cfbc528d7c3c55065880603238c333b6047ef51c58177508a487fcd","src/unix/uclibc/mips/mips64/no_align.rs":"4a18e3875698c85229599225ac3401a2a40da87e77b2ad4ef47c6fcd5a24ed30","src/unix/uclibc/mips/mod.rs":"a76e9b7cd24d05ca15e412d96d4b2d39f0b2320f7823b15873c6271c16b9c52b","src/unix/uclibc/mod.rs":"2ec3fbe6853807a796632bb8920c48dda18f46823d1c5121db19c29dc86d2800","src/unix/uclibc/no_align.rs":"3f28637046524618adaa1012e26cb7ffe94b9396e6b518cccdc69d59f274d709","src/unix/uclibc/x86_64/align.rs":"4e34cebb7955e9c98ae2f310be6f8ed16a861fc3817c08543867554aeec9524e","src/unix/uclibc/x86_64/l4re.rs":"bb31053d6403091e11f95ac2203982f279f8b984a19adf30796878c45fdd8c25","src/unix/uclibc/x86_64/mod.rs":"188fbaf06a8e23cac72718b1ef7eb4bd98bdfd946aa708151f3f7e3553b65876","src/unix/uclibc/x86_64/no_align.rs":"2ccc0107a6007c70dc49e656095b64a352ca5d8f9f3e65c1dba634effbc15636","src/unix/uclibc/x86_64/other.rs":"42c3f71e58cabba373f6a55a623f3c31b85049eb64824c09c2b082b3b2d6a0a8","src/vxworks/aarch64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/arm.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/mod.rs":"ce8eb593241f7ac0c9d5e91d535457cd169ddcb3d061d3982ba5bcf6b8d63876","src/vxworks/powerpc.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/powerpc64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/x86.rs":"552f007f38317620b23889cb7c49d1d115841252439060122f52f434fbc6e5ba","src/vxworks/x86_64.rs":"018d92be3ad628a129eff9f2f5dfbc0883d8b8e5f2fa917b900a7f98ed6b514a","src/wasi.rs":"11e1ca29d1a446845c551d5717ec5c6081459a2a850781c9194f557d53ecf44f","src/windows/gnu/align.rs":"b2c13ec1b9f3b39a75c452c80c951dff9d0215e31d77e883b4502afb31794647","src/windows/gnu/mod.rs":"c7ab9793baaa3b6854d25fdf44266b7953533009e4fa722ca717b71d3e5d2c9d","src/windows/mod.rs":"7b74bf885712d16a3557df33ef02799dc03d4a1af953c7e6b4648954ce7a20fc","src/windows/msvc.rs":"2c2bfce66027d88021e7289139ebf5b0db258a7b6443f18872c84dbd4ef57131","tests/const_fn.rs":"cb75a1f0864f926aebe79118fc34d51a0d1ade2c20a394e7774c7e545f21f1f4"},"package":"89203f3fba0a3795506acaad8ebce3c80c0af93f994d5a1d7a0b1eeb23271929"} \ No newline at end of file diff --git a/third_party/cargo/vendor/libc-0.2.82/src/cloudabi/aarch64.rs b/third_party/cargo/vendor/libc-0.2.82/src/cloudabi/aarch64.rs deleted file mode 100644 index 4caa6d7..0000000 --- a/third_party/cargo/vendor/libc-0.2.82/src/cloudabi/aarch64.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub type c_char = u8; -pub type c_long = i64; -pub type c_ulong = u64; -pub type wchar_t = u32; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/cloudabi/arm.rs b/third_party/cargo/vendor/libc-0.2.82/src/cloudabi/arm.rs deleted file mode 100644 index eca5360..0000000 --- a/third_party/cargo/vendor/libc-0.2.82/src/cloudabi/arm.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub type c_char = u8; -pub type c_long = i32; -pub type c_ulong = u32; -pub type wchar_t = u32; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/cloudabi/mod.rs b/third_party/cargo/vendor/libc-0.2.82/src/cloudabi/mod.rs deleted file mode 100644 index 7781712..0000000 --- a/third_party/cargo/vendor/libc-0.2.82/src/cloudabi/mod.rs +++ /dev/null @@ -1,375 +0,0 @@ -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 in_addr_t = u32; -pub type in_port_t = u16; -pub type pthread_key_t = usize; -pub type pthread_t = usize; -pub type sa_family_t = u8; -pub type socklen_t = usize; -pub type time_t = i64; - -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: ::socklen_t, - pub ai_addr: *mut ::sockaddr, - pub ai_canonname: *mut ::c_char, - pub ai_next: *mut addrinfo, - } - - pub struct in_addr { - pub s_addr: in_addr_t, - } - - pub struct in6_addr { - pub s6_addr: [u8; 16], - } - - pub struct pthread_attr_t { - __detachstate: ::c_int, - __stacksize: usize, - } - - pub struct sockaddr { - pub sa_family: sa_family_t, - pub sa_data: [::c_char; 0], - } - - 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_storage { - pub ss_family: ::sa_family_t, - __ss_data: [u8; 32], - } -} - -pub const INT_MIN: c_int = -2147483648; -pub const INT_MAX: c_int = 2147483647; - -pub const _SC_NPROCESSORS_ONLN: ::c_int = 52; -pub const _SC_PAGESIZE: ::c_int = 54; - -pub const AF_INET: ::c_int = 1; -pub const AF_INET6: ::c_int = 2; - -pub const EACCES: ::c_int = 2; -pub const EADDRINUSE: ::c_int = 3; -pub const EADDRNOTAVAIL: ::c_int = 4; -pub const EAGAIN: ::c_int = 6; -pub const ECONNABORTED: ::c_int = 13; -pub const ECONNREFUSED: ::c_int = 14; -pub const ECONNRESET: ::c_int = 15; -pub const EEXIST: ::c_int = 20; -pub const EINTR: ::c_int = 27; -pub const EINVAL: ::c_int = 28; -pub const ENOENT: ::c_int = 44; -pub const ENOTCONN: ::c_int = 53; -pub const EPERM: ::c_int = 63; -pub const EPIPE: ::c_int = 64; -pub const ETIMEDOUT: ::c_int = 73; -pub const EWOULDBLOCK: ::c_int = EAGAIN; - -pub const EAI_SYSTEM: ::c_int = 9; - -pub const EXIT_FAILURE: ::c_int = 1; -pub const EXIT_SUCCESS: ::c_int = 0; - -pub const PTHREAD_STACK_MIN: ::size_t = 1024; - -pub const SOCK_DGRAM: ::c_int = 128; -pub const SOCK_STREAM: ::c_int = 130; - -#[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 atoi(s: *const c_char) -> c_int; - pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double; - pub fn strtol( - s: *const c_char, - endp: *mut *mut c_char, - base: c_int, - ) -> c_long; - pub fn strtoul( - s: *const c_char, - endp: *mut *mut c_char, - base: c_int, - ) -> c_ulong; - 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 getline( - lineptr: *mut *mut c_char, - n: *mut size_t, - stream: *mut FILE, - ) -> ssize_t; - - 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 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 atof(s: *const c_char) -> c_double; - pub fn labs(i: c_long) -> c_long; - pub fn rand() -> c_int; - pub fn srand(seed: c_uint); - - pub fn arc4random_buf(buf: *const ::c_void, len: ::size_t); - pub fn freeaddrinfo(res: *mut addrinfo); - pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char; - pub fn getaddrinfo( - node: *const c_char, - service: *const c_char, - hints: *const addrinfo, - res: *mut *mut addrinfo, - ) -> ::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 posix_memalign( - memptr: *mut *mut ::c_void, - align: ::size_t, - size: ::size_t, - ) -> ::c_int; - pub fn pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int; - pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int; - pub fn pthread_attr_setstacksize( - attr: *mut ::pthread_attr_t, - stack_size: ::size_t, - ) -> ::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_detach(thread: ::pthread_t) -> ::c_int; - pub fn pthread_getspecific(key: pthread_key_t) -> *mut ::c_void; - pub fn pthread_join( - native: ::pthread_t, - value: *mut *mut ::c_void, - ) -> ::c_int; - pub fn pthread_key_create( - key: *mut pthread_key_t, - dtor: ::Option, - ) -> ::c_int; - pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int; - pub fn pthread_setspecific( - key: pthread_key_t, - value: *const ::c_void, - ) -> ::c_int; - pub fn send( - socket: ::c_int, - buf: *const ::c_void, - len: ::size_t, - flags: ::c_int, - ) -> ::ssize_t; - pub fn sysconf(name: ::c_int) -> ::c_long; -} - -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 if #[cfg(any(target_arch = "x86"))] { - mod x86; - pub use self::x86::*; - } else if #[cfg(any(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 --git a/third_party/cargo/vendor/libc-0.2.82/src/cloudabi/x86.rs b/third_party/cargo/vendor/libc-0.2.82/src/cloudabi/x86.rs deleted file mode 100644 index 2f9f39c..0000000 --- a/third_party/cargo/vendor/libc-0.2.82/src/cloudabi/x86.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub type c_char = i8; -pub type c_long = i32; -pub type c_ulong = u32; -pub type wchar_t = i32; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/cloudabi/x86_64.rs b/third_party/cargo/vendor/libc-0.2.82/src/cloudabi/x86_64.rs deleted file mode 100644 index bb17624..0000000 --- a/third_party/cargo/vendor/libc-0.2.82/src/cloudabi/x86_64.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub type c_char = i8; -pub type c_long = i64; -pub type c_ulong = u64; -pub type wchar_t = i32; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/align.rs b/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/align.rs deleted file mode 100644 index 76b524d..0000000 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/align.rs +++ /dev/null @@ -1,66 +0,0 @@ -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], - } - } - - s_no_extra_traits! { - #[repr(align(8))] - #[allow(missing_debug_implementations)] - pub struct pthread_cond_t { - size: [u8; ::__SIZEOF_PTHREAD_COND_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)))] - #[allow(missing_debug_implementations)] - pub struct pthread_mutex_t { - 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)))] - #[allow(missing_debug_implementations)] - pub struct pthread_rwlock_t { - size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], - } - } - }; -} diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mod.rs b/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mod.rs deleted file mode 100644 index 9b9a0bf..0000000 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mod.rs +++ /dev/null @@ -1,2365 +0,0 @@ -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 loff_t = ::c_longlong; -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 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 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 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; - -#[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 - } -} - -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_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 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 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 pthread_rwlockattr_t { - __lockkind: ::c_int, - __pshared: ::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 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(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 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: ::time_t, - pub dqb_itime: ::time_t, - } - - 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 { - #[cfg(target_pointer_width = "32")] - bits: [u32; 32], - #[cfg(target_pointer_width = "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 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 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 commenting these out and if uClibc changes - // the #if block in the future to include the following fields, these - // will probably need including here. tsidea - // - // 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 ucred { - pub pid: ::pid_t, - pub uid: ::uid_t, - pub gid: ::gid_t, - } -} - -s_no_extra_traits! { - #[cfg_attr( - any(target_arch = "x86", target_arch = "x86_64"), - repr(packed) - )] - #[allow(missing_debug_implementations)] - pub struct epoll_event { - pub events: u32, - pub u64: u64, - } - - #[allow(missing_debug_implementations)] - pub struct sockaddr_un { - pub sun_family: sa_family_t, - pub sun_path: [::c_char; 108] - } - - #[allow(missing_debug_implementations)] - pub struct sockaddr_storage { - pub ss_family: sa_family_t, - __ss_align: ::size_t, - #[cfg(target_pointer_width = "32")] - __ss_pad2: [u8; 128 - 2 * 4], - #[cfg(target_pointer_width = "64")] - __ss_pad2: [u8; 128 - 2 * 8], - } - - #[allow(missing_debug_implementations)] - 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] - } - - #[allow(missing_debug_implementations)] - 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], - } - - #[allow(missing_debug_implementations)] - 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 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] - } - - 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, - // 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 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(&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(&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_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(&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_DUPFD_CLOEXEC: ::c_int = 1030; - -// 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; -// FIXME: Add these constants once uclibc gets them. -// 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 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 LC_CTYPE: ::c_int = 0; -pub const LC_NUMERIC: ::c_int = 1; -pub const LC_MONETARY: ::c_int = 2; -pub const LC_TIME: ::c_int = 3; -pub const LC_COLLATE: ::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_NOATIME: ::c_ulong = 0x0400; -pub const MS_NODIRATIME: ::c_ulong = 0x0800; -pub const MS_BIND: ::c_ulong = 0x1000; -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; - -// 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 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_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_HWPOISON: ::c_int = 100; - -// https://github.com/kraj/uClibc/blob/master/include/net/if.h#L44 -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. - -// Not supported -pub const IFF_ALLMULTI: ::c_int = 0x200; // Receive all multicast packets. -pub const IFF_MASTER: ::c_int = 0x400; // Master of a load balancer. -pub const IFF_SLAVE: ::c_int = 0x800; // Slave of a load balancer. -pub const IFF_MULTICAST: ::c_int = 0x1000; // Supports multicast. -pub const IFF_PORTSEL: ::c_int = 0x2000; // Can set media type. -pub const IFF_AUTOMEDIA: ::c_int = 0x4000; // Auto media select active. - -// Dialup device with changing addresses. -pub const IFF_DYNAMIC: ::c_int = 0x8000; - -pub const SOL_IP: ::c_int = 0; -pub const SOL_TCP: ::c_int = 6; -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 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_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_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_CMSG_CLOEXEC: ::c_int = 0x40000000; - -pub const SOCK_RAW: ::c_int = 3; -pub const SOCK_RDM: ::c_int = 4; -pub const IP_MULTICAST_TTL: ::c_int = 33; -pub const IP_MULTICAST_LOOP: ::c_int = 34; -pub const IP_TTL: ::c_int = 2; -pub const IP_HDRINCL: ::c_int = 3; -pub const IP_ADD_MEMBERSHIP: ::c_int = 35; -pub const IP_DROP_MEMBERSHIP: ::c_int = 36; -pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20; -pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21; - -pub const IPV6_JOIN_GROUP: ::c_int = 20; -pub const IPV6_LEAVE_GROUP: ::c_int = 21; - -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; - -// Source: -// https://github.com/kraj/uClibc/blob/ca1c74d67dd115d059a875150e10b8560a9c35a8 -// /libc/sysdeps/linux/common/bits/in.h -// Same for all architectures -pub const IPV6_MULTICAST_HOPS: ::c_int = 18; -pub const IP_MULTICAST_IF: ::c_int = 32; -pub const IPV6_MULTICAST_IF: ::c_int = 17; -pub const IPV6_UNICAST_HOPS: ::c_int = 16; - -// Source: -// https://github.com/kraj/uClibc/tree/ca1c74d67dd115d059a875150e10b8560a9c35a8 -// Same for all architectures -pub const FUTEX_WAIT: ::c_int = 0; -pub const FUTEX_PRIVATE_FLAG: ::c_int = 128; -pub const FUTEX_WAKE: ::c_int = 1; - -pub const IPV6_MULTICAST_LOOP: ::c_int = 19; -pub const IPV6_V6ONLY: ::c_int = 26; - -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 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 MNT_FORCE: ::c_int = 0x1; - -pub const Q_SYNC: ::c_int = 0x600; -pub const Q_QUOTAON: ::c_int = 0x100; -pub const Q_QUOTAOFF: ::c_int = 0x200; -pub const Q_GETQUOTA: ::c_int = 0x300; -pub const Q_SETQUOTA: ::c_int = 0x400; - -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 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 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; - -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 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 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 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 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 _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_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_NPROCESSORS_ONLN: ::c_int = 84; -pub const _SC_ATEXIT_MAX: ::c_int = 87; -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_XBS5_ILP32_OFF32: ::c_int = 125; -pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126; -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_HOST_NAME_MAX: ::c_int = 180; - -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; - -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 __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; - -// 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_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 EPOLLONESHOT: ::c_int = 0x40000000; - -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 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_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 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_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 GRND_NONBLOCK: ::c_uint = 0x0001; -pub const GRND_RANDOM: ::c_uint = 0x0002; - -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; - -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; - -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: *mut 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 - } -} - -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) - } -} - -extern "C" { - #[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 atof(s: *const ::c_char) -> ::c_double; - pub fn labs(i: ::c_long) -> ::c_long; - pub fn rand() -> ::c_int; - pub fn srand(seed: ::c_uint); - - pub fn fdatasync(fd: ::c_int) -> ::c_int; - pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::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_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 prctl(option: ::c_int, ...) -> ::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_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 initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int; - pub fn sched_setscheduler( - pid: ::pid_t, - policy: ::c_int, - param: *const ::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 epoll_create(size: ::c_int) -> ::c_int; - pub fn epoll_create1(flags: ::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 epoll_wait( - epfd: ::c_int, - events: *mut ::epoll_event, - maxevents: ::c_int, - timeout: ::c_int, - ) -> ::c_int; - pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; - 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 umount(target: *const ::c_char) -> ::c_int; - pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::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 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 syscall(num: ::c_long, ...) -> ::c_long; - pub fn sendfile( - out_fd: ::c_int, - in_fd: ::c_int, - offset: *mut off_t, - count: ::size_t, - ) -> ::ssize_t; - 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 tee( - fd_in: ::c_int, - fd_out: ::c_int, - len: ::size_t, - flags: ::c_uint, - ) -> ::ssize_t; - pub fn vmsplice( - fd: ::c_int, - iov: *const ::iovec, - nr_segs: ::size_t, - flags: ::c_uint, - ) -> ::ssize_t; - - pub fn posix_fadvise( - fd: ::c_int, - offset: ::off_t, - len: ::off_t, - advise: ::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; - 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 creat64(path: *const c_char, mode: mode_t) -> ::c_int; - pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int; - pub fn fstatat64( - fildes: ::c_int, - path: *const ::c_char, - buf: *mut stat64, - flag: ::c_int, - ) -> ::c_int; - pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int; - pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::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 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 setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::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; - pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; - - pub fn mknodat( - dirfd: ::c_int, - pathname: *const ::c_char, - mode: ::mode_t, - dev: dev_t, - ) -> ::c_int; - pub fn ppoll( - fds: *mut ::pollfd, - nfds: nfds_t, - timeout: *const ::timespec, - sigmask: *const sigset_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_condattr_getpshared( - attr: *const pthread_condattr_t, - pshared: *mut ::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; - pub fn unshare(flags: ::c_int) -> ::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 accept4( - fd: ::c_int, - addr: *mut ::sockaddr, - len: *mut ::socklen_t, - flg: ::c_int, - ) -> ::c_int; - pub fn pthread_mutex_timedlock( - lock: *mut pthread_mutex_t, - abstime: *const ::timespec, - ) -> ::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_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_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 lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; - - pub fn setpwent(); - pub fn endpwent(); - pub fn getpwent() -> *mut passwd; - pub fn setspent(); - pub fn endspent(); - pub fn getspent() -> *mut spwd; - pub fn getspnam(__name: *const ::c_char) -> *mut spwd; - - 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 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 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 tmpfile64() -> *mut ::FILE; - pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int; - pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int; - pub fn fseeko64( - stream: *mut ::FILE, - offset: ::off64_t, - whence: ::c_int, - ) -> ::c_int; - pub fn ftello64(stream: *mut ::FILE) -> ::off64_t; - 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 quotactl( - cmd: ::c_int, - special: *const ::c_char, - id: ::c_int, - data: *mut ::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_send( - mqd: ::mqd_t, - msg_ptr: *const ::c_char, - msg_len: ::size_t, - msg_prio: ::c_uint, - ) -> ::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 epoll_pwait( - epfd: ::c_int, - events: *mut ::epoll_event, - maxevents: ::c_int, - timeout: ::c_int, - sigmask: *const ::sigset_t, - ) -> ::c_int; - pub fn sethostname(name: *const ::c_char, len: ::size_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 nl_langinfo_l(item: ::nl_item, locale: ::locale_t) - -> *mut ::c_char; - 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 reboot(how_to: ::c_int) -> ::c_int; - pub fn setfsgid(gid: ::gid_t) -> ::c_int; - pub fn setfsuid(uid: ::uid_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; - - // 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 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 shm_unlink(name: *const ::c_char) -> ::c_int; - - pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); - - pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; - - 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 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 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, - parent: ::Option, - child: ::Option, - ) -> ::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 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; - pub fn getnameinfo( - sa: *const ::sockaddr, - salen: ::socklen_t, - host: *mut ::c_char, - hostlen: ::socklen_t, - serv: *mut ::c_char, - sevlen: ::socklen_t, - flags: ::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; - } -} - -cfg_if! { - if #[cfg(libc_align)] { - #[macro_use] - mod align; - } else { - #[macro_use] - mod no_align; - } -} - -expand_align!(); diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/x86_64/align.rs b/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/x86_64/align.rs deleted file mode 100644 index e2d829b..0000000 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/x86_64/align.rs +++ /dev/null @@ -1,77 +0,0 @@ -macro_rules! expand_align { - () => { - s! { - #[cfg_attr(target_pointer_width = "32", - repr(align(4)))] - #[cfg_attr(target_pointer_width = "64", - repr(align(8)))] - pub struct sem_t { // FIXME - #[cfg(target_pointer_width = "32")] - __size: [::c_char; 16], - #[cfg(target_pointer_width = "64")] - __size: [::c_char; 32], - } - - #[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 { // FIXME - size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], - } - - #[repr(align(4))] - pub struct pthread_condattr_t { // FIXME - size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], - } - } - - s_no_extra_traits! { - #[cfg_attr(all(target_pointer_width = "32", - any(target_arch = "mips", - target_arch = "arm", - target_arch = "powerpc")), - repr(align(4)))] - #[cfg_attr(all(any(target_pointer_width = "64", - not(any(target_arch = "mips", - target_arch = "arm", - target_arch = "powerpc")))), - repr(align(8)))] - #[allow(missing_debug_implementations)] - pub struct pthread_mutex_t { // FIXME - size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], - } - - #[repr(align(8))] - #[allow(missing_debug_implementations)] - pub struct pthread_cond_t { // FIXME - size: [u8; ::__SIZEOF_PTHREAD_COND_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)))] - #[allow(missing_debug_implementations)] - pub struct pthread_rwlock_t { // FIXME - size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], - } - } - }; -} diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/x86_64/no_align.rs b/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/x86_64/no_align.rs deleted file mode 100644 index ffa4e52..0000000 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/x86_64/no_align.rs +++ /dev/null @@ -1,59 +0,0 @@ -macro_rules! expand_align { - () => { - s! { - pub struct sem_t { // FIXME - #[cfg(target_pointer_width = "32")] - __size: [::c_char; 16], - #[cfg(target_pointer_width = "64")] - __size: [::c_char; 32], - __align: [::c_long; 0], - } - - pub struct pthread_mutex_t { // FIXME - #[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_mutexattr_t { // FIXME - #[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 { // FIXME - __align: [::c_longlong; 0], - size: [u8; ::__SIZEOF_PTHREAD_COND_T], - } - - pub struct pthread_condattr_t { // FIXME - __align: [::c_int; 0], - size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], - } - - pub struct pthread_rwlock_t { // FIXME - #[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], - } - } - } -} diff --git a/third_party/cargo/vendor/libc-0.2.92/.cargo-checksum.json b/third_party/cargo/vendor/libc-0.2.92/.cargo-checksum.json new file mode 100644 index 0000000..9137a23 --- /dev/null +++ b/third_party/cargo/vendor/libc-0.2.92/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CONTRIBUTING.md":"216fdf46b3402833aaa1039a420edda0a9841f680b3a6ebfc883193b71b3a4b6","Cargo.toml":"16f1991154e96d0423a409c8fff1b0272598cebf8b964319fa0cd9b55975a678","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"a8d47ff51ca256f56a8932dba07660672dbfe3004257ca8de708aac1415937a1","README.md":"8228847944f1332882fbb00275b6f30e4a8aad08a13569c25d52cac012cc2a47","build.rs":"da312dbe6ad942063ec1e92509c672639aea86b4d73b28bbb9e5e78ca3a897e1","rustfmt.toml":"8a654d5787585ca8f2c20580737336fc327f411a07b0dbd4870adf6e9bdf624f","src/fixed_width_ints.rs":"34c60f12ec5eeb90f13ec3b954427532111c2446e69617616a97aefc1086a9f1","src/fuchsia/aarch64.rs":"378776a9e40766154a54c94c2a7b4675b5c302a38e6e42da99e67bfbaee60e56","src/fuchsia/align.rs":"ae1cf8f011a99737eabeb14ffff768e60f13b13363d7646744dbb0f443dab3d6","src/fuchsia/mod.rs":"cd67bccd01ef311568e84a178b6863efcca53f999e946f9cd2519c183ff3427a","src/fuchsia/no_align.rs":"303f3f1b255e0088b5715094353cf00476131d8e94e6aebb3f469557771c8b8a","src/fuchsia/x86_64.rs":"93a3632b5cf67d2a6bcb7dc0a558605252d5fe689e0f38d8aa2ec5852255ac87","src/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/hermit/mod.rs":"d3bfce41e4463d4be8020a2d063c9bfa8b665f45f1cc6cbf3163f5d01e7cb21f","src/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/lib.rs":"d4f7452c0fe720f3a961b918b74ec86d19cef33e6b4aac08efbbad6f6d818e09","src/macros.rs":"7844312c233a6889fa15395fe3106f6a8f6229211104a92f33ea3c9536eef763","src/psp.rs":"017fdd719cc85352a1c062d40edd96a821e19d25abe23b55e40ed6e7ac2892e1","src/sgx.rs":"16a95cdefc81c5ee00d8353a60db363c4cc3e0f75abcd5d0144723f2a306ed1b","src/switch.rs":"9da3dd39b3de45a7928789926e8572d00e1e11a39e6f7289a1349aadce90edba","src/unix/align.rs":"2cdc7c826ef7ae61f5171c5ae8c445a743d86f1a7f2d9d7e4ceeec56d6874f65","src/unix/bsd/apple/b32/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b32/mod.rs":"6a4ce300da0d2b0db04b18548286603ffe4b47d679a41cf60f1902895894aa1f","src/unix/bsd/apple/b64/aarch64/align.rs":"f0c321265dd7671f16106b84951ac7dd77ed2e65c6623cbf2d29e76531984770","src/unix/bsd/apple/b64/aarch64/mod.rs":"46d5d061c7a74cbc09cbdfb3bee9a600867bf4e04c0e4d0ca6c817e6033b32e1","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":"cc6878dd130c3f255418e4da74992ae9ba6a3cdb0530772de76c518077d3b12a","src/unix/bsd/apple/mod.rs":"c10bc90fe7041a4d460ae43639ee8f9e0b0bbe7c1cb29b1d6b89f2d1b8df7aa7","src/unix/bsd/freebsdlike/dragonfly/errno.rs":"8295b8bb0dfd38d2cdb4d9192cdeeb534cc6c3b208170e64615fa3e0edb3e578","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"e89ed69275474c5cde42ef997f4a120b487bb8020e3f93dac73c5886572fe9d9","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"14f0bd6693967d4fedec904f7042bd51f2138cb843ec4df18c911b357417cdd2","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":"2e9b8f8af44eb75539c7688c2723745a5f10079a7faac99e43ae7534bd111f48","src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs":"09a2441852a6dfb7e7fce28d5115ce243109deab1c569d80c67c5b634ac4bb23","src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs":"72a87d191189486d44bc19a3296817fcf828087ce1286bca20d474a3b2602602","src/unix/bsd/freebsdlike/freebsd/mod.rs":"4c9c6ca43d8334814d6744b944159a80bfa13f9773561f26227524ff16a90a0b","src/unix/bsd/freebsdlike/freebsd/powerpc64.rs":"2dae3ecc87eac3b11657aa98915def55fc4b5c0de11fe26aae23329a54628a9a","src/unix/bsd/freebsdlike/freebsd/x86.rs":"c5005e3249eb7c93cfbac72a9e9272320d80ce7983da990ceb05a447f59a02c5","src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs":"0e1f69a88fca1c32874b1daf5db3d446fefbe518dca497f096cc9168c39dde70","src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs":"6132aa0973454379674ea6cbc77e6eace1e1032dd9f38182071388a036f1bc08","src/unix/bsd/freebsdlike/mod.rs":"c89d550af6c89f97e89fcf81d36b6c0cefe9b4726ddb05aa8c23e60d641629a4","src/unix/bsd/mod.rs":"26160c60a33cec65ccc3b28277d40bd95f7f62ee857f931ada76cbc7c2694858","src/unix/bsd/netbsdlike/mod.rs":"48dd60524119c1e09b255d5472d091e7e7b2b29eab04be51b4b1e740bd022859","src/unix/bsd/netbsdlike/netbsd/aarch64.rs":"b38fc046f9a40fea28bd26328b96629f4d5d63d7524936bd6af1865d401a8716","src/unix/bsd/netbsdlike/netbsd/arm.rs":"58cdbb70b0d6f536551f0f3bb3725d2d75c4690db12c26c034e7d6ec4a924452","src/unix/bsd/netbsdlike/netbsd/mod.rs":"d395944016b2a9eeeeaa2cdbc94c5c79cf4e8339fbca584034d512ad4d5181ff","src/unix/bsd/netbsdlike/netbsd/powerpc.rs":"ee7ff5d89d0ed22f531237b5059aa669df93a3b5c489fa641465ace8d405bf41","src/unix/bsd/netbsdlike/netbsd/sparc64.rs":"9489f4b3e4566f43bb12dfb92238960613dac7f6a45cc13068a8d152b902d7d9","src/unix/bsd/netbsdlike/netbsd/x86.rs":"20692320e36bfe028d1a34d16fe12ca77aa909cb02bda167376f98f1a09aefe7","src/unix/bsd/netbsdlike/netbsd/x86_64.rs":"135509edeaf3fb3f102d89d51ff1a8f82323497336a8dc7e1f0f23b5c2434b73","src/unix/bsd/netbsdlike/openbsd/aarch64.rs":"1dd5449dd1fd3d51e30ffdeeaece91d0aaf05c710e0ac699fecc5461cfa2c28e","src/unix/bsd/netbsdlike/openbsd/mod.rs":"c8c8624456b20989d75b8f6ed734d85d9c163ac30991421df797bc170019483b","src/unix/bsd/netbsdlike/openbsd/sparc64.rs":"d04fd287afbaa2c5df9d48c94e8374a532a3ba491b424ddf018270c7312f4085","src/unix/bsd/netbsdlike/openbsd/x86.rs":"6f7f5c4fde2a2259eb547890cbd86570cea04ef85347d7569e94e679448bec87","src/unix/bsd/netbsdlike/openbsd/x86_64.rs":"e59b7fd65f68f8e857eec39e0c03bac1d3af6ddc26c9ba58494336b83659bb9b","src/unix/haiku/b32.rs":"69ae47fc52c6880e85416b4744500d5655c9ec6131cb737f3b649fceaadce15a","src/unix/haiku/b64.rs":"73e64db09275a8da8d50a13cce2cfa2b136036ddf3a930d2939f337fc995900b","src/unix/haiku/mod.rs":"2b08cec6f8d93385331c77e4a0e6a55f114474f5c03cff8e4f725837cae4ae94","src/unix/haiku/native.rs":"a35b5df389dab4dcff10c758a6714cb69263cf5f3465285d0632ea336a2a617b","src/unix/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/unix/hermit/mod.rs":"2d8d3ce0299931199011bb73136bebbddf88edf7d263cc39d26dbfaaa1a14228","src/unix/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/unix/linux_like/android/b32/arm.rs":"d611801c875a1066ff596ba813a80c1689aa54489bbd5bd8af4610c786d97a36","src/unix/linux_like/android/b32/mod.rs":"6b3fd3e1eb21e50d000f496729b40968b1c728f5f10d4fb18a9aef44bff383ff","src/unix/linux_like/android/b32/x86/align.rs":"812914e4241df82e32b12375ca3374615dc3a4bdd4cf31f0423c5815320c0dab","src/unix/linux_like/android/b32/x86/mod.rs":"8388bd3a0fcb5636bf965eee6dc95ae6860b85a2b555b387c868aa4d4e01ec89","src/unix/linux_like/android/b64/aarch64/align.rs":"2179c3b1608fa4bf68840482bfc2b2fa3ee2faf6fcae3770f9e505cddca35c7b","src/unix/linux_like/android/b64/aarch64/mod.rs":"db23f94bc3ed46a0967dde748f0d4566fc885cc6171d0555007f3398ff99a708","src/unix/linux_like/android/b64/mod.rs":"e3078e856e43fde9b57d8a5aa840a590f2e18517a3e8de23e9c2a3d798596f43","src/unix/linux_like/android/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/android/b64/x86_64/mod.rs":"e84176d838e663d351450bad218715db1fafbb531e47ea0e262cbb45829dae89","src/unix/linux_like/android/mod.rs":"5234692a1065bc3ec2309ee839c1311b76083e0c1ffa493070f2b3f813ec91b4","src/unix/linux_like/emscripten/align.rs":"86c95cbed7a7161b1f23ee06843e7b0e2340ad92b2cb86fe2a8ef3e0e8c36216","src/unix/linux_like/emscripten/mod.rs":"0770f13ce30b98752d5e868332bf5a55bee8389108fe9d91cf2c2bf71c237093","src/unix/linux_like/emscripten/no_align.rs":"0128e4aa721a9902754828b61b5ec7d8a86619983ed1e0544a85d35b1051fad6","src/unix/linux_like/linux/align.rs":"213e70ebed2703e14a9cf17666b21ecbf180b7bff7fa22fdbb36dbbd52df326d","src/unix/linux_like/linux/gnu/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/gnu/b32/arm/align.rs":"3fed009dc9af3cc81be7087da9d2d7d1f39845e4497e290259c5cdbae25f039d","src/unix/linux_like/linux/gnu/b32/arm/mod.rs":"9e319974c56e49cfca8966fd1a75103960933237af57081c0e2079943256a9f7","src/unix/linux_like/linux/gnu/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/gnu/b32/mips/mod.rs":"fc13a4a5e2a8803aeb8bcd9089853b144f7fbf9145a7bd629a4a4b89a76bce4b","src/unix/linux_like/linux/gnu/b32/mod.rs":"3d282f97f171ce235e687169e7a494e65c21bdc4e59c28360dae60b6c2ffa80c","src/unix/linux_like/linux/gnu/b32/powerpc.rs":"065a2ec5f1d9e24e5aeeae4254c4b0314efe1cc76473bd99865935a1887700a6","src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs":"553251767a5848c619365d79b2c35be1621e1836bbdfb5f976c70b9e3b12b57b","src/unix/linux_like/linux/gnu/b32/sparc/align.rs":"21adbed27df73e2d1ed934aaf733a643003d7baf2bde9c48ea440895bcca6d41","src/unix/linux_like/linux/gnu/b32/sparc/mod.rs":"32e21046843c84977cc28d10f43febcaf4e020fd5c5ffb1880ce0ad62a771fdd","src/unix/linux_like/linux/gnu/b32/x86/align.rs":"e4bafdc4a519a7922a81b37a62bbfd1177a2f620890eef8f1fbc47162e9eb413","src/unix/linux_like/linux/gnu/b32/x86/mod.rs":"a4c2abfb00225c0abd5b37a94d3ee11db9c8e924b81216e9801b4f9d380b2943","src/unix/linux_like/linux/gnu/b64/aarch64/align.rs":"2179c3b1608fa4bf68840482bfc2b2fa3ee2faf6fcae3770f9e505cddca35c7b","src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs":"21a21503ef2e095f4371044915d4bfb07a8578011cb5c713cd9f45947b0b5730","src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs":"e78c3cd197f44832338b414d1a9bc0d194f44c74db77bd7bf830c1fff62b2690","src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs":"f6dd2bef7907832fb3e6aeed7dac51f0ae498bced3df3467dbeb154ee154ce0f","src/unix/linux_like/linux/gnu/b64/mips64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/mips64/mod.rs":"d40335e10b12e1da3aa73fc8e282bc67fdafc1e10c4ff6020852ee8173df7a01","src/unix/linux_like/linux/gnu/b64/mod.rs":"7bf5c9813032db77b964ccb90bdce15236ae9ea06ea185595278ea4565c21b7b","src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs":"f2693886e84d68316c1e33e8300ee49cc4734b97293eb3d9985a9122c7360493","src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs":"c6cc0fc59d3970499ddc1f6b04f7dca0a23a5f24a8343a93f7516c4b0b3516da","src/unix/linux_like/linux/gnu/b64/s390x.rs":"c17afb8993c09f10153b85ae60db4daca98e63e70eb7e9182b55a38ce52fddc9","src/unix/linux_like/linux/gnu/b64/sparc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs":"82a475d3f08d5b0035b76d405bea5933b7110ddf36dfcd9be9f08ed486babf48","src/unix/linux_like/linux/gnu/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs":"f047199e4267bcb63a831379c72884ccf2189b5f2879479436342b2c5b58671e","src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs":"f775ac2b754f90b63053fe22afe1d19d306b5404995568d6805baa9249fb617f","src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs":"4ba1b58468f55254717366f50fdfd3e4114fde6dc442a56681926c4d7e5b6b0d","src/unix/linux_like/linux/gnu/mod.rs":"fac690b9721a24993d9e765f59bf3b98435e5459881e45dd755e147cd61df86c","src/unix/linux_like/linux/gnu/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/mod.rs":"f8834d21c6e35603b3a931b17ec12c55070158b28fdd9ccf2ba200510964ca94","src/unix/linux_like/linux/musl/b32/arm/align.rs":"3e8ac052c1043764776b54c93ba4260e061df998631737a897d9d47d54f7b80c","src/unix/linux_like/linux/musl/b32/arm/mod.rs":"6e8f4bf6e3023ad531c86ce58bd2da3eab73907b507685180e66459f3879efcc","src/unix/linux_like/linux/musl/b32/hexagon.rs":"7c6c481f70da1fe6ca759f363784e130041f3d87906c45910fc1142b5ef17970","src/unix/linux_like/linux/musl/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/musl/b32/mips/mod.rs":"030358fde4025fdbdc411c375eba231fde9a1a668392c10ca34b09ff09a44b93","src/unix/linux_like/linux/musl/b32/mod.rs":"8ede3985e6243882814ce91e8ce543e7edbafc0cee5932816072b6f14207a671","src/unix/linux_like/linux/musl/b32/powerpc.rs":"d8f30c6b6a055fcf65173b2febb8e59a3fd90cd8512732871388ec064ec8e858","src/unix/linux_like/linux/musl/b32/x86/align.rs":"08e77fbd7435d7dec2ff56932433bece3f02e47ce810f89004a275a86d39cbe1","src/unix/linux_like/linux/musl/b32/x86/mod.rs":"4bdba732065522ed2116c2f4fe443208ef9f9ab68e79226efe3e2b95d2fa7316","src/unix/linux_like/linux/musl/b64/aarch64/align.rs":"798a9229d70ce235394f2dd625f6c4c1e10519a94382dc5b091952b638ae2928","src/unix/linux_like/linux/musl/b64/aarch64/mod.rs":"475bab28c7f630f94f488f2a50eba8ebee3b544e509ad2c70e1d4f37b448c82a","src/unix/linux_like/linux/musl/b64/mips64.rs":"cd541114a5a8ae6be5f4c5896b2d29b85d6d202fba32d7dc7d9ce8e29ef207f9","src/unix/linux_like/linux/musl/b64/mod.rs":"cf615e1d34fd657f4dffff528de2291750cd0ccceb737018022f31b10fe0d16f","src/unix/linux_like/linux/musl/b64/powerpc64.rs":"f9aaa1e1502cb80fa5cb696852d62bdce2f3d0695e4837d39f646f0d8273b99c","src/unix/linux_like/linux/musl/b64/s390x.rs":"9b906f290f2783c97df955bef4a6f39b2b0cae903148e4aa09225ba9670cfafa","src/unix/linux_like/linux/musl/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/musl/b64/x86_64/mod.rs":"999cb856ac68a753315da07a9dce432cd07f531dd4e3568a83a5d113ad82da90","src/unix/linux_like/linux/musl/mod.rs":"a12f6c80419010753346e3563f7e73caca0a594ad9e7bc8a2efa31b8f5f26e26","src/unix/linux_like/linux/no_align.rs":"5ed04c53bf9d27da9b4d65ba7625c6ac53330162683d1b3df98950caafa3507b","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":"3b2a028c7aba71d26e82cbdc1aaf98c4e5a0c28970b8c66f8dc519f567fe4774","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":"bc8833cb438c252f43801dbecc339c9527f4ca0d197563bc4cfa53093ddd7af0","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":"e3085ba56cfbc528d7c3c55065880603238c333b6047ef51c58177508a487fcd","src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs":"4a18e3875698c85229599225ac3401a2a40da87e77b2ad4ef47c6fcd5a24ed30","src/unix/linux_like/linux/uclibc/mips/mod.rs":"18623e880c79e10dd1e556860460323c4d06d3b9f2db5a71fbf5ac038cf9923a","src/unix/linux_like/linux/uclibc/mod.rs":"ac2fcd42bc21b854de629730288738bb95c9d652aaa6e652f486ff935b0addbd","src/unix/linux_like/linux/uclibc/no_align.rs":"3f28637046524618adaa1012e26cb7ffe94b9396e6b518cccdc69d59f274d709","src/unix/linux_like/linux/uclibc/x86_64/l4re.rs":"bb31053d6403091e11f95ac2203982f279f8b984a19adf30796878c45fdd8c25","src/unix/linux_like/linux/uclibc/x86_64/mod.rs":"a2dd8d079fefc30bc52c10b756b08f2c5c5de35fc8274868422a4a1314c4df5c","src/unix/linux_like/linux/uclibc/x86_64/other.rs":"42c3f71e58cabba373f6a55a623f3c31b85049eb64824c09c2b082b3b2d6a0a8","src/unix/linux_like/mod.rs":"137b0ce092fb7e6967e7bb94008a92e8e668de1a6ecf0b203eb492db7e9f405d","src/unix/mod.rs":"5a4c42b444abab61f8adf0410f2a3fba94c53261d1d050372f4498f70a84931f","src/unix/newlib/aarch64/mod.rs":"bb269c1468a9676442554600e87417079a787fe6220dfc23b3109639259e8710","src/unix/newlib/align.rs":"28aaf87fafbc6b312622719d472d8cf65f9e5467d15339df5f73e66d8502b28a","src/unix/newlib/arm/mod.rs":"c71be856bfd7f576b2db28af9f680211cbe6c1cac7d537bbc8020b39591af07c","src/unix/newlib/mod.rs":"35ea283f645afbc7ddebba90d46875c9dc5edc8d215d4becc9e2681a909c5aa1","src/unix/newlib/no_align.rs":"7123dcec13604a11b7765c380ff3a4d0da19c39f4b03919de7857723c0cf1502","src/unix/newlib/powerpc/mod.rs":"2d0f7af28b47f7a2a6c210ebd1c1f33ed8eac62e56b5af2b856de2ad3fdc5187","src/unix/newlib/xtensa/mod.rs":"4c72003c5e692e648c7e798358c49af6901e68850dbba0624af84c40baf208f5","src/unix/no_align.rs":"c06e95373b9088266e0b14bba0954eef95f93fb2b01d951855e382d22de78e53","src/unix/redox/mod.rs":"b865c65438e102403708fa8a299d02ea635bda0879a256d99fadd0092d42f224","src/unix/solarish/compat.rs":"3f13657fc072462b85b5f937f0db1427c41acb2a714cc4f78fefba1ea8036846","src/unix/solarish/illumos.rs":"100845235d27978725d7ff71d58c1b1eb7b360be489056b2758c6cc7244e252e","src/unix/solarish/mod.rs":"dedf960fa6431daa5427f5237c51e28fa3a94290fcdf9d0b6a4d85d2b21349e9","src/unix/solarish/solaris.rs":"3d3cc14b47839da1e4ec117bce1395e22ef86d8d1eb1fdcc6464d2fd8267efb4","src/vxworks/aarch64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/arm.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/mod.rs":"aba3cb76f5065483fe623ae378e4e66ac7ef8202f5065199841d82634b2f37f7","src/vxworks/powerpc.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/powerpc64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/x86.rs":"552f007f38317620b23889cb7c49d1d115841252439060122f52f434fbc6e5ba","src/vxworks/x86_64.rs":"018d92be3ad628a129eff9f2f5dfbc0883d8b8e5f2fa917b900a7f98ed6b514a","src/wasi.rs":"bbdfbffd96969f9028d13ad61e08db88769d47a33e45ecc683d9ae203d94130a","src/windows/gnu/align.rs":"b2c13ec1b9f3b39a75c452c80c951dff9d0215e31d77e883b4502afb31794647","src/windows/gnu/mod.rs":"c7ab9793baaa3b6854d25fdf44266b7953533009e4fa722ca717b71d3e5d2c9d","src/windows/mod.rs":"7b74bf885712d16a3557df33ef02799dc03d4a1af953c7e6b4648954ce7a20fc","src/windows/msvc.rs":"2c2bfce66027d88021e7289139ebf5b0db258a7b6443f18872c84dbd4ef57131","tests/const_fn.rs":"cb75a1f0864f926aebe79118fc34d51a0d1ade2c20a394e7774c7e545f21f1f4"},"package":"56d855069fafbb9b344c0f962150cd2c1187975cb1c22c1522c240d8c4986714"} \ No newline at end of file diff --git a/third_party/cargo/vendor/libc-0.2.82/BUILD.bazel b/third_party/cargo/vendor/libc-0.2.92/BUILD.bazel similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/BUILD.bazel rename to third_party/cargo/vendor/libc-0.2.92/BUILD.bazel index 2a55a43..1c9a9cc 100644 --- a/third_party/cargo/vendor/libc-0.2.82/BUILD.bazel +++ b/third_party/cargo/vendor/libc-0.2.92/BUILD.bazel @@ -55,7 +55,7 @@ cargo_build_script( "cargo-raze", "manual", ], - version = "0.2.82", + version = "0.2.92", visibility = ["//visibility:private"], deps = [ ], @@ -80,7 +80,7 @@ rust_library( "cargo-raze", "manual", ], - version = "0.2.82", + version = "0.2.92", # buildifier: leave-alone deps = [ ":libc_build_script", diff --git a/third_party/cargo/vendor/libc-0.2.82/CONTRIBUTING.md b/third_party/cargo/vendor/libc-0.2.92/CONTRIBUTING.md similarity index 95% rename from third_party/cargo/vendor/libc-0.2.82/CONTRIBUTING.md rename to third_party/cargo/vendor/libc-0.2.92/CONTRIBUTING.md index 1acc71d..5d52cad 100644 --- a/third_party/cargo/vendor/libc-0.2.82/CONTRIBUTING.md +++ b/third_party/cargo/vendor/libc-0.2.92/CONTRIBUTING.md @@ -69,11 +69,11 @@ 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`. -1. Send a PR to this repository. It should [look like this][example], but it'd +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]: https://github.com/rust-lang/libc/pull/583 +[example-pr]: https://github.com/rust-lang/libc/pull/2120 diff --git a/third_party/cargo/vendor/libc-0.2.82/Cargo.toml b/third_party/cargo/vendor/libc-0.2.92/Cargo.toml similarity index 98% rename from third_party/cargo/vendor/libc-0.2.82/Cargo.toml rename to third_party/cargo/vendor/libc-0.2.92/Cargo.toml index 0671dd3..a58b368 100644 --- a/third_party/cargo/vendor/libc-0.2.82/Cargo.toml +++ b/third_party/cargo/vendor/libc-0.2.92/Cargo.toml @@ -12,7 +12,7 @@ [package] name = "libc" -version = "0.2.82" +version = "0.2.92" authors = ["The Rust Project Developers"] build = "build.rs" exclude = ["/ci/*", "/.github/*", "/.cirrus.yml", "/triagebot.toml"] diff --git a/third_party/cargo/vendor/libc-0.2.82/LICENSE-APACHE b/third_party/cargo/vendor/libc-0.2.92/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/LICENSE-APACHE rename to third_party/cargo/vendor/libc-0.2.92/LICENSE-APACHE diff --git a/third_party/cargo/vendor/libc-0.2.82/LICENSE-MIT b/third_party/cargo/vendor/libc-0.2.92/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/LICENSE-MIT rename to third_party/cargo/vendor/libc-0.2.92/LICENSE-MIT diff --git a/third_party/cargo/vendor/libc-0.2.82/README.md b/third_party/cargo/vendor/libc-0.2.92/README.md similarity index 98% rename from third_party/cargo/vendor/libc-0.2.82/README.md rename to third_party/cargo/vendor/libc-0.2.92/README.md index f7b9669..a8a3afd 100644 --- a/third_party/cargo/vendor/libc-0.2.82/README.md +++ b/third_party/cargo/vendor/libc-0.2.92/README.md @@ -61,7 +61,7 @@ newer Rust features are only available on newer Rust toolchains: See [`ci/build.sh`](https://github.com/rust-lang/libc/blob/master/ci/build.sh) for the platforms on which `libc` is guaranteed to build for each Rust -toolchain. The test-matrix at [Azure] and [Cirrus CI] show the +toolchain. The test-matrix at [GitHub Actions] and [Cirrus CI] show the platforms in which `libc` tests are run.

diff --git a/third_party/cargo/vendor/libc-0.2.82/build.rs b/third_party/cargo/vendor/libc-0.2.92/build.rs similarity index 94% rename from third_party/cargo/vendor/libc-0.2.82/build.rs rename to third_party/cargo/vendor/libc-0.2.92/build.rs index 27cfb02..ef43dfb 100644 --- a/third_party/cargo/vendor/libc-0.2.82/build.rs +++ b/third_party/cargo/vendor/libc-0.2.92/build.rs @@ -10,6 +10,7 @@ fn main() { 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 target = env::var("TARGET").unwrap(); if env::var("CARGO_FEATURE_USE_STD").is_ok() { println!( @@ -82,6 +83,12 @@ fn main() { } println!("cargo:rustc-cfg=libc_const_extern_fn"); } + + // For unknown reason, libiconv can't be linked by adding #[link(name = iconv)] to + // a macOS-specific struct, so we do the linking here. + if target.contains("-apple-") { + println!("cargo:rustc-link-lib=iconv"); + } } fn rustc_minor_nightly() -> Option<(u32, bool)> { diff --git a/third_party/cargo/vendor/libc-0.2.82/rustfmt.toml b/third_party/cargo/vendor/libc-0.2.92/rustfmt.toml similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/rustfmt.toml rename to third_party/cargo/vendor/libc-0.2.92/rustfmt.toml diff --git a/third_party/cargo/vendor/libc-0.2.82/src/fixed_width_ints.rs b/third_party/cargo/vendor/libc-0.2.92/src/fixed_width_ints.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/fixed_width_ints.rs rename to third_party/cargo/vendor/libc-0.2.92/src/fixed_width_ints.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/fuchsia/aarch64.rs b/third_party/cargo/vendor/libc-0.2.92/src/fuchsia/aarch64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/fuchsia/aarch64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/fuchsia/aarch64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/fuchsia/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/fuchsia/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/fuchsia/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/fuchsia/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/fuchsia/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/fuchsia/mod.rs similarity index 99% rename from third_party/cargo/vendor/libc-0.2.82/src/fuchsia/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/fuchsia/mod.rs index e514173..d3d9e45 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/fuchsia/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/fuchsia/mod.rs @@ -1461,8 +1461,6 @@ 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; @@ -2908,7 +2906,8 @@ 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_NONBLOCK: ::c_int = 2048; +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; @@ -3257,12 +3256,12 @@ f! { } } - pub fn CMSG_ALIGN(len: ::size_t) -> ::size_t { + pub {const} fn CMSG_ALIGN(len: ::size_t) -> ::size_t { (len + ::mem::size_of::<::size_t>() - 1) & !(::mem::size_of::<::size_t>() - 1) } - pub fn CMSG_SPACE(len: ::c_uint) -> ::c_uint { + pub {const} fn CMSG_SPACE(len: ::c_uint) -> ::c_uint { (CMSG_ALIGN(len as ::size_t) + CMSG_ALIGN(::mem::size_of::())) as ::c_uint } diff --git a/third_party/cargo/vendor/libc-0.2.82/src/fuchsia/no_align.rs b/third_party/cargo/vendor/libc-0.2.92/src/fuchsia/no_align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/fuchsia/no_align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/fuchsia/no_align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/fuchsia/x86_64.rs b/third_party/cargo/vendor/libc-0.2.92/src/fuchsia/x86_64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/fuchsia/x86_64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/fuchsia/x86_64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/hermit/aarch64.rs b/third_party/cargo/vendor/libc-0.2.92/src/hermit/aarch64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/hermit/aarch64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/hermit/aarch64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/hermit/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/hermit/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/hermit/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/hermit/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/hermit/x86_64.rs b/third_party/cargo/vendor/libc-0.2.92/src/hermit/x86_64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/hermit/x86_64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/hermit/x86_64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/lib.rs b/third_party/cargo/vendor/libc-0.2.92/src/lib.rs similarity index 93% rename from third_party/cargo/vendor/libc-0.2.82/src/lib.rs rename to third_party/cargo/vendor/libc-0.2.92/src/lib.rs index 7184e23..30c94b0 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/lib.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/lib.rs @@ -17,15 +17,12 @@ )] #![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(cfg_target_vendor, link_cfg, no_core) -)] +#![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)] -#![no_std] +#![cfg_attr(not(feature = "rustc-dep-of-std"), no_std)] #![cfg_attr(feature = "rustc-dep-of-std", no_core)] #![cfg_attr( any(feature = "rustc-dep-of-std", target_os = "redox"), @@ -102,12 +99,6 @@ cfg_if! { mod windows; pub use windows::*; - } else if #[cfg(target_os = "cloudabi")] { - mod fixed_width_ints; - pub use fixed_width_ints::*; - - mod cloudabi; - pub use cloudabi::*; } else if #[cfg(target_os = "fuchsia")] { mod fixed_width_ints; pub use fixed_width_ints::*; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/macros.rs b/third_party/cargo/vendor/libc-0.2.92/src/macros.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/macros.rs rename to third_party/cargo/vendor/libc-0.2.92/src/macros.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/psp.rs b/third_party/cargo/vendor/libc-0.2.92/src/psp.rs similarity index 99% rename from third_party/cargo/vendor/libc-0.2.82/src/psp.rs rename to third_party/cargo/vendor/libc-0.2.92/src/psp.rs index 4b2c146..9babe1c 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/psp.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/psp.rs @@ -88,14 +88,12 @@ pub type SceMpegRingbufferCb = ::Option< >; pub type GuCallback = ::Option; -pub type GuSwapBuffersCallback = ::Option; -pub type SceNetAdhocctlHandler = ::Option; pub type AdhocMatchingCallback = ::Option< @@ -2794,7 +2792,7 @@ extern "C" { pub fn sceCtrlPeekLatch(latch_data: *mut SceCtrlLatch) -> i32; pub fn sceCtrlReadLatch(latch_data: *mut SceCtrlLatch) -> i32; pub fn sceCtrlSetIdleCancelThreshold(idlereset: i32, idleback: i32) - -> i32; + -> i32; pub fn sceCtrlGetIdleCancelThreshold( idlereset: *mut i32, idleback: *mut i32, @@ -3163,7 +3161,7 @@ extern "C" { timeout: *mut u32, ) -> i32; pub fn sceKernelPollMbx(mbx_id: SceUid, pmessage: *mut *mut c_void) - -> i32; + -> i32; pub fn sceKernelCancelReceiveMbx(mbx_id: SceUid, num: *mut i32) -> i32; pub fn sceKernelReferMbxStatus( mbx_id: SceUid, @@ -3321,7 +3319,7 @@ extern "C" { timeout: *mut u32, ) -> i32; pub fn sceKernelTryAllocateFpl(uid: SceUid, data: *mut *mut c_void) - -> i32; + -> i32; pub fn sceKernelFreeFpl(uid: SceUid, data: *mut c_void) -> i32; pub fn sceKernelCancelFpl(uid: SceUid, pnum: *mut i32) -> i32; pub fn sceKernelReferFplStatus( @@ -3574,10 +3572,12 @@ extern "C" { 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 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 + 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; @@ -3636,7 +3636,7 @@ extern "C" { 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; + -> i32; pub fn sceIoRemove(file: *const u8) -> i32; pub fn sceIoMkdir(dir: *const u8, mode: IoPermissions) -> i32; pub fn sceIoRmdir(path: *const u8) -> i32; @@ -4173,7 +4173,7 @@ extern "C" { ) -> i32; pub fn sceRegGetKeysNum(dir_handle: RegHandle, num: *mut i32) -> i32; pub fn sceRegGetKeys(dir_handle: RegHandle, buf: *mut u8, num: i32) - -> i32; + -> i32; pub fn sceRegCreateKey( dir_handle: RegHandle, name: *const u8, @@ -4315,7 +4315,7 @@ extern "C" { ) -> i32; pub fn sceNetAdhocctlDelHandler(id: i32) -> i32; pub fn sceNetAdhocctlGetNameByAddr(mac: *mut u8, nickname: *mut u8) - -> i32; + -> i32; pub fn sceNetAdhocctlGetAddrByName( nickname: *mut u8, length: *mut i32, @@ -4486,7 +4486,7 @@ extern "C" { ) -> i32; pub fn sceNetAdhocMatchingGetPoolMaxAlloc() -> i32; pub fn sceNetAdhocMatchingGetPoolStat(poolstat: *mut AdhocPoolStat) - -> i32; + -> i32; } extern "C" { @@ -4625,7 +4625,7 @@ extern "C" { content_length: *mut u64, ) -> i32; pub fn sceHttpGetStatusCode(request_id: i32, status_code: *mut i32) - -> 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; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/sgx.rs b/third_party/cargo/vendor/libc-0.2.92/src/sgx.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/sgx.rs rename to third_party/cargo/vendor/libc-0.2.92/src/sgx.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/switch.rs b/third_party/cargo/vendor/libc-0.2.92/src/switch.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/switch.rs rename to third_party/cargo/vendor/libc-0.2.92/src/switch.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/b32/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/b32/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/b32/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/b32/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/b32/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/b32/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/b32/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/b32/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/b64/aarch64/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/b64/aarch64/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/b64/aarch64/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/b64/aarch64/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/b64/aarch64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/b64/aarch64/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/b64/aarch64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/b64/aarch64/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/b64/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/b64/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/b64/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/b64/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/b64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/b64/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/b64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/b64/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/b64/x86_64/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/b64/x86_64/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/b64/x86_64/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/b64/x86_64/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/b64/x86_64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/b64/x86_64/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/b64/x86_64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/b64/x86_64/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/mod.rs similarity index 94% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/mod.rs index 5816039..4c48221 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/apple/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/apple/mod.rs @@ -26,6 +26,8 @@ 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 posix_spawnattr_t = *mut ::c_void; pub type posix_spawn_file_actions_t = *mut ::c_void; @@ -36,6 +38,20 @@ pub type sae_associd_t = u32; pub type sae_connid_t = u32; pub type mach_port_t = ::c_uint; +pub type processor_flavor_t = ::c_int; + +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; deprecated_mach! { pub type vm_prot_t = ::c_int; @@ -660,6 +676,30 @@ s_no_extra_traits! { __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, + } } impl siginfo_t { @@ -1274,6 +1314,106 @@ cfg_if! { 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(&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(&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(&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(&self, state: &mut H) { + self.task_count.hash(state); + self.thread_count.hash(state); + self.load_average.hash(state); + self.mach_factor.hash(state); + } + } } } @@ -1493,6 +1633,19 @@ 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; @@ -2323,6 +2476,7 @@ 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; @@ -3207,8 +3361,17 @@ pub const TIME_OOP: ::c_int = 3; pub const TIME_WAIT: ::c_int = 4; pub const TIME_ERROR: ::c_int = 5; +// +pub const MNT_WAIT: ::c_int = 1; +pub const MNT_NOWAIT: ::c_int = 2; + cfg_if! { - if #[cfg(libc_const_size_of)] { + if #[cfg(libc_const_extern_fn)] { + const fn __DARWIN_ALIGN32(p: usize) -> usize { + const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::() - 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::() - 1; p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32 @@ -3230,7 +3393,7 @@ f! { 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; + + (*mhdr).msg_controllen as usize; if next + __DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) > max { 0 as *mut ::cmsghdr } else { @@ -3243,7 +3406,7 @@ f! { .offset(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) as isize) } - pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { (__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) + __DARWIN_ALIGN32(length as usize)) as ::c_uint @@ -3538,6 +3701,18 @@ extern "C" { 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, @@ -3732,6 +3907,34 @@ extern "C" { 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; + + 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! { diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/dragonfly/errno.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/dragonfly/errno.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/dragonfly/errno.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/dragonfly/errno.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/dragonfly/mod.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/dragonfly/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 641fb89..2a803bd 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -17,6 +17,7 @@ pub type uuid_t = ::uuid; pub type fsblkcnt_t = u64; pub type fsfilcnt_t = u64; +pub type idtype_t = ::c_uint; pub type mqd_t = ::c_int; pub type sem_t = *mut sem; @@ -170,6 +171,14 @@ s! { 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_char, pub ss_size: ::size_t, @@ -237,7 +246,6 @@ s_no_extra_traits! { pub sigev_value: ::sigval, __unused3: *mut ::c_void //actually a function pointer } - } cfg_if! { @@ -982,8 +990,17 @@ 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 = 4; -pub const WSTOPPED: ::c_int = 0o177; +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; @@ -1003,8 +1020,10 @@ pub const SF_XLINK: ::c_ulong = 0x01000000; pub const UTIME_OMIT: c_long = -2; pub const UTIME_NOW: c_long = -1; -fn _CMSG_ALIGN(n: usize) -> usize { - (n + 3) & !3 +const_fn! { + {const} fn _CMSG_ALIGN(n: usize) -> usize { + (n + 3) & !3 + } } f! { @@ -1033,7 +1052,7 @@ f! { } } - pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { (_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + _CMSG_ALIGN(length as usize)) as ::c_uint } @@ -1061,6 +1080,13 @@ extern "C" { timeout: *mut ::timespec, ) -> ::c_int; + 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( diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/aarch64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/aarch64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/aarch64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/aarch64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/arm.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/arm.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/arm.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/arm.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs similarity index 98% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs index 33c59e2..a88e56c 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs @@ -1,4 +1,4 @@ -// APIs that had breaking changes after FreeBSD 11 +// 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; @@ -190,6 +190,7 @@ cfg_if! { } pub const ELAST: ::c_int = 96; +pub const RAND_MAX: ::c_int = 0x7fff_fffd; extern "C" { // Return type ::c_int was removed in FreeBSD 12 diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs similarity index 96% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs index e7cd9e4..647e11e 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs @@ -1,4 +1,4 @@ -// APIs that changed in FreeBSD12 +// APIs in FreeBSD 12 that have changed since 11. pub type nlink_t = u64; pub type dev_t = u64; @@ -200,17 +200,11 @@ pub const F_SEAL_WRITE: ::c_int = 0x0008; pub const GRND_NONBLOCK: ::c_uint = 0x1; pub const GRND_RANDOM: ::c_uint = 0x2; +pub const RAND_MAX: ::c_int = 0x7fff_fffd; + pub const SO_DOMAIN: ::c_int = 0x1019; -cfg_if! { - if #[cfg(not(freebsd13))] { - pub const ELAST: ::c_int = 96; - } else { - pub const EINTEGRITY: ::c_int = 97; - pub const ELAST: ::c_int = 97; - pub const GRND_INSECURE: ::c_uint = 0x4; - } -} +pub const ELAST: ::c_int = 96; extern "C" { pub fn setgrent(); diff --git a/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs new file mode 100644 index 0000000..80c6fa1 --- /dev/null +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs @@ -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 --git a/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs new file mode 100644 index 0000000..a974146 --- /dev/null +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs @@ -0,0 +1,250 @@ +// 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; + +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: ::intptr_t, + pub udata: *mut ::c_void, + pub ext: [u64; 4], + } +} + +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], + } +} + +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(&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(&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); + } + } + } +} + +pub const F_ADD_SEALS: ::c_int = 19; +pub const F_GET_SEALS: ::c_int = 20; +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; + +pub const GRND_NONBLOCK: ::c_uint = 0x1; +pub const GRND_RANDOM: ::c_uint = 0x2; + +pub const RAND_MAX: ::c_int = 0x7fff_ffff; + +pub const SO_DOMAIN: ::c_int = 0x1019; + +pub const EINTEGRITY: ::c_int = 97; +pub const ELAST: ::c_int = 97; +pub const GRND_INSECURE: ::c_uint = 0x4; + +extern "C" { + pub fn aio_readv(aiocbp: *mut ::aiocb) -> ::c_int; + pub fn aio_writev(aiocbp: *mut ::aiocb) -> ::c_int; + 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 clock_nanosleep( + clk_id: ::clockid_t, + flags: ::c_int, + rqtp: *const ::timespec, + rmtp: *mut ::timespec, + ) -> ::c_int; + + pub fn fdatasync(fd: ::c_int) -> ::c_int; + + pub fn getrandom( + buf: *mut ::c_void, + buflen: ::size_t, + flags: ::c_uint, + ) -> ::ssize_t; +} + +cfg_if! { + if #[cfg(any(target_arch = "x86_64", + target_arch = "aarch64"))] { + mod b64; + pub use self::b64::*; + } +} diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/mod.rs similarity index 94% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/mod.rs index edb2b29..6a6033d 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -89,14 +89,6 @@ s! { pub msg_ctime: ::time_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], - __cr_unused1: *mut ::c_void, - } - pub struct stack_t { pub ss_sp: *mut ::c_void, pub ss_size: ::size_t, @@ -143,6 +135,23 @@ s_no_extra_traits! { 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, @@ -225,6 +234,73 @@ cfg_if! { } } + #[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(&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(&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 @@ -335,14 +411,6 @@ pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0; pub const EXTATTR_NAMESPACE_USER: ::c_int = 1; pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2; -cfg_if! { - if #[cfg(any(freebsd10, freebsd11, freebsd12))] { - pub const RAND_MAX: ::c_int = 0x7fff_fffd; - } else { - pub const RAND_MAX: ::c_int = 0x7fff_ffff; - } -} - pub const PTHREAD_STACK_MIN: ::size_t = MINSIGSTKSZ; pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 4; pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + 32768; @@ -379,6 +447,8 @@ pub const NI_NUMERICSCOPE: ::c_int = 0x00000020; pub const Q_GETQUOTA: ::c_int = 0x700; pub const Q_SETQUOTA: ::c_int = 0x800; +pub const MAP_GUARD: ::c_int = 0x00002000; + pub const POSIX_FADV_NORMAL: ::c_int = 0; pub const POSIX_FADV_RANDOM: ::c_int = 1; pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2; @@ -637,7 +707,6 @@ pub const SO_PROTOCOL: ::c_int = 0x1016; pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL; pub const SO_VENDOR: ::c_int = 0x80000000; -pub const LOCAL_PEERCRED: ::c_int = 1; pub const LOCAL_CREDS: ::c_int = 2; pub const LOCAL_CONNWAIT: ::c_int = 4; pub const LOCAL_VENDOR: ::c_int = SO_VENDOR; @@ -1111,9 +1180,6 @@ pub const _PC_ACL_NFS4: ::c_int = 64; pub const _SC_CPUSET_SIZE: ::c_int = 122; -pub const XU_NGROUPS: ::c_int = 16; -pub const XUCRED_VERSION: ::c_uint = 0; - // Flags which can be passed to pdfork(2) pub const PD_DAEMON: ::c_int = 0x00000001; pub const PD_CLOEXEC: ::c_int = 0x00000002; @@ -1150,8 +1216,10 @@ pub const F_READAHEAD: ::c_int = 15; pub const F_RDAHEAD: ::c_int = 16; pub const F_DUP2FD_CLOEXEC: ::c_int = 18; -fn _ALIGN(p: usize) -> usize { - (p + _ALIGNBYTES) & !_ALIGNBYTES +const_fn! { + {const} fn _ALIGN(p: usize) -> usize { + (p + _ALIGNBYTES) & !_ALIGNBYTES + } } f! { @@ -1182,7 +1250,7 @@ f! { } } - pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { (_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize)) as ::c_uint } @@ -1539,10 +1607,10 @@ extern "C" { } cfg_if! { - if #[cfg(freebsd12)] { - mod freebsd12; - pub use self::freebsd12::*; - } else if #[cfg(freebsd13)] { + 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))] { diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/x86.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/x86.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/x86.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/x86.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/mod.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/mod.rs index d126391..32bf7e7 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/freebsdlike/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/freebsdlike/mod.rs @@ -32,6 +32,8 @@ pub type Elf64_Sxword = i64; pub type Elf64_Word = u32; pub type Elf64_Xword = u64; +pub type iconv_t = *mut ::c_void; + cfg_if! { if #[cfg(target_pointer_width = "64")] { type Elf_Addr = Elf64_Addr; @@ -270,6 +272,42 @@ s! { 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 { @@ -357,6 +395,14 @@ cfg_if! { } } +// Non-public helper constant +#[cfg(all(not(libc_const_size_of), target_pointer_width = "32"))] +const SIZEOF_LONG: usize = 4; +#[cfg(all(not(libc_const_size_of), target_pointer_width = "64"))] +const SIZEOF_LONG: usize = 8; +#[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" @@ -901,6 +947,8 @@ 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; @@ -1087,6 +1135,9 @@ pub const ST_NOSUID: ::c_ulong = 2; pub const NI_MAXHOST: ::size_t = 1025; +pub const XU_NGROUPS: ::c_int = 16; +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; @@ -1214,8 +1265,7 @@ pub const ONLRET: ::tcflag_t = 0x40; pub const CMGROUP_MAX: usize = 16; // https://github.com/freebsd/freebsd/blob/master/sys/net/bpf.h -// sizeof(long) -pub const BPF_ALIGNMENT: ::c_int = 8; +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; @@ -1593,6 +1643,19 @@ extern "C" { >, 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; } #[link(name = "rt")] diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/mod.rs similarity index 99% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/mod.rs index caab186..725f5cb 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/mod.rs @@ -634,8 +634,8 @@ extern "C" { #[cfg_attr( all(target_os = "macos", not(target_arch = "aarch64")), - link_name = "glob$INODE64") - ] + link_name = "glob$INODE64" + )] #[cfg_attr(target_os = "netbsd", link_name = "__glob30")] #[cfg_attr( all(target_os = "freebsd", any(freebsd11, freebsd10)), @@ -869,10 +869,7 @@ extern "C" { all(target_os = "macos", target_arch = "x86"), link_name = "getitimer$UNIX2003" )] - pub fn getitimer( - which: ::c_int, - curr_value: *mut ::itimerval - ) -> ::c_int; + 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" diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/netbsd/aarch64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/netbsd/aarch64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/netbsd/aarch64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/netbsd/aarch64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/netbsd/arm.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/netbsd/arm.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/netbsd/arm.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/netbsd/arm.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/netbsd/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/netbsd/mod.rs similarity index 98% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/netbsd/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/netbsd/mod.rs index 4b7dbaf..82b13e9 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -29,6 +29,8 @@ pub type Elf64_Sxword = i64; pub type Elf64_Word = u32; pub type Elf64_Xword = u64; +pub type iconv_t = *mut ::c_void; + cfg_if! { if #[cfg(target_pointer_width = "64")] { type Elf_Addr = Elf64_Addr; @@ -297,6 +299,12 @@ s! { pub sc_groups: [::gid_t; 1], } + 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, @@ -1045,6 +1053,12 @@ 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 @@ -1734,8 +1748,10 @@ pub const SF_SNAPSHOT: ::c_ulong = 0x00200000; pub const SF_LOG: ::c_ulong = 0x00400000; pub const SF_SNAPINVAL: ::c_ulong = 0x00800000; -fn _ALIGN(p: usize) -> usize { - (p + _ALIGNBYTES) & !_ALIGNBYTES +const_fn! { + {const} fn _ALIGN(p: usize) -> usize { + (p + _ALIGNBYTES) & !_ALIGNBYTES + } } f! { @@ -1766,7 +1782,7 @@ f! { } } - pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { (_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize)) as ::c_uint } @@ -2081,6 +2097,19 @@ extern "C" { >, 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; } #[link(name = "util")] diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/netbsd/powerpc.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/netbsd/powerpc.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/netbsd/powerpc.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/netbsd/powerpc.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/netbsd/sparc64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/netbsd/sparc64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/netbsd/sparc64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/netbsd/sparc64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/netbsd/x86.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/netbsd/x86.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/netbsd/x86.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/netbsd/x86.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/netbsd/x86_64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/netbsd/x86_64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/netbsd/x86_64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/netbsd/x86_64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/openbsd/aarch64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/openbsd/aarch64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/openbsd/aarch64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/openbsd/aarch64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/openbsd/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/openbsd/mod.rs similarity index 99% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/openbsd/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/openbsd/mod.rs index c46f3a4..a4b1d31 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -1397,16 +1397,14 @@ pub const PTRACE_FORK: ::c_int = 0x0002; pub const WCONTINUED: ::c_int = 8; -fn _ALIGN(p: usize) -> usize { - (p + _ALIGNBYTES) & !_ALIGNBYTES +const_fn! { + {const} fn _ALIGN(p: usize) -> usize { + (p + _ALIGNBYTES) & !_ALIGNBYTES + } } f! { - pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { - status & 0o177777 == 0o177777 - } - - pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar { + pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar { (cmsg as *mut ::c_uchar) .offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize) } @@ -1433,7 +1431,7 @@ f! { } } - pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { (_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize)) as ::c_uint } @@ -1451,6 +1449,10 @@ safe_f! { pub {const} fn WIFSTOPPED(status: ::c_int) -> bool { (status & 0xff) == 0o177 } + + pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { + (status & 0o177777) == 0o177777 + } } extern "C" { diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/openbsd/sparc64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/openbsd/sparc64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/openbsd/sparc64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/openbsd/sparc64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/openbsd/x86.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/openbsd/x86.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/openbsd/x86.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/openbsd/x86.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/openbsd/x86_64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/openbsd/x86_64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/bsd/netbsdlike/openbsd/x86_64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/bsd/netbsdlike/openbsd/x86_64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/haiku/b32.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/haiku/b32.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/haiku/b32.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/haiku/b32.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/haiku/b64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/haiku/b64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/haiku/b64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/haiku/b64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/haiku/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/haiku/mod.rs similarity index 90% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/haiku/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/haiku/mod.rs index 840e2f5..0fc9024 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/haiku/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/haiku/mod.rs @@ -1,9 +1,9 @@ pub type rlim_t = ::uintptr_t; pub type sa_family_t = u8; pub type pthread_key_t = ::c_int; -pub type nfds_t = ::c_long; +pub type nfds_t = ::c_ulong; pub type tcflag_t = ::c_uint; -pub type speed_t = ::c_uint; +pub type speed_t = ::c_uchar; pub type c_char = i8; pub type clock_t = i32; pub type clockid_t = i32; @@ -19,6 +19,7 @@ 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; @@ -28,6 +29,7 @@ pub type pthread_attr_t = *mut ::c_void; pub type nl_item = ::c_int; pub type id_t = i32; pub type idtype_t = ::c_uint; +pub type fd_mask = u32; #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum timezone {} @@ -69,7 +71,7 @@ s! { pub struct sockaddr { pub sa_len: u8, pub sa_family: sa_family_t, - pub sa_data: [::c_char; 30], + pub sa_data: [u8; 30], } pub struct sockaddr_in { @@ -77,13 +79,13 @@ s! { pub sin_family: sa_family_t, pub sin_port: ::in_port_t, pub sin_addr: ::in_addr, - pub sin_zero: [u8; 24], + pub sin_zero: [i8; 24], } pub struct sockaddr_in6 { pub sin6_len: u8, - pub sin6_family: sa_family_t, - pub sin6_port: ::in_port_t, + pub sin6_family: u8, + pub sin6_port: u16, pub sin6_flowinfo: u32, pub sin6_addr: ::in6_addr, pub sin6_scope_id: u32, @@ -101,7 +103,8 @@ s! { } pub struct fd_set { - fds_bits: [c_ulong; FD_SETSIZE / ULONG_SIZE], + // size for 1024 bits, and a fd_mask with size u32 + fds_bits: [fd_mask; 32], } pub struct tm { @@ -114,8 +117,8 @@ s! { 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 tm_gmtoff: ::c_int, + pub tm_zone: *mut ::c_char, } pub struct utsname { @@ -155,16 +158,16 @@ s! { pub struct msghdr { pub msg_name: *mut ::c_void, - pub msg_namelen: ::socklen_t, + 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_controllen: socklen_t, pub msg_flags: ::c_int, } pub struct cmsghdr { - pub cmsg_len: ::size_t, + pub cmsg_len: ::socklen_t, pub cmsg_level: ::c_int, pub cmsg_type: ::c_int, } @@ -301,22 +304,16 @@ s! { } pub struct sigaction { - pub sa_sigaction: ::sighandler_t, + 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 se_type: i32, - pub se_named_id: i32, // this is actually a union - pub se_unnamed: i32, - pub se_padding: [i32; 4], - } - - pub struct pthread_condattr_t { - pub process_shared: bool, - pub clock_id: i32, + pub type_: i32, + pub named_sem_id: i32, // actually a union with unnamed_sem (i32) + pub padding: [i32; 2], } } @@ -491,17 +488,6 @@ cfg_if! { } } -// 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; @@ -559,7 +545,7 @@ pub const RLIMIT_STACK: ::c_int = 5; pub const RLIMIT_AS: ::c_int = 6; // Haiku specific pub const RLIMIT_NOVMON: ::c_int = 7; -pub const RLIMIT_NLIMITS: ::c_int = 8; +pub const RLIM_NLIMITS: ::c_int = 8; pub const RUSAGE_SELF: ::c_int = 0; @@ -596,18 +582,20 @@ 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 = 70; -pub const S_IXGRP: ::mode_t = 10; -pub const S_IWGRP: ::mode_t = 20; -pub const S_IRGRP: ::mode_t = 40; -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 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; @@ -707,8 +695,8 @@ 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 = -2147457962; -pub const ESIGPARM: ::c_int = -2147457961; +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; @@ -756,7 +744,7 @@ pub const ETXTBSY: ::c_int = -2147454917; pub const ENOATTR: ::c_int = -2147454916; // INT_MIN -pub const ENOMEM: ::c_int = -2147454976; +pub const ENOMEM: ::c_int = -2147483648; // POSIX errors that can be mapped to BeOS error codes pub const EACCES: ::c_int = -2147483646; @@ -844,6 +832,9 @@ 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; @@ -854,7 +845,7 @@ 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_REVCHOPLIMIT: ::c_int = 34; +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; @@ -883,6 +874,7 @@ pub const LOCK_UN: ::c_int = 0x08; 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; @@ -933,7 +925,10 @@ 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_int = 0xbe000000; +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; @@ -1210,36 +1205,89 @@ pub const TCIFLUSH: ::c_int = 0x01; pub const TCOFLUSH: ::c_int = 0x02; pub const TCIOFLUSH: ::c_int = 0x03; -pub const TCGETA: ::c_int = 0x8000; -pub const TCSETA: ::c_int = TCGETA + 1; -pub const TCSETAF: ::c_int = TCGETA + 2; -pub const TCSETAW: ::c_int = TCGETA + 3; -pub const TCWAITEVENT: ::c_int = TCGETA + 4; -pub const TCSBRK: ::c_int = TCGETA + 5; -pub const TCFLSH: ::c_int = TCGETA + 6; -pub const TCXONC: ::c_int = TCGETA + 7; -pub const TCQUERYCONNECTED: ::c_int = TCGETA + 8; -pub const TCGETBITS: ::c_int = TCGETA + 9; -pub const TCSETDTR: ::c_int = TCGETA + 10; -pub const TCSETRTS: ::c_int = TCGETA + 11; -pub const TIOCGWINSZ: ::c_int = TCGETA + 12; -pub const TIOCSWINSZ: ::c_int = TCGETA + 13; -pub const TCVTIME: ::c_int = TCGETA + 14; -pub const TIOCGPGRP: ::c_int = TCGETA + 15; -pub const TIOCSPGRP: ::c_int = TCGETA + 16; -pub const TIOCSCTTY: ::c_int = TCGETA + 17; -pub const TIOCMGET: ::c_int = TCGETA + 18; -pub const TIOCMSET: ::c_int = TCGETA + 19; -pub const TIOCSBRK: ::c_int = TCGETA + 20; -pub const TIOCCBRK: ::c_int = TCGETA + 21; -pub const TIOCMBIS: ::c_int = TCGETA + 22; -pub const TIOCMBIC: ::c_int = TCGETA + 23; +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 TCWAITEVENT: ::c_ulong = TCGETA + 4; +pub const TCSBRK: ::c_ulong = TCGETA + 5; +pub const TCFLSH: ::c_ulong = TCGETA + 6; +pub const TCXONC: ::c_ulong = TCGETA + 7; +pub const TCQUERYCONNECTED: ::c_ulong = TCGETA + 8; +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 TCVTIME: ::c_ulong = TCGETA + 14; +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 PRIO_PROCESS: ::c_int = 0; pub const PRIO_PGRP: ::c_int = 1; pub const PRIO_USER: ::c_int = 2; +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; + +const_fn! { + {const} fn CMSG_ALIGN(len: usize) -> usize { + len + ::mem::size_of::() - 1 & !(::mem::size_of::() - 1) + } +} + f! { + pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { + if (*mhdr).msg_controllen as usize >= ::mem::size_of::() { + (*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::())) + as ::c_uint + } + + pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { + CMSG_ALIGN(::mem::size_of::()) 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; @@ -1368,10 +1416,10 @@ extern "C" { clock_id: ::clockid_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 ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; + pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int; + pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; pub fn mprotect( - addr: *const ::c_void, + addr: *mut ::c_void, len: ::size_t, prot: ::c_int, ) -> ::c_int; @@ -1380,9 +1428,9 @@ extern "C" { sa: *const ::sockaddr, salen: ::socklen_t, host: *mut ::c_char, - hostlen: ::size_t, + hostlen: ::socklen_t, serv: *mut ::c_char, - sevlen: ::size_t, + sevlen: ::socklen_t, flags: ::c_int, ) -> ::c_int; pub fn pthread_mutex_timedlock( @@ -1455,12 +1503,12 @@ extern "C" { pub fn writev( fd: ::c_int, iov: *const ::iovec, - iovcnt: ::c_int, + count: ::c_int, ) -> ::ssize_t; pub fn readv( fd: ::c_int, iov: *const ::iovec, - iovcnt: ::c_int, + count: ::c_int, ) -> ::ssize_t; pub fn sendmsg( @@ -1553,3 +1601,6 @@ cfg_if! { pub use self::b32::*; } } + +mod native; +pub use self::native::*; diff --git a/third_party/cargo/vendor/libc-0.2.92/src/unix/haiku/native.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/haiku/native.rs new file mode 100644 index 0000000..c5ae21a --- /dev/null +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/haiku/native.rs @@ -0,0 +1,1146 @@ +// 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 + } +} + +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 { + team: team_id, + thread_count: i32, + image_count: i32, + area_count: i32, + debugger_nub_thread: thread_id, + debugger_nub_port: port_id, + argc: i32, + args: [::c_char; 64], + uid: ::uid_t, + gid: ::gid_t + } + + pub struct sem_info { + sem: sem_id, + team: team_id, + name: [::c_char; B_OS_NAME_LENGTH], + count: i32, + latest_holder: thread_id + } + + pub struct team_usage_info { + user_time: bigtime_t, + 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 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 + } + + // kernel/fs_attr.h + pub struct attr_info { + type_: u32, + size: ::off_t + } + + // kernel/fs_index.h + pub struct index_info { + type_: u32, + size: ::off_t, + modification_time: ::time_t, + creation_time: ::time_t, + uid: ::uid_t, + gid: ::gid_t + } + + //kernel/fs_info.h + pub struct fs_info { + dev: ::dev_t, + root: ::ino_t, + flags: u32, + block_size: ::off_t, + io_size: ::off_t, + total_blocks: ::off_t, + free_blocks: ::off_t, + total_nodes: ::off_t, + free_nodes: ::off_t, + device_name: [::c_char; 128], + volume_name: [::c_char; B_FILE_NAME_LENGTH], + 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 + } +} + +// 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_NOT_FOUND: status_t = B_STORAGE_ERROR_BASE + 1; +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 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 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; + + // TODO: cpuid_info struct and the get_cpuid() function + + pub fn get_system_info(info: *mut system_info) -> status_t; + pub fn get_cpu_info( + firstCPU: u32, + cpuCount: u32, + info: *mut cpu_info, + ) -> 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; +} + +// The following functions are defined as macros in C/C++ +pub unsafe fn get_area_info(id: area_id, info: *mut area_info) -> status_t { + _get_area_info(id, info, core::mem::size_of::() as usize) +} + +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::() as usize, + ) +} + +pub unsafe fn get_port_info(port: port_id, buf: *mut port_info) -> status_t { + _get_port_info(port, buf, core::mem::size_of::() as ::size_t) +} + +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::() as ::size_t, + ) +} + +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::() as ::size_t, + flags, + timeout, + ) +} + +pub unsafe fn get_sem_info(id: sem_id, info: *mut sem_info) -> status_t { + _get_sem_info(id, info, core::mem::size_of::() as ::size_t) +} + +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::() as ::size_t, + ) +} + +pub unsafe fn get_team_info(team: team_id, info: *mut team_info) -> status_t { + _get_team_info(team, info, core::mem::size_of::() as ::size_t) +} + +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::() as ::size_t, + ) +} + +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::() as ::size_t, + ) +} + +pub unsafe fn get_thread_info( + id: thread_id, + info: *mut thread_info, +) -> status_t { + _get_thread_info(id, info, core::mem::size_of::() as ::size_t) +} + +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::() as ::size_t, + ) +} + +// kernel/image.h +pub unsafe fn get_image_info( + image: image_id, + info: *mut image_info, +) -> status_t { + _get_image_info( + image, + info, + core::mem::size_of::() as ::size_t, + ) +} + +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::() as ::size_t, + ) +} diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/hermit/aarch64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/hermit/aarch64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/hermit/aarch64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/hermit/aarch64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/hermit/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/hermit/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/hermit/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/hermit/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/hermit/x86_64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/hermit/x86_64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/hermit/x86_64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/hermit/x86_64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b32/arm.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b32/arm.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b32/arm.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b32/arm.rs index aa9beb7..8a53e53 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b32/arm.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b32/arm.rs @@ -521,3 +521,19 @@ 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 --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b32/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b32/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b32/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b32/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b32/x86/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b32/x86/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b32/x86/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b32/x86/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b32/x86/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b32/x86/mod.rs similarity index 95% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b32/x86/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b32/x86/mod.rs index 879ea1a..6507cb4 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b32/x86/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b32/x86/mod.rs @@ -574,6 +574,35 @@ 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; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b64/aarch64/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b64/aarch64/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b64/aarch64/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b64/aarch64/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b64/aarch64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b64/aarch64/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b64/aarch64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b64/aarch64/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b64/mod.rs similarity index 94% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b64/mod.rs index 96244d1..c23e2db 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b64/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b64/mod.rs @@ -305,6 +305,22 @@ 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; } diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b64/x86_64/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b64/x86_64/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b64/x86_64/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b64/x86_64/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b64/x86_64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b64/x86_64/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/b64/x86_64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/b64/x86_64/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/mod.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/mod.rs index b61399b..a86bf96 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/android/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/android/mod.rs @@ -1078,8 +1078,10 @@ pub const SO_SNDTIMEO: ::c_int = 21; pub const SO_BINDTODEVICE: ::c_int = 25; 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_MARK: ::c_int = 36; pub const SO_PROTOCOL: ::c_int = 38; pub const SO_DOMAIN: ::c_int = 39; @@ -2350,20 +2352,6 @@ f! { pub fn SO_EE_OFFENDER(ee: *const ::sock_extended_err) -> *mut ::sockaddr { ee.offset(1) as *mut ::sockaddr } - - // 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" { @@ -2821,6 +2809,10 @@ extern "C" { ) -> ::size_t; pub fn regfree(preg: *mut ::regex_t); + + pub fn android_set_abort_message(msg: *const ::c_char); + + pub fn gettid() -> ::pid_t; } cfg_if! { @@ -2836,6 +2828,17 @@ cfg_if! { } 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 { @@ -2849,3 +2852,65 @@ impl siginfo_t { (*(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 --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/emscripten/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/emscripten/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/emscripten/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/emscripten/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/emscripten/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/emscripten/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/emscripten/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/emscripten/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/emscripten/no_align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/emscripten/no_align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/emscripten/no_align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/emscripten/no_align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/arm/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/arm/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/arm/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/arm/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/arm/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/arm/mod.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/arm/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/arm/mod.rs index f5be28e..95c0716 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/arm/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/arm/mod.rs @@ -212,7 +212,7 @@ 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 MAP_SYNC: ::c_int = 0x080000; pub const SOL_SOCKET: ::c_int = 1; @@ -321,8 +321,11 @@ 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_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_INCOMING_CPU: ::c_int = 49; pub const SA_SIGINFO: ::c_int = 0x00000004; pub const SA_NOCLDWAIT: ::c_int = 0x00000002; @@ -868,8 +871,25 @@ 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; cfg_if! { if #[cfg(libc_align)] { diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/mips/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/mips/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/mips/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/mips/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/mips/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/mips/mod.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/mips/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/mips/mod.rs index 0903eae..d502606 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/mips/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/mips/mod.rs @@ -527,8 +527,25 @@ 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 O_DIRECT: ::c_int = 0x8000; pub const O_DIRECTORY: ::c_int = 0x10000; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/mod.rs similarity index 99% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/mod.rs index 5e0076e..c7fa1a8 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/mod.rs @@ -321,7 +321,6 @@ pub const PTRACE_SETREGS: ::c_uint = 13; pub const TIOCSBRK: ::c_int = 0x5427; pub const TIOCCBRK: ::c_int = 0x5428; -#[link(name = "util")] extern "C" { pub fn sysctl( name: *mut ::c_int, diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/powerpc.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/powerpc.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/powerpc.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/powerpc.rs index 1ac8445..e20c298 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/powerpc.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/powerpc.rs @@ -213,7 +213,7 @@ 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 MAP_SYNC: ::c_int = 0x080000; pub const SOL_SOCKET: ::c_int = 1; @@ -325,6 +325,8 @@ pub const SO_RCVTIMEO: ::c_int = 18; pub const SO_SNDTIMEO: ::c_int = 19; pub const SO_PASSCRED: ::c_int = 20; pub const SO_PEERCRED: ::c_int = 21; +pub const SO_PEERSEC: ::c_int = 31; +pub const SO_PASSSEC: ::c_int = 34; pub const SA_SIGINFO: ::c_int = 0x00000004; pub const SA_NOCLDWAIT: ::c_int = 0x00000002; @@ -872,5 +874,22 @@ 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; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs index 0d54886..16ce074 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs @@ -417,7 +417,7 @@ 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 MAP_SYNC: ::c_int = 0x080000; pub const EDEADLOCK: ::c_int = 35; pub const EUCLEAN: ::c_int = 117; pub const ENOTNAM: ::c_int = 118; @@ -818,3 +818,22 @@ 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; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/sparc/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/sparc/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/sparc/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/sparc/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs index 4c32902..ed12248 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs @@ -239,7 +239,7 @@ 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 MAP_SYNC: ::c_int = 0x080000; pub const EDEADLK: ::c_int = 78; pub const ENAMETOOLONG: ::c_int = 63; @@ -324,6 +324,8 @@ pub const SOL_SOCKET: ::c_int = 0xffff; pub const SO_PASSCRED: ::c_int = 2; pub const SO_REUSEADDR: ::c_int = 4; +pub const SO_PEERSEC: ::c_int = 0x001e; +pub const SO_PASSSEC: ::c_int = 0x001f; pub const SO_TYPE: ::c_int = 0x1008; pub const SO_ERROR: ::c_int = 0x1007; pub const SO_DONTROUTE: ::c_int = 16; @@ -906,9 +908,26 @@ 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_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; cfg_if! { if #[cfg(libc_align)] { diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/x86/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/x86/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/x86/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/x86/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/x86/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/x86/mod.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/x86/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/x86/mod.rs index f1a4aed..77253d0 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b32/x86/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b32/x86/mod.rs @@ -416,7 +416,7 @@ 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 MAP_SYNC: ::c_int = 0x080000; pub const EDEADLOCK: ::c_int = 35; pub const EUCLEAN: ::c_int = 117; @@ -526,6 +526,9 @@ 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_PEERSEC: ::c_int = 31; +pub const SO_PASSSEC: ::c_int = 34; +pub const SO_INCOMING_CPU: ::c_int = 49; pub const SA_SIGINFO: ::c_int = 0x00000004; pub const SA_NOCLDWAIT: ::c_int = 0x00000002; @@ -1103,8 +1106,25 @@ 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; // offsets in user_regs_structs, from sys/reg.h pub const EBX: ::c_int = 0; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs new file mode 100644 index 0000000..24b7f4e --- /dev/null +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs @@ -0,0 +1,62 @@ +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; + +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 --git a/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs new file mode 100644 index 0000000..14d39e5 --- /dev/null +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs @@ -0,0 +1,71 @@ +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; + +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 --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs similarity index 95% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs index 6bb1039..f546228 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs @@ -1,9 +1,5 @@ //! AArch64-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 = u32; pub type nlink_t = u32; @@ -143,7 +139,7 @@ s! { } pub struct pthread_attr_t { - __size: [u64; 8] + __size: [usize; 8] } pub struct ipc_perm { @@ -212,7 +208,6 @@ s! { } pub const VEOF: usize = 4; -pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; pub const RTLD_DEEPBIND: ::c_int = 0x8; pub const RTLD_GLOBAL: ::c_int = 0x100; @@ -514,37 +509,6 @@ pub const EPOLL_CLOEXEC: ::c_int = 0x80000; pub const EFD_CLOEXEC: ::c_int = 0x80000; -pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8; -pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 48; -pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 8; - -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, 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, 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, - ], - }; - 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, - ], - }; -} - pub const O_DIRECT: ::c_int = 0x10000; pub const O_DIRECTORY: ::c_int = 0x4000; pub const O_NOFOLLOW: ::c_int = 0x8000; @@ -776,7 +740,7 @@ 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; +// 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; @@ -821,7 +785,7 @@ 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; +// 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; @@ -900,8 +864,8 @@ 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; +// 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; @@ -1012,10 +976,26 @@ 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; -#[link(name = "util")] extern "C" { pub fn sysctl( name: *mut ::c_int, @@ -1027,6 +1007,16 @@ extern "C" { ) -> ::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; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/mips64/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/mips64/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/mips64/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/mips64/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs index ed279eb..6e2bd3c 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs @@ -577,8 +577,25 @@ 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 SFD_CLOEXEC: ::c_int = 0x080000; @@ -1004,7 +1021,6 @@ pub const TIOCM_DSR: ::c_int = 0x400; pub const EHWPOISON: ::c_int = 168; -#[link(name = "util")] extern "C" { pub fn sysctl( name: *mut ::c_int, diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/mod.rs similarity index 87% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/mod.rs index 40ce844..138adc9 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/mod.rs @@ -1,7 +1,5 @@ //! 64-bit specific definitions for linux-like values -pub type clock_t = i64; -pub type time_t = i64; pub type ino_t = u64; pub type off_t = i64; pub type blkcnt_t = i64; @@ -11,7 +9,17 @@ pub type msglen_t = u64; pub type fsblkcnt_t = u64; pub type fsfilcnt_t = u64; pub type rlim_t = u64; -pub type __fsword_t = i64; +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 { diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs index 57c3cff..d4a946f 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs @@ -552,7 +552,7 @@ 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 MAP_SYNC: ::c_int = 0x080000; pub const EDEADLOCK: ::c_int = 58; pub const EUCLEAN: ::c_int = 117; @@ -1043,10 +1043,26 @@ 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; -#[link(name = "util")] extern "C" { pub fn sysctl( name: *mut ::c_int, diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs index 14bae11..8580489 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs @@ -463,7 +463,7 @@ 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 MAP_SYNC: ::c_int = 0x080000; pub const EDEADLOCK: ::c_int = 35; pub const EUCLEAN: ::c_int = 117; pub const ENOTNAM: ::c_int = 118; @@ -863,5 +863,22 @@ 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; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/s390x.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/s390x.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/s390x.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/s390x.rs index cf951d1..b5032f9 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/s390x.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/s390x.rs @@ -486,8 +486,10 @@ pub const SO_PEERCRED: ::c_int = 17; pub const SO_RCVLOWAT: ::c_int = 18; pub const SO_SNDLOWAT: ::c_int = 19; 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 SIGTTIN: ::c_int = 21; pub const SIGTTOU: ::c_int = 22; @@ -1007,10 +1009,26 @@ 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; -#[link(name = "util")] extern "C" { pub fn sysctl( diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs index 00a10fa..60a13c3 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs @@ -247,7 +247,7 @@ 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 MAP_SYNC: ::c_int = 0x080000; pub const EDEADLK: ::c_int = 78; pub const ENAMETOOLONG: ::c_int = 63; @@ -334,6 +334,8 @@ pub const SO_PASSCRED: ::c_int = 2; pub const SO_REUSEADDR: ::c_int = 4; pub const SO_BINDTODEVICE: ::c_int = 0x000d; pub const SO_TIMESTAMP: ::c_int = 0x001d; +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_PEEK_OFF: ::c_int = 0x0026; @@ -973,11 +975,27 @@ 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_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; -#[link(name = "util")] extern "C" { pub fn sysctl( name: *mut ::c_int, diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs similarity index 99% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs index 5197c52..faad040 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs @@ -720,7 +720,7 @@ 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 MAP_SYNC: ::c_int = 0x080000; pub const EDEADLOCK: ::c_int = 35; pub const EUCLEAN: ::c_int = 117; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs similarity index 95% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs index ab9b76a..e126984 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs @@ -409,8 +409,25 @@ 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; extern "C" { pub fn sysctl( diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs similarity index 95% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs index 82b71c1..dcbc347 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs @@ -337,8 +337,25 @@ 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_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_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; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/mod.rs similarity index 93% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/mod.rs index 5762a3d..32e9a9b 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/mod.rs @@ -13,7 +13,7 @@ s! { pub stx_uid: u32, pub stx_gid: u32, pub stx_mode: u16, - pub __statx_pad1: [u16; 1], + __statx_pad1: [u16; 1], pub stx_ino: u64, pub stx_size: u64, pub stx_blocks: u64, @@ -26,7 +26,9 @@ s! { pub stx_rdev_minor: u32, pub stx_dev_major: u32, pub stx_dev_minor: u32, - pub __statx_pad2: [u64; 14], + pub stx_mnt_id: u64, + __statx_pad2: u64, + __statx_pad3: [u64; 12], } pub struct statx_timestamp { @@ -285,6 +287,19 @@ s! { __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, + } } impl siginfo_t { @@ -475,20 +490,20 @@ cfg_if! { // 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_MASK: ::c_int = 0x3f; -pub const HUGETLB_FLAG_ENCODE_64KB: ::c_int = 16 << HUGETLB_FLAG_ENCODE_SHIFT; +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_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; +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 /* @@ -499,20 +514,20 @@ pub const HUGETLB_FLAG_ENCODE_16GB: ::c_int = 34 << HUGETLB_FLAG_ENCODE_SHIFT; * 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_MASK: ::c_int = HUGETLB_FLAG_ENCODE_MASK; -pub const MAP_HUGE_64KB: ::c_int = HUGETLB_FLAG_ENCODE_64KB; +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_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 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 RLIMIT_CPU: ::__rlimit_resource_t = 0; pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1; @@ -618,6 +633,22 @@ pub const TCP_FASTOPEN: ::c_int = 23; pub const TCP_TIMESTAMP: ::c_int = 24; pub const TCP_FASTOPEN_CONNECT: ::c_int = 30; +pub const FAN_MARK_INODE: ::c_uint = 0x0000_0000; +pub const FAN_MARK_MOUNT: ::c_uint = 0x0000_0010; +// NOTE: FAN_MARK_FILESYSTEM requires Linux Kernel >= 4.20.0 +pub const FAN_MARK_FILESYSTEM: ::c_uint = 0x0000_0100; + +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; + /* DCCP socket options */ pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1; pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2; @@ -644,6 +675,7 @@ 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; @@ -768,6 +800,9 @@ cfg_if! { 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; @@ -819,6 +854,9 @@ cfg_if! { 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; @@ -855,10 +893,14 @@ pub const PTRACE_INTERRUPT: ::c_uint = 0x4207; pub const PTRACE_LISTEN: ::c_uint = 0x4208; pub const PTRACE_PEEKSIGINFO: ::c_uint = 0x4209; -pub const EPOLLWAKEUP: ::c_int = 0x20000000; +// linux/fs.h -pub const SEEK_DATA: ::c_int = 3; -pub const SEEK_HOLE: ::c_int = 4; +// 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; @@ -1171,6 +1213,7 @@ 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_ALL: ::c_uint = 0x0fff; pub const STATX__RESERVED: ::c_int = 0x80000000; pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004; @@ -1180,33 +1223,6 @@ pub const STATX_ATTR_NODUMP: ::c_int = 0x0040; pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800; pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000; -// sys/auxv.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; -// AT_* values 18 through 22 are reserved -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; - //sys/timex.h pub const ADJ_OFFSET: ::c_uint = 0x0001; pub const ADJ_FREQUENCY: ::c_uint = 0x0002; @@ -1420,6 +1436,27 @@ extern "C" { 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 renameat2( + olddirfd: ::c_int, + oldpath: *const ::c_char, + newdirfd: ::c_int, + newpath: *const ::c_char, + flags: ::c_uint, + ) -> ::c_int; } extern "C" { diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/no_align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/no_align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/gnu/no_align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/gnu/no_align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/mod.rs similarity index 89% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/mod.rs index 60f78df..058b0df 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/mod.rs @@ -40,6 +40,8 @@ pub type Elf64_Section = u16; pub type canid_t = u32; pub type can_err_mask_t = u32; +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 {} @@ -282,6 +284,24 @@ s! { 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, @@ -300,9 +320,18 @@ s! { #[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, } @@ -406,19 +435,6 @@ s! { pub sh_entsize: Elf64_Xword, } - pub struct Elf32_Chdr { - pub ch_type: Elf32_Word, - pub ch_size: Elf32_Word, - pub ch_addralign: Elf32_Word, - } - - 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 ucred { pub pid: ::pid_t, pub uid: ::uid_t, @@ -559,6 +575,22 @@ s_no_extra_traits! { 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( @@ -829,6 +861,72 @@ cfg_if! { } } + 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(&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(&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] { @@ -897,78 +995,76 @@ cfg_if! { } } -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; +cfg_if! { + if #[cfg(any(target_env = "gnu", target_env = "musl"))] { + 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 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 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 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 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 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 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 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 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; @@ -1139,6 +1235,32 @@ 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 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 GLOB_ERR: ::c_int = 1 << 0; pub const GLOB_MARK: ::c_int = 1 << 1; pub const GLOB_NOSORT: ::c_int = 1 << 2; @@ -1278,6 +1400,10 @@ pub const IFF_DETACH_QUEUE: ::c_int = 0x0400; pub const IFF_PERSIST: ::c_int = 0x0800; pub const IFF_NOFILTER: ::c_int = 0x1000; +// 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; @@ -1298,7 +1424,6 @@ pub const RTLD_NOW: ::c_int = 0x2; pub const AT_EACCESS: ::c_int = 0x200; pub const TCP_MD5SIG: ::c_int = 14; -pub const TCP_ULP: ::c_int = 31; align_const! { pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { @@ -1319,9 +1444,9 @@ 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 RENAME_NOREPLACE: ::c_uint = 1; +pub const RENAME_EXCHANGE: ::c_uint = 2; +pub const RENAME_WHITEOUT: ::c_uint = 4; pub const SCHED_OTHER: ::c_int = 0; pub const SCHED_FIFO: ::c_int = 1; @@ -1344,17 +1469,6 @@ pub const IPPROTO_MPTCP: ::c_int = 262; )] 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 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; - // System V IPC pub const IPC_PRIVATE: ::key_t = 0; @@ -1371,7 +1485,6 @@ 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; @@ -1379,16 +1492,17 @@ 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; +#[cfg(not(all(target_env = "uclibc", target_arch = "mips")))] pub const SHM_NORESERVE: ::c_int = 0o10000; 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 QFMT_VFS_OLD: ::c_int = 1; @@ -1440,14 +1554,28 @@ 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 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; +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 TCP_ULP: ::c_int = 31; + 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; @@ -1610,8 +1738,6 @@ 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; @@ -1623,6 +1749,7 @@ pub const IPV6_RTHDR_LOOSE: ::c_int = 0; pub const IPV6_RTHDR_STRICT: ::c_int = 1; 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; @@ -1941,7 +2068,6 @@ 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; -pub const PACKET_MR_UNICAST: ::c_int = 3; // linux/netfilter.h pub const NF_DROP: ::c_int = 0; @@ -2062,8 +2188,6 @@ pub const SIOCSRARP: ::c_ulong = 0x00008962; pub const SIOCGIFMAP: ::c_ulong = 0x00008970; pub const SIOCSIFMAP: ::c_ulong = 0x00008971; -pub const PTRACE_EVENT_STOP: ::c_int = 128; - pub const IPTOS_TOS_MASK: u8 = 0x1E; pub const IPTOS_PREC_MASK: u8 = 0xE0; @@ -2366,8 +2490,6 @@ 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; -pub const UDP_SEGMENT: ::c_int = 103; -pub const UDP_GRO: ::c_int = 104; // include/uapi/linux/mman.h pub const MAP_SHARED_VALIDATE: ::c_int = 0x3; @@ -2475,6 +2597,38 @@ pub const IN_ALL_EVENTS: u32 = IN_ACCESS pub const IN_CLOEXEC: ::c_int = O_CLOEXEC; pub const IN_NONBLOCK: ::c_int = O_NONBLOCK; +// 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; @@ -2507,10 +2661,6 @@ 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_INODE: ::c_uint = 0x0000_0000; -pub const FAN_MARK_MOUNT: ::c_uint = 0x0000_0010; -// NOTE: FAN_MARK_FILESYSTEM requires Linux Kernel >= 4.20.0 -pub const FAN_MARK_FILESYSTEM: ::c_uint = 0x0000_0100; 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; @@ -2790,6 +2940,75 @@ f! { } } +cfg_if! { + if #[cfg(not(target_env = "uclibc"))] { + 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; + 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, + sevlen: ::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; + } + } +} + extern "C" { #[cfg_attr(not(target_env = "musl"), link_name = "__xpg_strerror_r")] pub fn strerror_r( @@ -2804,24 +3023,6 @@ extern "C" { pub fn rand() -> ::c_int; pub fn srand(seed: ::c_uint); - 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 lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; pub fn setpwent(); @@ -3020,18 +3221,6 @@ extern "C" { 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, @@ -3101,36 +3290,10 @@ extern "C" { 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, - sevlen: ::socklen_t, - flags: ::c_int, - ) -> ::c_int; pub fn pthread_setschedprio( native: ::pthread_t, priority: ::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 reboot(how_to: ::c_int) -> ::c_int; pub fn setfsgid(gid: ::gid_t) -> ::c_int; pub fn setfsuid(uid: ::uid_t) -> ::c_int; @@ -3205,7 +3368,7 @@ extern "C" { 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 getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int; @@ -3576,10 +3739,28 @@ extern "C" { ) -> ::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; } cfg_if! { - if #[cfg(target_env = "musl")] { + if #[cfg(target_env = "uclibc")] { + mod uclibc; + pub use self::uclibc::*; + } else if #[cfg(target_env = "musl")] { mod musl; pub use self::musl::*; } else if #[cfg(target_env = "gnu")] { diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/arm/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/arm/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/arm/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/arm/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/arm/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/arm/mod.rs similarity index 96% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/arm/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/arm/mod.rs index 61977ed..d05d03a 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/arm/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/arm/mod.rs @@ -262,7 +262,7 @@ 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 MAP_SYNC: ::c_int = 0x080000; pub const SOCK_STREAM: ::c_int = 1; pub const SOCK_DGRAM: ::c_int = 2; @@ -377,10 +377,13 @@ 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_PASSSEC: ::c_int = 34; pub const SO_PROTOCOL: ::c_int = 38; pub const SO_DOMAIN: ::c_int = 39; +pub const SO_INCOMING_CPU: ::c_int = 49; pub const SA_ONSTACK: ::c_int = 0x08000000; pub const SA_SIGINFO: ::c_int = 0x00000004; @@ -832,6 +835,25 @@ 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; extern "C" { pub fn getrandom( diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/hexagon.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/hexagon.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/hexagon.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/hexagon.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/mips/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/mips/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/mips/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/mips/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/mips/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/mips/mod.rs similarity index 96% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/mips/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/mips/mod.rs index 2e17ccc..8e328fc 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/mips/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/mips/mod.rs @@ -388,8 +388,10 @@ 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_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 SA_ONSTACK: ::c_int = 0x08000000; pub const SA_SIGINFO: ::c_int = 8; @@ -843,6 +845,25 @@ 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; cfg_if! { if #[cfg(libc_align)] { diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/powerpc.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/powerpc.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/powerpc.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/powerpc.rs index b94bb7b..eef11f1 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/powerpc.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/powerpc.rs @@ -379,8 +379,10 @@ pub const SO_SNDTIMEO: ::c_int = 19; pub const SO_PASSCRED: ::c_int = 20; pub const SO_PEERCRED: ::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_PASSSEC: ::c_int = 34; pub const SO_PROTOCOL: ::c_int = 38; pub const SO_DOMAIN: ::c_int = 39; @@ -856,6 +858,25 @@ 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; extern "C" { pub fn getrandom( diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/x86/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/x86/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/x86/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/x86/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/x86/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/x86/mod.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/x86/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/x86/mod.rs index f582116..8cb280b 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b32/x86/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b32/x86/mod.rs @@ -322,7 +322,7 @@ 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 MAP_SYNC: ::c_int = 0x080000; pub const SOCK_STREAM: ::c_int = 1; pub const SOCK_DGRAM: ::c_int = 2; @@ -437,10 +437,13 @@ 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_PASSSEC: ::c_int = 34; pub const SO_PROTOCOL: ::c_int = 38; pub const SO_DOMAIN: ::c_int = 39; +pub const SO_INCOMING_CPU: ::c_int = 49; pub const SA_ONSTACK: ::c_int = 0x08000000; pub const SA_SIGINFO: ::c_int = 0x00000004; @@ -922,6 +925,25 @@ 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; // offsets in user_regs_structs, from sys/reg.h pub const EBX: ::c_int = 0; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/aarch64/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/aarch64/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/aarch64/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/aarch64/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs similarity index 96% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs index 88c252e..aa5ed67 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs @@ -194,6 +194,7 @@ 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 SO_INCOMING_CPU: ::c_int = 49; pub const SA_ONSTACK: ::c_int = 0x08000000; pub const SA_SIGINFO: ::c_int = 0x00000004; @@ -515,6 +516,25 @@ 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 RLIMIT_NLIMITS: ::c_int = 15; pub const TIOCINQ: ::c_int = ::FIONREAD; @@ -598,6 +618,8 @@ 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_PEERSEC: ::c_int = 31; +pub const SO_PASSSEC: ::c_int = 34; pub const EXTPROC: ::tcflag_t = 0x00010000; pub const VEOL: usize = 11; pub const VEOL2: usize = 16; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/mips64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/mips64.rs similarity index 92% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/mips64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/mips64.rs index 06d09ea..2b63da4 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/mips64.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/mips64.rs @@ -425,6 +425,25 @@ 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 O_DIRECT: ::c_int = 0x8000; pub const O_DIRECTORY: ::c_int = 0x10000; @@ -639,37 +658,37 @@ 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 TCGETS: ::c_ulong = 0x540d; -pub const TCSETS: ::c_ulong = 0x540e; -pub const TCSETSW: ::c_ulong = 0x540f; -pub const TCSETSF: ::c_ulong = 0x5410; -pub const TCGETA: ::c_ulong = 0x5401; -pub const TCSETA: ::c_ulong = 0x5402; -pub const TCSETAW: ::c_ulong = 0x5403; -pub const TCSETAF: ::c_ulong = 0x5404; -pub const TCSBRK: ::c_ulong = 0x5405; -pub const TCXONC: ::c_ulong = 0x5406; -pub const TCFLSH: ::c_ulong = 0x5407; -pub const TIOCGSOFTCAR: ::c_ulong = 0x5481; -pub const TIOCSSOFTCAR: ::c_ulong = 0x5482; -pub const TIOCINQ: ::c_ulong = 0x467f; -pub const TIOCLINUX: ::c_ulong = 0x5483; -pub const TIOCGSERIAL: ::c_ulong = 0x5484; -pub const TIOCEXCL: ::c_ulong = 0x740d; -pub const TIOCNXCL: ::c_ulong = 0x740e; -pub const TIOCSCTTY: ::c_ulong = 0x5480; -pub const TIOCGPGRP: ::c_ulong = 0x40047477; -pub const TIOCSPGRP: ::c_ulong = 0x80047476; -pub const TIOCOUTQ: ::c_ulong = 0x7472; -pub const TIOCSTI: ::c_ulong = 0x5472; -pub const TIOCGWINSZ: ::c_ulong = 0x40087468; -pub const TIOCSWINSZ: ::c_ulong = 0x80087467; -pub const TIOCMGET: ::c_ulong = 0x741d; -pub const TIOCMBIS: ::c_ulong = 0x741b; -pub const TIOCMBIC: ::c_ulong = 0x741c; -pub const TIOCMSET: ::c_ulong = 0x741a; -pub const FIONREAD: ::c_ulong = 0x467f; -pub const TIOCCONS: ::c_ulong = 0x80047478; +pub const TCGETS: ::c_int = 0x540d; +pub const TCSETS: ::c_int = 0x540e; +pub const TCSETSW: ::c_int = 0x540f; +pub const TCSETSF: ::c_int = 0x5410; +pub const TCGETA: ::c_int = 0x5401; +pub const TCSETA: ::c_int = 0x5402; +pub const TCSETAW: ::c_int = 0x5403; +pub const TCSETAF: ::c_int = 0x5404; +pub const TCSBRK: ::c_int = 0x5405; +pub const TCXONC: ::c_int = 0x5406; +pub const TCFLSH: ::c_int = 0x5407; +pub const TIOCGSOFTCAR: ::c_int = 0x5481; +pub const TIOCSSOFTCAR: ::c_int = 0x5482; +pub const TIOCINQ: ::c_int = 0x467f; +pub const TIOCLINUX: ::c_int = 0x5483; +pub const TIOCGSERIAL: ::c_int = 0x5484; +pub const TIOCEXCL: ::c_int = 0x740d; +pub const TIOCNXCL: ::c_int = 0x740e; +pub const TIOCSCTTY: ::c_int = 0x5480; +pub const TIOCGPGRP: ::c_int = 0x40047477; +pub const TIOCSPGRP: ::c_int = 0x80047476_u32 as i32; +pub const TIOCOUTQ: ::c_int = 0x7472; +pub const TIOCSTI: ::c_int = 0x5472; +pub const TIOCGWINSZ: ::c_int = 0x40087468; +pub const TIOCSWINSZ: ::c_int = 0x80087467_u32 as i32; +pub const TIOCMGET: ::c_int = 0x741d; +pub const TIOCMBIS: ::c_int = 0x741b; +pub const TIOCMBIC: ::c_int = 0x741c; +pub const TIOCMSET: ::c_int = 0x741a; +pub const FIONREAD: ::c_int = 0x467f; +pub const TIOCCONS: ::c_int = 0x80047478_u32 as i32; pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/mod.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/mod.rs index 62abee0..b3c79b0 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/mod.rs @@ -161,6 +161,9 @@ cfg_if! { } 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::*; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/powerpc64.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/powerpc64.rs similarity index 96% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/powerpc64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/powerpc64.rs index 18fcd5c..f568850 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/powerpc64.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/powerpc64.rs @@ -170,7 +170,7 @@ 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 MAP_SYNC: ::c_int = 0x080000; pub const SOCK_STREAM: ::c_int = 1; pub const SOCK_DGRAM: ::c_int = 2; @@ -601,6 +601,25 @@ 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 FIOCLEX: ::c_int = 0x20006601; pub const FIONCLEX: ::c_int = 0x20006602; @@ -613,6 +632,8 @@ 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_PEERSEC: ::c_int = 31; +pub const SO_PASSSEC: ::c_int = 34; pub const EXTPROC: ::tcflag_t = 0x10000000; pub const VEOL: usize = 6; pub const VEOL2: usize = 8; diff --git a/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/s390x.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/s390x.rs new file mode 100644 index 0000000..4536bd2 --- /dev/null +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/s390x.rs @@ -0,0 +1,780 @@ +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; + +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_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 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], + } +} + +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(&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 FIOCLEX: ::c_ulong = 0x5451; +pub const FIONCLEX: ::c_ulong = 0x5450; +pub const FIONBIO: ::c_ulong = 0x5421; +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 SOL_SOCKET: ::c_int = 1; +pub const SO_BROADCAST: ::c_int = 6; +pub const SO_ERROR: ::c_int = 4; +pub const SO_RCVTIMEO: ::c_int = 20; +pub const SO_REUSEADDR: ::c_int = 2; +pub const SO_SNDTIMEO: ::c_int = 21; +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 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 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 SO_TYPE: ::c_int = 3; +pub const SO_DONTROUTE: ::c_int = 5; +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_ACCEPTCONN: ::c_int = 30; +pub const SO_SNDBUFFORCE: ::c_int = 32; +pub const SO_RCVBUFFORCE: ::c_int = 33; + +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 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 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 TIOCINQ: ::c_int = 0x541B; +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 TIOCLINUX: ::c_int = 0x541C; +pub const TIOCGSERIAL: ::c_int = 0x541E; +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 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 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 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; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/x86_64/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/x86_64/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/x86_64/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/x86_64/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs similarity index 97% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs index e94553a..b96954a 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs @@ -580,6 +580,25 @@ 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; // offsets in user_regs_structs, from sys/reg.h pub const R15: ::c_int = 0; @@ -808,6 +827,7 @@ 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 SO_INCOMING_CPU: ::c_int = 49; pub const MAP_ANON: ::c_int = 0x0020; pub const MAP_GROWSDOWN: ::c_int = 0x0100; @@ -819,7 +839,7 @@ 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 MAP_SYNC: ::c_int = 0x080000; pub const RLIMIT_NLIMITS: ::c_int = 15; pub const TIOCINQ: ::c_int = ::FIONREAD; @@ -903,6 +923,8 @@ 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_PEERSEC: ::c_int = 31; +pub const SO_PASSSEC: ::c_int = 34; pub const EXTPROC: ::tcflag_t = 0x00010000; pub const VEOL: usize = 11; pub const VEOL2: usize = 16; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/mod.rs similarity index 90% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/mod.rs index 8aaa41b..c722b67 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/musl/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/musl/mod.rs @@ -1,10 +1,13 @@ pub type pthread_t = *mut ::c_void; pub type clock_t = c_long; -#[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." +#[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; @@ -233,6 +236,19 @@ s! { 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, + } } s_no_extra_traits! { @@ -424,20 +440,20 @@ cfg_if! { * 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_MASK: ::c_int = 0x3f; -pub const MAP_HUGE_64KB: ::c_int = 16 << MAP_HUGE_SHIFT; +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_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 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; @@ -481,6 +497,7 @@ 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; @@ -488,8 +505,6 @@ 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 = 4; @@ -552,10 +567,21 @@ 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 FAN_MARK_INODE: ::c_uint = 0x0000_0000; +pub const FAN_MARK_MOUNT: ::c_uint = 0x0000_0010; +// NOTE: FAN_MARK_FILESYSTEM requires Linux Kernel >= 4.20.0 +pub const FAN_MARK_FILESYSTEM: ::c_uint = 0x0000_0100; -pub const SEEK_DATA: ::c_int = 3; -pub const SEEK_HOLE: ::c_int = 4; +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; @@ -616,6 +642,16 @@ pub const PRIO_PROCESS: ::c_int = 0; pub const PRIO_PGRP: ::c_int = 1; pub const PRIO_USER: ::c_int = 2; +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, @@ -679,13 +715,15 @@ extern "C" { dirfd: ::c_int, path: *const ::c_char, ) -> ::c_int; + pub fn getauxval(type_: ::c_ulong) -> ::c_ulong; } cfg_if! { if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "mips64", - target_arch = "powerpc64"))] { + target_arch = "powerpc64", + target_arch = "s390x"))] { mod b64; pub use self::b64::*; } else if #[cfg(any(target_arch = "x86", diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/no_align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/no_align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/linux/no_align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/no_align.rs diff --git a/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/align.rs new file mode 100644 index 0000000..e6610bb --- /dev/null +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/align.rs @@ -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 --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/arm/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/arm/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/arm/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/arm/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/arm/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/arm/mod.rs similarity index 78% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/arm/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/arm/mod.rs index 613a11f..60e526b 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/arm/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/arm/mod.rs @@ -17,6 +17,10 @@ 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; + s! { pub struct cmsghdr { pub cmsg_len: ::size_t, @@ -52,13 +56,13 @@ s! { pub st_blksize: ::blksize_t, pub st_blocks: ::blkcnt_t, pub st_atime: ::time_t, - pub st_atime_nsec: ::c_ulong, + pub st_atime_nsec: ::c_long, pub st_mtime: ::time_t, - pub st_mtime_nsec: ::c_ulong, + pub st_mtime_nsec: ::c_long, pub st_ctime: ::time_t, - pub st_ctime_nsec: ::c_ulong, - pub __unused4: ::c_ulong, - pub __unused5: ::c_ulong, + pub st_ctime_nsec: ::c_long, + pub __uclibc_unused4: ::c_ulong, + pub __uclibc_unused5: ::c_ulong, } pub struct stat64 @@ -76,11 +80,11 @@ s! { pub st_blksize: ::blksize_t, pub st_blocks: ::blkcnt64_t, pub st_atime: ::time_t, - pub st_atime_nsec: ::c_ulong, + pub st_atime_nsec: ::c_long, pub st_mtime: ::time_t, - pub st_mtime_nsec: ::c_ulong, + pub st_mtime_nsec: ::c_long, pub st_ctime: ::time_t, - pub st_ctime_nsec: ::c_ulong, + pub st_ctime_nsec: ::c_long, pub st_ino: ::ino64_t, } @@ -92,6 +96,23 @@ s! { 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, @@ -104,7 +125,39 @@ s! { pub f_fsid: ::fsid_t, pub f_namelen: ::c_int, pub f_frsize: ::c_int, - pub f_spare: [::c_int; 5], + 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 { @@ -113,10 +166,8 @@ s! { pub struct sigaction { pub sa_sigaction: ::sighandler_t, - // uClibc defines sa_flags as `unsigned long int`, - // but nix crate expects `int` - pub sa_flags: ::c_int, - pub sa_restorer: *mut ::c_void, + pub sa_flags: ::c_ulong, + pub sa_restorer: ::Option, pub sa_mask: sigset_t, } @@ -154,49 +205,42 @@ s! { pub __pad1: ::c_ushort, pub __seq: ::c_ushort, pub __pad2: ::c_ushort, - pub __unused1: ::c_ulong, - pub __unused2: ::c_ulong, + pub __uclibc_unused1: ::c_ulong, + pub __uclibc_unused2: ::c_ulong, } pub struct msqid_ds { pub msg_perm: ::ipc_perm, pub msg_stime: ::time_t, - pub __unused1: ::c_ulong, + pub __uclibc_unused1: ::c_ulong, pub msg_rtime: ::time_t, - pub __unused2: ::c_ulong, + pub __uclibc_unused2: ::c_ulong, pub msg_ctime: ::time_t, - pub __unused3: ::c_ulong, + pub __uclibc_unused3: ::c_ulong, pub __msg_cbytes: ::c_ulong, pub msg_qnum: ::msgqnum_t, pub msg_qbytes: ::msglen_t, pub msg_lspid: ::pid_t, pub msg_lrpid: ::pid_t, - pub __unused4: ::c_ulong, - pub __unused5: ::c_ulong, + pub __uclibc_unused4: ::c_ulong, + pub __uclibc_unused5: ::c_ulong, } pub struct shmid_ds { pub shm_perm: ::ipc_perm, pub shm_segsz: ::size_t, pub shm_atime: ::time_t, - pub __unused1: ::c_ulong, + pub __uclibc_unused1: ::c_ulong, pub shm_dtime: ::time_t, - pub __unused2: ::c_ulong, + pub __uclibc_unused2: ::c_ulong, pub shm_ctime: ::time_t, - pub __unused3: ::c_ulong, + pub __uclibc_unused3: ::c_ulong, pub shm_cpid: ::pid_t, pub shm_lpid: ::pid_t, pub shm_nattch: ::shmatt_t, - pub __unused4: ::c_ulong, - pub __unused5: ::c_ulong, + pub __uclibc_unused4: ::c_ulong, + pub __uclibc_unused5: ::c_ulong, } - - pub struct ucred { - pub pid: ::pid_t, - pub uid: ::uid_t, - pub gid: ::gid_t, - } - } pub const O_CLOEXEC: ::c_int = 0o2000000; @@ -214,33 +258,14 @@ pub const NCCS: usize = 32; // I wasn't able to find those constants // in uclibc build environment for armv7 -pub const AIO_ALLDONE: ::c_int = 2; // from linux/mod.rs -pub const AIO_CANCELED: ::c_int = 0; // from linux/mod.rs -pub const AIO_NOTCANCELED: ::c_int = 1; // from linux/mod.rs -pub const CLONE_NEWCGROUP: ::c_int = 0x02000000; // from linux/mod.rs -pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000; // from linux/mod.rs -pub const EPOLLWAKEUP: ::c_int = 0x20000000; // from linux/other/mod.rs -pub const EXTPROC: ::tcflag_t = 0o200000; // from asm-generic/termbits.h -pub const F_GETPIPE_SZ: ::c_int = 1032; // from linux_like/mod.rs -pub const F_SETPIPE_SZ: ::c_int = 1031; // from linux_like/mod.rs -pub const LIO_NOP: ::c_int = 2; // from linux/mod.rs -pub const LIO_NOWAIT: ::c_int = 1; // from linux/mod.rs -pub const LIO_READ: ::c_int = 0; // from linux/mod.rs -pub const LIO_WAIT: ::c_int = 0; // from linux/mod.rs -pub const LIO_WRITE: ::c_int = 1; // from linux/mod.rs pub const MAP_HUGETLB: ::c_int = 0x040000; // from linux/other/mod.rs -pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY; -pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32; // from linux/mod.rs -pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32; // from linux/mod.rs pub const SO_BUSY_POLL: ::c_int = 46; // from src/unix/linux_like/mod.rs pub const SO_PEEK_OFF: ::c_int = 42; // from src/unix/linux_like/mod.rs pub const SO_REUSEPORT: ::c_int = 15; // from src/unix/linux_like/mod.rs -pub const SOL_NETLINK: ::c_int = 270; // from src/unix/linux_like/mod.rs -pub const _POSIX_VDISABLE: ::cc_t = 0; // from linux/mod.rs -pub const AT_EMPTY_PATH: ::c_int = 0x1000; // from linux_like/mod.rs +pub const SO_PEERSEC: ::c_int = 31; +pub const SO_PASSSEC: ::c_int = 34; // autogenerated constants with hand tuned types -pub const AT_NO_AUTOMOUNT: ::c_int = 0x800; pub const B0: ::speed_t = 0; pub const B1000000: ::speed_t = 0x1008; pub const B110: ::speed_t = 0x3; @@ -278,7 +303,6 @@ 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 CMSPAR: ::tcflag_t = 0x40000000; pub const CPU_SETSIZE: ::c_int = 0x400; pub const CR1: ::c_int = 0x200; pub const CR2: ::c_int = 0x400; @@ -409,7 +433,6 @@ 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 IUTF8: ::tcflag_t = 0x4000; pub const IXOFF: ::tcflag_t = 0x1000; pub const IXON: ::tcflag_t = 0x400; pub const MAP_ANON: ::c_int = 0x20; @@ -422,67 +445,45 @@ 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 MS_ACTIVE: u32 = 0x40000000; -pub const MS_DIRSYNC: u32 = 0x80; -pub const MS_I_VERSION: u32 = 0x800000; -pub const MS_KERNMOUNT: u32 = 0x400000; -pub const MS_MOVE: u32 = 0x2000; -pub const MS_POSIXACL: u32 = 0x10000; -pub const MS_PRIVATE: u32 = 0x40000; -pub const MS_REC: u32 = 0x4000; -pub const MS_RELATIME: u32 = 0x200000; -pub const MS_SHARED: u32 = 0x100000; -pub const MS_SILENT: u32 = 0x8000; -pub const MS_SLAVE: u32 = 0x80000; -pub const MS_STRICTATIME: u32 = 0x1000000; -pub const MS_UNBINDABLE: u32 = 0x20000; pub const NLDLY: ::tcflag_t = 0x100; pub const NOFLSH: ::tcflag_t = 0x80; -pub const OCRNL: ::c_int = 0x8; -pub const OFDEL: ::c_int = 0x80; -pub const OFILL: ::c_int = 0x40; pub const OLCUC: ::tcflag_t = 0x2; pub const ONLCR: ::tcflag_t = 0x4; -pub const ONLRET: ::tcflag_t = 0x20; -pub const ONOCR: ::tcflag_t = 0x10; 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 = 0x1000; +pub const O_DSYNC: ::c_int = O_SYNC; pub const O_EXCL: ::c_int = 0x80; -pub const O_NDELAY: ::c_int = 0x800; +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 POLLRDBAND: ::c_short = 0x80; -pub const POLLRDNORM: ::c_short = 0x40; pub const POLLWRBAND: ::c_short = 0x200; pub const POLLWRNORM: ::c_short = 0x100; pub const PTHREAD_STACK_MIN: ::size_t = 16384; -pub const QIF_ALL: u32 = 0x3f; -pub const QIF_BLIMITS: u32 = 0x1; -pub const QIF_BTIME: u32 = 0x10; -pub const QIF_ILIMITS: u32 = 0x4; -pub const QIF_INODES: u32 = 0x8; -pub const QIF_ITIME: u32 = 0x20; -pub const QIF_LIMITS: u32 = 0x5; -pub const QIF_SPACE: u32 = 0x2; -pub const QIF_TIMES: u32 = 0x30; -pub const QIF_USAGE: u32 = 0xa; -pub const SA_NOCLDSTOP: ::c_int = 0x1; -pub const SA_NOCLDWAIT: ::c_int = 0x2; -pub const SA_NODEFER: ::c_int = 0x40000000; -pub const SA_ONSTACK: ::c_int = 0x8000000; -pub const SA_RESETHAND: ::c_int = 0x80000000; -pub const SA_RESTART: ::c_int = 0x10000000; -pub const SA_SIGINFO: ::c_int = 0x4; + +// 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; @@ -529,6 +530,7 @@ pub const SO_PEERCRED: ::c_int = 0x11; pub const SO_PRIORITY: ::c_int = 0xc; pub const SO_PROTOCOL: ::c_int = 0x26; pub const SO_RCVBUF: ::c_int = 0x8; +pub const SO_RCVBUFFORCE: ::c_int = 33; pub const SO_RCVLOWAT: ::c_int = 0x12; pub const SO_RCVTIMEO: ::c_int = 0x14; pub const SO_REUSEADDR: ::c_int = 0x2; @@ -562,58 +564,8 @@ pub const VTDLY: ::c_int = 0x4000; pub const VTIME: usize = 0x5; pub const VWERASE: usize = 0xe; pub const XTABS: ::tcflag_t = 0x1800; -pub const _PC_2_SYMLINKS: ::c_int = 0x14; -pub const _PC_ALLOC_SIZE_MIN: ::c_int = 0x12; -pub const _PC_ASYNC_IO: ::c_int = 0xa; -pub const _PC_FILESIZEBITS: ::c_int = 0xd; -pub const _PC_PRIO_IO: ::c_int = 0xb; -pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 0xe; -pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 0xf; -pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 0x10; -pub const _PC_REC_XFER_ALIGN: ::c_int = 0x11; -pub const _PC_SYMLINK_MAX: ::c_int = 0x13; -pub const _PC_SYNC_IO: ::c_int = 0x9; -pub const _SC_2_PBS: ::c_int = 0xa8; -pub const _SC_2_PBS_ACCOUNTING: ::c_int = 0xa9; -pub const _SC_2_PBS_CHECKPOINT: ::c_int = 0xaf; -pub const _SC_2_PBS_LOCATE: ::c_int = 0xaa; -pub const _SC_2_PBS_MESSAGE: ::c_int = 0xab; -pub const _SC_2_PBS_TRACK: ::c_int = 0xac; -pub const _SC_ADVISORY_INFO: ::c_int = 0x84; -pub const _SC_BARRIERS: ::c_int = 0x85; -pub const _SC_CLOCK_SELECTION: ::c_int = 0x89; -pub const _SC_CPUTIME: ::c_int = 0x8a; -pub const _SC_IPV6: ::c_int = 0xeb; -pub const _SC_MONOTONIC_CLOCK: ::c_int = 0x95; -pub const _SC_RAW_SOCKETS: ::c_int = 0xec; -pub const _SC_READER_WRITER_LOCKS: ::c_int = 0x99; -pub const _SC_REGEXP: ::c_int = 0x9b; -pub const _SC_SHELL: ::c_int = 0x9d; -pub const _SC_SPAWN: ::c_int = 0x9f; -pub const _SC_SPIN_LOCKS: ::c_int = 0x9a; -pub const _SC_SPORADIC_SERVER: ::c_int = 0xa0; -pub const _SC_SS_REPL_MAX: ::c_int = 0xf1; -pub const _SC_SYMLOOP_MAX: ::c_int = 0xad; -pub const _SC_THREAD_CPUTIME: ::c_int = 0x8b; -pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 0x52; -pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 0xf7; -pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 0xf8; -pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 0xa1; -pub const _SC_TIMEOUTS: ::c_int = 0xa4; -pub const _SC_TRACE: ::c_int = 0xb5; -pub const _SC_TRACE_EVENT_FILTER: ::c_int = 0xb6; -pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 0xf2; -pub const _SC_TRACE_INHERIT: ::c_int = 0xb7; -pub const _SC_TRACE_LOG: ::c_int = 0xb8; -pub const _SC_TRACE_NAME_MAX: ::c_int = 0xf3; -pub const _SC_TRACE_SYS_MAX: ::c_int = 0xf4; -pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 0xf5; -pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 0xa5; -pub const _SC_V6_ILP32_OFF32: ::c_int = 0xb0; -pub const _SC_V6_ILP32_OFFBIG: ::c_int = 0xb1; -pub const _SC_V6_LP64_OFF64: ::c_int = 0xb2; -pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 0xb3; -pub const _SC_XOPEN_STREAMS: ::c_int = 0xf6; + +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; @@ -967,75 +919,8 @@ pub const SYS_pkey_mprotect: ::c_long = 394; pub const SYS_pkey_alloc: ::c_long = 395; pub const SYS_pkey_free: ::c_long = 396; -fn CMSG_ALIGN(len: usize) -> usize { - len + ::mem::size_of::() - 1 & !(::mem::size_of::() - 1) -} - -f! { - pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { - if (*mhdr).msg_controllen as usize >= ::mem::size_of::() { - (*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 fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { - (CMSG_ALIGN(length as usize) + CMSG_ALIGN(::mem::size_of::())) - as ::c_uint - } - - pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { - CMSG_ALIGN(::mem::size_of::()) 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::() { - 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 - } - } - -} - extern "C" { pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::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 setns(fd: ::c_int, nstype: ::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; } cfg_if! { diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/arm/no_align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/arm/no_align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/arm/no_align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/arm/no_align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mips/mips32/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mips/mips32/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mips/mips32/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mips/mips32/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mips/mips32/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs similarity index 95% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mips/mips32/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs index 31bca58..6b34fae 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mips/mips32/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs @@ -12,7 +12,10 @@ pub type blksize_t = i32; pub type nlink_t = u32; pub type fsblkcnt_t = ::c_ulong; pub type fsfilcnt_t = ::c_ulong; -pub type rlim_t = c_ulong; +pub type rlim_t = ::c_ulong; +pub type __u64 = ::c_ulonglong; +pub type fsblkcnt64_t = u64; +pub type fsfilcnt64_t = u64; s! { pub struct stat { @@ -61,6 +64,22 @@ s! { 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] } @@ -169,6 +188,21 @@ s! { 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, @@ -222,10 +256,14 @@ s! { } } -pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_ATTR_T: usize = 36; pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; -pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; 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 RLIM_INFINITY: ::rlim_t = 0x7fffffff; @@ -599,7 +637,6 @@ extern "C" { newlen: ::size_t, ) -> ::c_int; 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, @@ -609,7 +646,6 @@ extern "C" { 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, diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mips/mips32/no_align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mips/mips32/no_align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mips/mips64/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mips/mips64/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mips/mips64/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mips/mips64/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mips/mips64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mips/mips64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mips/mips64/no_align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mips/mips64/no_align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mips/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mips/mod.rs similarity index 78% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mips/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mips/mod.rs index de76971..26408ff 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/mips/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mips/mod.rs @@ -28,8 +28,6 @@ pub const SA_RESETHAND: ::c_int = 0x80000000; pub const SA_RESTART: ::c_int = 0x10000000; pub const SA_NOCLDSTOP: ::c_int = 0x00000001; -pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000; // from linux/mod.rs -pub const EPOLLWAKEUP: ::c_int = 0x20000000; // from linux/other/mod.rs pub const EPOLL_CLOEXEC: ::c_int = 0x80000; pub const EFD_CLOEXEC: ::c_int = 0x80000; @@ -37,15 +35,12 @@ pub const EFD_CLOEXEC: ::c_int = 0x80000; pub const BUFSIZ: ::c_uint = 4096; pub const TMP_MAX: ::c_uint = 238328; pub const FOPEN_MAX: ::c_uint = 16; -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 _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 ST_RELATIME: ::c_ulong = 4096; pub const NI_MAXHOST: ::socklen_t = 1025; pub const RLIMIT_NOFILE: ::c_int = 5; @@ -115,7 +110,6 @@ 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; @@ -204,7 +198,6 @@ 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 SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP; pub const SO_PEERSEC: ::c_int = 30; pub const SO_SNDBUFFORCE: ::c_int = 31; pub const SO_RCVBUFFORCE: ::c_int = 33; @@ -212,8 +205,6 @@ pub const SO_PASSSEC: ::c_int = 34; pub const SO_TIMESTAMPNS: ::c_int = 35; pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS; pub const SO_MARK: ::c_int = 36; -pub const SO_TIMESTAMPING: ::c_int = 37; -pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING; 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; @@ -256,40 +247,11 @@ pub const SIG_SETMASK: ::c_int = 3; pub const SIG_BLOCK: ::c_int = 0x1; pub const SIG_UNBLOCK: ::c_int = 0x2; -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 PTHREAD_STACK_MIN: ::size_t = 16384; -pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5; -pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff; -pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245; -pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45; -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 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 MINIX_SUPER_MAGIC: ::c_long = 0x0000137f; -pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f; -pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468; -pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478; -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 OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1; -pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0; -pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f; -pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973; -pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b; -pub const TMPFS_MAGIC: ::c_long = 0x01021994; -pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2; - pub const VEOF: usize = 16; pub const VEOL: usize = 17; pub const VEOL2: usize = 6; @@ -297,37 +259,12 @@ 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 IUTF8: ::tcflag_t = 0x00004000; 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 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_DETACH: ::c_uint = 17; -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_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 = 0x80; pub const F_GETLK: ::c_int = 14; @@ -370,28 +307,9 @@ pub const TIOCMSET: ::c_ulong = 0x741a; pub const FIONREAD: ::c_ulong = 0x467f; pub const TIOCCONS: ::c_ulong = 0x80047478; -pub const RTLD_DEEPBIND: ::c_int = 0x10; pub const RTLD_GLOBAL: ::c_int = 0x4; pub const RTLD_NOLOAD: ::c_int = 0x8; -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 MCL_CURRENT: ::c_int = 0x0001; -pub const MCL_FUTURE: ::c_int = 0x0002; - pub const SIGSTKSZ: ::size_t = 8192; pub const CBAUD: ::tcflag_t = 0o0010017; pub const TAB1: ::tcflag_t = 0x00000800; diff --git a/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mod.rs new file mode 100644 index 0000000..cc5d5cd --- /dev/null +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/mod.rs @@ -0,0 +1,304 @@ +pub type shmatt_t = ::c_ulong; +pub type msgqnum_t = ::c_ulong; +pub type msglen_t = ::c_ulong; +pub type regoff_t = ::c_int; + +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 const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const SIGEV_THREAD_ID: ::c_int = 4; + +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 BINDERFS_SUPER_MAGIC: ::c_long = 0x6c6f6f70; +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 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 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 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 PTRACE_O_MASK: ::c_int = 0x000000ff; + +pub const POSIX_FADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NOREUSE: ::c_int = 5; + +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; + +// 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 ST_RELATIME: ::c_ulong = 4096; + +extern "C" { + 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, + sevlen: ::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; +} + +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 --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/no_align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/no_align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/no_align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/no_align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/x86_64/l4re.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/x86_64/l4re.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/x86_64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/x86_64/mod.rs similarity index 84% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/x86_64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/x86_64/mod.rs index 26eca9e..af42d0f 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/x86_64/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/x86_64/mod.rs @@ -12,13 +12,16 @@ pub type ino_t = ::c_ulong; pub type nlink_t = ::c_uint; pub type off_t = ::c_long; pub type rlim_t = c_ulong; -pub type rlim64_t = u64; // [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; + s! { pub struct ipc_perm { pub __key: ::key_t, @@ -143,7 +146,7 @@ s! { pub struct sigaction { pub sa_handler: ::sighandler_t, pub sa_flags: ::c_ulong, - pub sa_restorer: *mut ::c_void, + pub sa_restorer: ::Option, pub sa_mask: ::sigset_t, } @@ -167,6 +170,37 @@ s! { 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, @@ -219,11 +253,6 @@ s! { __unused5: *mut ::c_void, } - pub struct rlimit64 { // FIXME - pub rlim_cur: rlim64_t, - pub rlim_max: rlim64_t, - } - pub struct cpu_set_t { // FIXME #[cfg(target_pointer_width = "32")] bits: [u32; 32], @@ -234,6 +263,21 @@ s! { 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! { @@ -245,14 +289,6 @@ s_no_extra_traits! { pub d_type: u8, pub d_name: [::c_char; 256], } - #[allow(missing_debug_implementations)] - pub struct dirent64 { - 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 @@ -265,6 +301,8 @@ 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 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; @@ -285,10 +323,14 @@ pub const SOL_SOCKET: ::c_int = 1; pub const SO_RCVTIMEO: ::c_int = 20; pub const SO_REUSEADDR: ::c_int = 2; pub const SO_SNDTIMEO: ::c_int = 21; +pub const SO_TIMESTAMP: ::c_int = 0x1d; +pub const SO_PEERSEC: ::c_int = 31; +pub const SO_PASSSEC: ::c_int = 34; pub const RLIM_INFINITY: u64 = 0xffffffffffffffff; 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; cfg_if! { if #[cfg(target_os = "l4re")] { @@ -299,14 +341,3 @@ cfg_if! { pub use other::*; } } - -cfg_if! { - if #[cfg(libc_align)] { - #[macro_use] - mod align; - } else { - #[macro_use] - mod no_align; - } -} -expand_align!(); diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/x86_64/other.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/x86_64/other.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/uclibc/x86_64/other.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/linux/uclibc/x86_64/other.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/mod.rs similarity index 95% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/mod.rs index d5299b2..cd4247d 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/linux_like/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/linux_like/mod.rs @@ -546,13 +546,18 @@ 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; +cfg_if! { + 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; @@ -855,7 +860,6 @@ 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 @@ -866,7 +870,6 @@ pub const IPPROTO_COMP: ::c_int = 108; 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; @@ -905,7 +908,6 @@ 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; @@ -941,8 +943,6 @@ 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; @@ -1081,7 +1081,6 @@ 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; @@ -1091,15 +1090,11 @@ 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; @@ -1110,9 +1105,6 @@ 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; @@ -1309,6 +1301,24 @@ pub const ARPHRD_IEEE802154: u16 = 804; pub const ARPHRD_VOID: u16 = 0xFFFF; pub const ARPHRD_NONE: u16 = 0xFFFE; +cfg_if! { + if #[cfg(not(target_env = "uclibc"))] { + pub const IPPROTO_BEETPH: ::c_int = 94; + pub const IPPROTO_MPLS: ::c_int = 137; + pub const IPV6_HDRINCL: ::c_int = 36; + pub const IPV6_PMTUDISC_INTERFACE: ::c_int = 4; + pub const IPV6_PMTUDISC_OMIT: ::c_int = 5; + pub const CLONE_NEWCGROUP: ::c_int = 0x02000000; + pub const ADDR_NO_RANDOMIZE: ::c_int = 0x0040000; + pub const ADDR_COMPAT_LAYOUT: ::c_int = 0x0200000; + pub const READ_IMPLIES_EXEC: ::c_int = 0x0400000; + pub const ADDR_LIMIT_3GB: ::c_int = 0x8000000; + 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; + } +} + const_fn! { {const} fn CMSG_ALIGN(len: usize) -> usize { len + ::mem::size_of::() - 1 & !(::mem::size_of::() - 1) @@ -1536,24 +1546,12 @@ extern "C" { count: ::size_t, offset: off64_t, ) -> ::ssize_t; - pub fn preadv64( - fd: ::c_int, - iov: *const ::iovec, - iovcnt: ::c_int, - 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 pwritev64( - fd: ::c_int, - iov: *const ::iovec, - iovcnt: ::c_int, - offset: ::off64_t, - ) -> ::ssize_t; pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64; pub fn readdir64_r( dirp: *mut ::DIR, @@ -1633,19 +1631,6 @@ extern "C" { options: ::c_int, rusage: *mut ::rusage, ) -> ::pid_t; - 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 login_tty(fd: ::c_int) -> ::c_int; pub fn execvpe( file: *const ::c_char, @@ -1689,6 +1674,40 @@ extern "C" { pub fn uname(buf: *mut ::utsname) -> ::c_int; } +cfg_if! { + if #[cfg(not(target_env = "uclibc"))] { + 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; + // 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; @@ -1696,6 +1715,9 @@ cfg_if! { } 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::*; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/mod.rs similarity index 94% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/mod.rs index 9db5a74..b3c0b47 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/mod.rs @@ -227,7 +227,8 @@ pub const S_ISGID: ::mode_t = 0x400; pub const S_ISVTX: ::mode_t = 0x200; cfg_if! { - if #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] { + 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; } @@ -260,12 +261,15 @@ 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; - +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; @@ -299,7 +303,7 @@ cfg_if! { // cargo build, don't pull in anything extra as the libstd dep // already pulls in all libs. } else if #[cfg(all(target_os = "linux", - target_env = "gnu", + any(target_env = "gnu", target_env = "uclibc"), feature = "rustc-dep-of-std"))] { #[link(name = "util", kind = "static-nobundle", cfg(target_feature = "crt-static"))] @@ -454,10 +458,7 @@ extern "C" { ptr: *mut *mut c_char, sizeloc: *mut size_t, ) -> *mut FILE; - pub fn open_wmemstream( - ptr: *mut *mut wchar_t, - sizeloc: *mut size_t, - ) -> *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; @@ -622,27 +623,42 @@ extern "C" { ... ) -> ::c_int; pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int; - #[cfg_attr(target_os = "linux", link_name = "__isoc99_fscanf")] + #[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(target_os = "linux", link_name = "__isoc99_scanf")] + #[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(target_os = "linux", link_name = "__isoc99_sscanf")] + #[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(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")] 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(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" @@ -658,8 +674,11 @@ extern "C" { link_name = "listen$UNIX2003" )] 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(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" @@ -669,8 +688,11 @@ extern "C" { address: *mut sockaddr, address_len: *mut socklen_t, ) -> ::c_int; - #[cfg(not(all(libc_cfg_target_vendor, target_arch = "powerpc", - target_vendor = "nintendo")))] + #[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" @@ -680,8 +702,11 @@ extern "C" { address: *mut sockaddr, address_len: *mut socklen_t, ) -> ::c_int; - #[cfg(not(all(libc_cfg_target_vendor, target_arch = "powerpc", - target_vendor = "nintendo")))] + #[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" @@ -709,8 +734,11 @@ extern "C" { protocol: ::c_int, socket_vector: *mut ::c_int, ) -> ::c_int; - #[cfg(not(all(libc_cfg_target_vendor, target_arch = "powerpc", - target_vendor = "nintendo")))] + #[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" @@ -1286,8 +1314,11 @@ extern "C" { pub fn dlclose(handle: *mut ::c_void) -> ::c_int; pub fn dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int; - #[cfg(not(all(libc_cfg_target_vendor, target_arch = "powerpc", - target_vendor = "nintendo")))] + #[cfg(not(all( + libc_cfg_target_vendor, + target_arch = "powerpc", + target_vendor = "nintendo" + )))] #[cfg_attr(target_os = "illumos", link_name = "__xnet_getaddrinfo")] pub fn getaddrinfo( node: *const c_char, @@ -1295,8 +1326,11 @@ extern "C" { hints: *const addrinfo, res: *mut *mut addrinfo, ) -> ::c_int; - #[cfg(not(all(libc_cfg_target_vendor, target_arch = "powerpc", - target_vendor = "nintendo")))] + #[cfg(not(all( + libc_cfg_target_vendor, + target_arch = "powerpc", + target_vendor = "nintendo" + )))] pub fn freeaddrinfo(res: *mut addrinfo); pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char; #[cfg_attr( @@ -1315,32 +1349,40 @@ extern "C" { pub fn res_init() -> ::c_int; #[cfg_attr(target_os = "netbsd", link_name = "__gmtime_r50")] - #[cfg_attr(target_env = "musl", allow(deprecated))] // FIXME: for `time_t` + #[cfg_attr(target_env = "musl", 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(target_env = "musl", allow(deprecated))] // FIXME: for `time_t` + #[cfg_attr(target_env = "musl", 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(target_env = "musl", allow(deprecated))] // FIXME: for `time_t` + #[cfg_attr(target_env = "musl", allow(deprecated))] + // FIXME: for `time_t` pub fn mktime(tm: *mut tm) -> time_t; #[cfg_attr(target_os = "netbsd", link_name = "__time50")] - #[cfg_attr(target_env = "musl", allow(deprecated))] // FIXME: for `time_t` + #[cfg_attr(target_env = "musl", 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(target_env = "musl", allow(deprecated))] // FIXME: for `time_t` + #[cfg_attr(target_env = "musl", 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(target_env = "musl", allow(deprecated))] // FIXME: for `time_t` + #[cfg_attr(target_env = "musl", 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(target_env = "musl", allow(deprecated))] // FIXME: for `time_t` + #[cfg_attr(target_env = "musl", 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(target_env = "musl", allow(deprecated))] // FIXME: for `time_t` + #[cfg_attr(target_env = "musl", allow(deprecated))] + // FIXME: for `time_t` pub fn timegm(tm: *mut ::tm) -> time_t; #[cfg_attr(target_os = "netbsd", link_name = "__mknod50")] @@ -1537,11 +1579,18 @@ extern "C" { stream: *mut FILE, ) -> ssize_t; - pub fn lockf( - fd: ::c_int, - cmd: ::c_int, - len: ::off_t, - ) -> ::c_int; + pub fn lockf(fd: ::c_int, cmd: ::c_int, len: ::off_t) -> ::c_int; +} + +cfg_if! { + if #[cfg(not(target_env = "uclibc"))] { + extern "C" { + pub fn open_wmemstream( + ptr: *mut *mut wchar_t, + sizeloc: *mut size_t, + ) -> *mut FILE; + } + } } cfg_if! { @@ -1599,13 +1648,11 @@ cfg_if! { } cfg_if! { - if #[cfg(target_env = "uclibc")] { - mod uclibc; - pub use self::uclibc::*; - } else if #[cfg(target_env = "newlib")] { + 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; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/newlib/aarch64/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/newlib/aarch64/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/newlib/aarch64/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/newlib/aarch64/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/newlib/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/newlib/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/newlib/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/newlib/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/newlib/arm/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/newlib/arm/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/newlib/arm/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/newlib/arm/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/newlib/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/newlib/mod.rs similarity index 98% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/newlib/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/newlib/mod.rs index defeda3..270dd7b 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/newlib/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/newlib/mod.rs @@ -602,8 +602,11 @@ extern "C" { 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(not(all( + libc_cfg_target_vendor, + target_arch = "powerpc", + target_vendor = "nintendo" + )))] pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t) -> ::c_int; pub fn clock_settime( @@ -620,8 +623,11 @@ extern "C" { ) -> ::c_int; 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(not(all( + libc_cfg_target_vendor, + target_arch = "powerpc", + target_vendor = "nintendo" + )))] pub fn recvfrom( fd: ::c_int, buf: *mut ::c_void, @@ -630,8 +636,11 @@ extern "C" { addr: *mut sockaddr, addr_len: *mut socklen_t, ) -> isize; - #[cfg(not(all(libc_cfg_target_vendor, target_arch = "powerpc", - target_vendor = "nintendo")))] + #[cfg(not(all( + libc_cfg_target_vendor, + target_arch = "powerpc", + target_vendor = "nintendo" + )))] pub fn getnameinfo( sa: *const sockaddr, salen: socklen_t, diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/newlib/no_align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/newlib/no_align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/newlib/no_align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/newlib/no_align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/newlib/powerpc/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/newlib/powerpc/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/newlib/powerpc/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/newlib/powerpc/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/newlib/xtensa/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/newlib/xtensa/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/newlib/xtensa/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/newlib/xtensa/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/no_align.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/no_align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/no_align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/no_align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/redox/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/redox/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/redox/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/redox/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/solarish/compat.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/solarish/compat.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/solarish/compat.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/solarish/compat.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/solarish/illumos.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/solarish/illumos.rs similarity index 84% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/solarish/illumos.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/solarish/illumos.rs index 49aeb9c..184f73b 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/solarish/illumos.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/solarish/illumos.rs @@ -27,6 +27,12 @@ pub const TCP_KEEPCNT: ::c_int = 35; pub const TCP_KEEPINTVL: ::c_int = 36; pub const TCP_CONGESTION: ::c_int = 37; +pub const F_OFD_GETLK: ::c_int = 50; +pub const F_OFD_SETLKL: ::c_int = 51; +pub const F_OFD_SETLKW: ::c_int = 52; +pub const F_FLOCK: ::c_int = 55; +pub const F_FLOCKW: ::c_int = 56; + extern "C" { pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/solarish/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/solarish/mod.rs similarity index 98% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/solarish/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/solarish/mod.rs index 0f53fe9..994ce7e 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/unix/solarish/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/unix/solarish/mod.rs @@ -20,6 +20,7 @@ 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; @@ -120,6 +121,11 @@ s! { 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, @@ -364,6 +370,11 @@ s! { 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, @@ -935,10 +946,15 @@ pub const SIGEV_NONE: ::c_int = 1; pub const SIGEV_SIGNAL: ::c_int = 2; pub const SIGEV_THREAD: ::c_int = 3; +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! { @@ -983,10 +999,12 @@ 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_DIRECTORY: ::c_int = 0x1000000; 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 S_IFIFO: mode_t = 4096; pub const S_IFCHR: mode_t = 8192; pub const S_IFBLK: mode_t = 24576; @@ -1025,6 +1043,12 @@ pub const F_DUPFD_CLOEXEC: ::c_int = 37; 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 SIGHUP: ::c_int = 1; pub const SIGINT: ::c_int = 2; pub const SIGQUIT: ::c_int = 3; @@ -1253,10 +1277,13 @@ pub const EAI_SYSTEM: ::c_int = 11; pub const EAI_OVERFLOW: ::c_int = 12; pub const F_DUPFD: ::c_int = 0; +pub const F_DUP2FD: ::c_int = 9; +pub const F_DUP2FD_CLOEXEC: ::c_int = 36; 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; @@ -1404,6 +1431,8 @@ 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 SOL_SOCKET: ::c_int = 0xffff; pub const SO_DEBUG: ::c_int = 0x01; pub const SO_ACCEPTCONN: ::c_int = 0x0002; @@ -2074,12 +2103,14 @@ const _CMSG_HDR_ALIGNMENT: usize = 4; const _CMSG_DATA_ALIGNMENT: usize = ::mem::size_of::<::c_int>(); -fn _CMSG_HDR_ALIGN(p: usize) -> usize { - (p + _CMSG_HDR_ALIGNMENT - 1) & !(_CMSG_HDR_ALIGNMENT - 1) -} +const_fn! { + {const} fn _CMSG_HDR_ALIGN(p: usize) -> usize { + (p + _CMSG_HDR_ALIGNMENT - 1) & !(_CMSG_HDR_ALIGNMENT - 1) + } -fn _CMSG_DATA_ALIGN(p: usize) -> usize { - (p + _CMSG_DATA_ALIGNMENT - 1) & !(_CMSG_DATA_ALIGNMENT - 1) + {const} fn _CMSG_DATA_ALIGN(p: usize) -> usize { + (p + _CMSG_DATA_ALIGNMENT - 1) & !(_CMSG_DATA_ALIGNMENT - 1) + } } f! { @@ -2117,7 +2148,7 @@ f! { } } - pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + 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 } @@ -2522,7 +2553,7 @@ extern "C" { // The epoll functions are actually only present on illumos. However, // there are things using epoll on illumos (built using the - // x86_64-sun-solaris target) which would break until the illumos target is + // x86_64-pc-solaris target) which would break until the illumos target is // present in rustc. pub fn epoll_pwait( epfd: ::c_int, @@ -2656,6 +2687,21 @@ extern "C" { 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; diff --git a/third_party/cargo/vendor/libc-0.2.82/src/unix/solarish/solaris.rs b/third_party/cargo/vendor/libc-0.2.92/src/unix/solarish/solaris.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/unix/solarish/solaris.rs rename to third_party/cargo/vendor/libc-0.2.92/src/unix/solarish/solaris.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/vxworks/aarch64.rs b/third_party/cargo/vendor/libc-0.2.92/src/vxworks/aarch64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/vxworks/aarch64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/vxworks/aarch64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/vxworks/arm.rs b/third_party/cargo/vendor/libc-0.2.92/src/vxworks/arm.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/vxworks/arm.rs rename to third_party/cargo/vendor/libc-0.2.92/src/vxworks/arm.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/vxworks/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/vxworks/mod.rs similarity index 99% rename from third_party/cargo/vendor/libc-0.2.82/src/vxworks/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/vxworks/mod.rs index 668a7fc..704dac7 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/vxworks/mod.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/vxworks/mod.rs @@ -1040,7 +1040,7 @@ impl ::Clone for fpos_t { } f! { - pub fn CMSG_ALIGN(len: usize) -> usize { + pub {const} fn CMSG_ALIGN(len: usize) -> usize { len + ::mem::size_of::() - 1 & !(::mem::size_of::() - 1) } @@ -1071,7 +1071,7 @@ f! { .offset(CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize) } - pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { (CMSG_ALIGN(length as usize) + CMSG_ALIGN(::mem::size_of::())) as ::c_uint } diff --git a/third_party/cargo/vendor/libc-0.2.82/src/vxworks/powerpc.rs b/third_party/cargo/vendor/libc-0.2.92/src/vxworks/powerpc.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/vxworks/powerpc.rs rename to third_party/cargo/vendor/libc-0.2.92/src/vxworks/powerpc.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/vxworks/powerpc64.rs b/third_party/cargo/vendor/libc-0.2.92/src/vxworks/powerpc64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/vxworks/powerpc64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/vxworks/powerpc64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/vxworks/x86.rs b/third_party/cargo/vendor/libc-0.2.92/src/vxworks/x86.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/vxworks/x86.rs rename to third_party/cargo/vendor/libc-0.2.92/src/vxworks/x86.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/vxworks/x86_64.rs b/third_party/cargo/vendor/libc-0.2.92/src/vxworks/x86_64.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/vxworks/x86_64.rs rename to third_party/cargo/vendor/libc-0.2.92/src/vxworks/x86_64.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/wasi.rs b/third_party/cargo/vendor/libc-0.2.92/src/wasi.rs similarity index 89% rename from third_party/cargo/vendor/libc-0.2.82/src/wasi.rs rename to third_party/cargo/vendor/libc-0.2.92/src/wasi.rs index e06984c..9aef01a 100644 --- a/third_party/cargo/vendor/libc-0.2.82/src/wasi.rs +++ b/third_party/cargo/vendor/libc-0.2.92/src/wasi.rs @@ -35,6 +35,7 @@ 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 __wasi_rights_t = u64; @@ -209,6 +210,7 @@ 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; @@ -774,9 +776,116 @@ extern "C" { pub fn __wasilibc_rmdirat(fd: c_int, path: *const c_char) -> c_int; pub fn __wasilibc_find_relpath( path: *const c_char, - relative_path: *mut *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); diff --git a/third_party/cargo/vendor/libc-0.2.82/src/windows/gnu/align.rs b/third_party/cargo/vendor/libc-0.2.92/src/windows/gnu/align.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/windows/gnu/align.rs rename to third_party/cargo/vendor/libc-0.2.92/src/windows/gnu/align.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/windows/gnu/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/windows/gnu/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/windows/gnu/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/windows/gnu/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/windows/mod.rs b/third_party/cargo/vendor/libc-0.2.92/src/windows/mod.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/windows/mod.rs rename to third_party/cargo/vendor/libc-0.2.92/src/windows/mod.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/src/windows/msvc.rs b/third_party/cargo/vendor/libc-0.2.92/src/windows/msvc.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/src/windows/msvc.rs rename to third_party/cargo/vendor/libc-0.2.92/src/windows/msvc.rs diff --git a/third_party/cargo/vendor/libc-0.2.82/tests/const_fn.rs b/third_party/cargo/vendor/libc-0.2.92/tests/const_fn.rs similarity index 100% rename from third_party/cargo/vendor/libc-0.2.82/tests/const_fn.rs rename to third_party/cargo/vendor/libc-0.2.92/tests/const_fn.rs diff --git a/third_party/cargo/vendor/libloading-0.6.6/.cargo-checksum.json b/third_party/cargo/vendor/libloading-0.6.7/.cargo-checksum.json similarity index 59% rename from third_party/cargo/vendor/libloading-0.6.6/.cargo-checksum.json rename to third_party/cargo/vendor/libloading-0.6.7/.cargo-checksum.json index 5ee1149..93d0e15 100644 --- a/third_party/cargo/vendor/libloading-0.6.6/.cargo-checksum.json +++ b/third_party/cargo/vendor/libloading-0.6.7/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"d6cbb46b5aae841c9f87eed545eb2f8279e69eea6fe7a389ea67b2644f72d6f9","LICENSE":"b29f8b01452350c20dd1af16ef83b598fea3053578ccc1c7a0ef40e57be2620f","README.mkd":"a393e1f356cb808332ce9259dba73214b00595198bb8b6274e12f86c79ecfa5d","src/changelog.rs":"01e102f1d3d3620c0db1013a6c55283ff238bc4d063ab7593ff993e32c35a541","src/error.rs":"42fba08d5af2a1d4822e933fb9158d21761bbbfa8b83b1a09389158544b63925","src/lib.rs":"7d2b3f92371bb875e77a07a1448235ccefcb9efe2f8db40255ee07ec21fbcae4","src/os/mod.rs":"88ff3de01a3a2e2ddd45d11de37f765fde2f2afc043e79fa78271c3a266815d4","src/os/unix/consts.rs":"471ffb42725d19374036fe2d75b4eb81dbd44e2960543c1f278611ff20257450","src/os/unix/mod.rs":"fcd3471cb6de2896b42306200b98ac5431232ab898519351be6762afe2c47328","src/os/windows/mod.rs":"e34c7cd71e93f49e92abbc18f6ca12680bda75b9681563124581215ecfd6de8e","src/test_helpers.rs":"201403e143e5b3204864124cd38067cf8813d5273dc1a9099288a9dc4bdd15b6","src/util.rs":"571ce54e82c48bb4d678240da1f61c2c935248b4e5b3010b49174b32224b9542","tests/constants.rs":"f958b26be93bd26d37b25963f019b7856151cb18dd98d34923ddf968121f7f0a","tests/functions.rs":"fece989a29fdadc970eb21848c37bc6b607d68fb37ff3afc6536059f09bc6ba6","tests/library_filename.rs":"b1481f0bb374687c5f24e25113426d2a95f08a45fb8bc41a41e8702bd5a7b4bf","tests/markers.rs":"0ebc8f807b92e39452d35732988012cdca7ce96231c57eaac9c3f4217225ad39","tests/nagisa32.dll":"5c69b2bd9c8a6ad04165c221075fc9fade1dd66ca697399ace528a5a62328e36","tests/nagisa64.dll":"e20b95e3036f3289421abd100760874d4f455afd33c3b5b64fec56b191f7d477","tests/windows.rs":"7711dfe19062d91356cd127546542b1b6e13aeef76ad3098f32c8a6ae319b66a"},"package":"e9367bdfa836b7e3cf895867f7a570283444da90562980ec2263d6e1569b16bc"} \ No newline at end of file +{"files":{"Cargo.toml":"649158981e4cf1092fffe025770c46cafa148f60dfae75082a574417d061f93c","LICENSE":"b29f8b01452350c20dd1af16ef83b598fea3053578ccc1c7a0ef40e57be2620f","README.mkd":"a393e1f356cb808332ce9259dba73214b00595198bb8b6274e12f86c79ecfa5d","src/changelog.rs":"ba3d63f614adad4be9ea4120cbf11eed7d6a4d0b1127f35c8f55bf22b20cc1a9","src/error.rs":"3f8f55ba5dfb196af92988afe6ce16bc5fd73be4fc0d85e8e5d23872729cd148","src/lib.rs":"7d2b3f92371bb875e77a07a1448235ccefcb9efe2f8db40255ee07ec21fbcae4","src/os/mod.rs":"88ff3de01a3a2e2ddd45d11de37f765fde2f2afc043e79fa78271c3a266815d4","src/os/unix/consts.rs":"471ffb42725d19374036fe2d75b4eb81dbd44e2960543c1f278611ff20257450","src/os/unix/mod.rs":"fcd3471cb6de2896b42306200b98ac5431232ab898519351be6762afe2c47328","src/os/windows/mod.rs":"9bc47e8c5b684e1e717ce342d4f218b35d2833ee9bc332ccdb4e56941932666f","src/test_helpers.rs":"201403e143e5b3204864124cd38067cf8813d5273dc1a9099288a9dc4bdd15b6","src/util.rs":"571ce54e82c48bb4d678240da1f61c2c935248b4e5b3010b49174b32224b9542","tests/constants.rs":"f958b26be93bd26d37b25963f019b7856151cb18dd98d34923ddf968121f7f0a","tests/functions.rs":"10682240af45cebe3a1fd2158b26b1dca93d1b574bf4fc6543e70b0e364c82ea","tests/library_filename.rs":"b1481f0bb374687c5f24e25113426d2a95f08a45fb8bc41a41e8702bd5a7b4bf","tests/markers.rs":"0ebc8f807b92e39452d35732988012cdca7ce96231c57eaac9c3f4217225ad39","tests/nagisa32.dll":"5c69b2bd9c8a6ad04165c221075fc9fade1dd66ca697399ace528a5a62328e36","tests/nagisa64.dll":"e20b95e3036f3289421abd100760874d4f455afd33c3b5b64fec56b191f7d477","tests/windows.rs":"7711dfe19062d91356cd127546542b1b6e13aeef76ad3098f32c8a6ae319b66a"},"package":"351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883"} \ No newline at end of file diff --git a/third_party/cargo/vendor/libloading-0.6.7/BUILD.bazel b/third_party/cargo/vendor/libloading-0.6.7/BUILD.bazel new file mode 100644 index 0000000..e52ca79 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.6.7/BUILD.bazel @@ -0,0 +1,81 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//third_party/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # ISC from expression "ISC" +]) + +# Generated Targets + +rust_library( + name = "libloading", + srcs = glob(["**/*.rs"]), + aliases = { + }, + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + data = [], + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.6.7", + # buildifier: leave-alone + deps = [ + ] + selects.with_or({ + # cfg(unix) + ( + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", + ): [ + "//third_party/cargo/vendor/cfg-if-1.0.0:cfg_if", + ], + "//conditions:default": [], + }) + selects.with_or({ + # cfg(windows) + ( + "@rules_rust//rust/platform:x86_64-pc-windows-msvc", + ): [ + "//third_party/cargo/vendor/winapi-0.3.9:winapi", + ], + "//conditions:default": [], + }), +) + +# Unsupported target "constants" with type "test" omitted + +# Unsupported target "functions" with type "test" omitted + +# Unsupported target "library_filename" with type "test" omitted + +# Unsupported target "markers" with type "test" omitted + +# Unsupported target "windows" with type "test" omitted diff --git a/third_party/cargo/vendor/libloading-0.6.6/Cargo.toml b/third_party/cargo/vendor/libloading-0.6.7/Cargo.toml similarity index 98% rename from third_party/cargo/vendor/libloading-0.6.6/Cargo.toml rename to third_party/cargo/vendor/libloading-0.6.7/Cargo.toml index ea9984d..f32d665 100644 --- a/third_party/cargo/vendor/libloading-0.6.6/Cargo.toml +++ b/third_party/cargo/vendor/libloading-0.6.7/Cargo.toml @@ -12,7 +12,7 @@ [package] name = "libloading" -version = "0.6.6" +version = "0.6.7" authors = ["Simonas Kazlauskas "] description = "A safer binding to platform’s dynamic library loading utilities" documentation = "https://docs.rs/libloading/" diff --git a/third_party/cargo/vendor/libloading-0.6.6/LICENSE b/third_party/cargo/vendor/libloading-0.6.7/LICENSE similarity index 100% rename from third_party/cargo/vendor/libloading-0.6.6/LICENSE rename to third_party/cargo/vendor/libloading-0.6.7/LICENSE diff --git a/third_party/cargo/vendor/libloading-0.6.6/README.mkd b/third_party/cargo/vendor/libloading-0.6.7/README.mkd similarity index 100% rename from third_party/cargo/vendor/libloading-0.6.6/README.mkd rename to third_party/cargo/vendor/libloading-0.6.7/README.mkd diff --git a/third_party/cargo/vendor/libloading-0.6.6/src/changelog.rs b/third_party/cargo/vendor/libloading-0.6.7/src/changelog.rs similarity index 92% rename from third_party/cargo/vendor/libloading-0.6.6/src/changelog.rs rename to third_party/cargo/vendor/libloading-0.6.7/src/changelog.rs index 0ae7323..67f9cb0 100644 --- a/third_party/cargo/vendor/libloading-0.6.6/src/changelog.rs +++ b/third_party/cargo/vendor/libloading-0.6.7/src/changelog.rs @@ -3,6 +3,17 @@ // TODO: for the next breaking release rename `Error::LoadLibraryW` to `Error::LoadLibraryExW`. // TODO: for the next breaking release use `RTLD_LAZY | RTLD_LOCAL` by default on unix. +/// Release 0.6.7 (2021-01-14) +/// +/// * Added a [`os::windows::Library::open_already_loaded`] to obtain a handle to a library that +/// must already be loaded. There is no portable equivalent for all UNIX targets. Users who do not +/// care about portability across UNIX platforms may use [`os::unix::Library::open`] with +/// `libc::RTLD_NOLOAD`; +/// +/// [`os::windows::Library::open_already_loaded`]: crate::os::windows::Library::open_already_loaded +/// [`os::unix::Library::open`]: crate::os::unix::Library::open +pub mod r0_6_7 {} + /// Release 0.6.6 (2020-12-03) /// /// * Fix a double-release of resources when [`Library::close`] or [`os::windows::Library::close`] diff --git a/third_party/cargo/vendor/libloading-0.6.6/src/error.rs b/third_party/cargo/vendor/libloading-0.6.7/src/error.rs similarity index 98% rename from third_party/cargo/vendor/libloading-0.6.6/src/error.rs rename to third_party/cargo/vendor/libloading-0.6.7/src/error.rs index 6ba5367..e1c465e 100644 --- a/third_party/cargo/vendor/libloading-0.6.6/src/error.rs +++ b/third_party/cargo/vendor/libloading-0.6.7/src/error.rs @@ -55,7 +55,7 @@ pub enum Error { /// The source error. source: WindowsError }, - /// The `LoadLibraryW` call failed and system did not report an error. + /// The `GetModuleHandleExW` call failed and system did not report an error. GetModuleHandleExWUnknown, /// The `GetProcAddress` call failed. GetProcAddress { diff --git a/third_party/cargo/vendor/libloading-0.6.6/src/lib.rs b/third_party/cargo/vendor/libloading-0.6.7/src/lib.rs similarity index 100% rename from third_party/cargo/vendor/libloading-0.6.6/src/lib.rs rename to third_party/cargo/vendor/libloading-0.6.7/src/lib.rs diff --git a/third_party/cargo/vendor/libloading-0.6.6/src/os/mod.rs b/third_party/cargo/vendor/libloading-0.6.7/src/os/mod.rs similarity index 100% rename from third_party/cargo/vendor/libloading-0.6.6/src/os/mod.rs rename to third_party/cargo/vendor/libloading-0.6.7/src/os/mod.rs diff --git a/third_party/cargo/vendor/libloading-0.6.6/src/os/unix/consts.rs b/third_party/cargo/vendor/libloading-0.6.7/src/os/unix/consts.rs similarity index 100% rename from third_party/cargo/vendor/libloading-0.6.6/src/os/unix/consts.rs rename to third_party/cargo/vendor/libloading-0.6.7/src/os/unix/consts.rs diff --git a/third_party/cargo/vendor/libloading-0.6.6/src/os/unix/mod.rs b/third_party/cargo/vendor/libloading-0.6.7/src/os/unix/mod.rs similarity index 100% rename from third_party/cargo/vendor/libloading-0.6.6/src/os/unix/mod.rs rename to third_party/cargo/vendor/libloading-0.6.7/src/os/unix/mod.rs diff --git a/third_party/cargo/vendor/libloading-0.6.6/src/os/windows/mod.rs b/third_party/cargo/vendor/libloading-0.6.7/src/os/windows/mod.rs similarity index 91% rename from third_party/cargo/vendor/libloading-0.6.6/src/os/windows/mod.rs rename to third_party/cargo/vendor/libloading-0.6.7/src/os/windows/mod.rs index da1b5c9..f1298f6 100644 --- a/third_party/cargo/vendor/libloading-0.6.6/src/os/windows/mod.rs +++ b/third_party/cargo/vendor/libloading-0.6.7/src/os/windows/mod.rs @@ -119,6 +119,45 @@ impl Library { } } + /// Load a module that is already loaded by the program. + /// + /// This function returns a `Library` corresponding to a module with the given name that is + /// already mapped into the address space of the process. If the module isn't found an error is + /// returned. + /// + /// If the `filename` does not include a full path and there are multiple different loaded + /// modules corresponding to the `filename`, it is impossible to predict which module handle + /// will be returned. For more information refer to [MSDN]. + /// + /// If the `filename` specifies a library filename without path and with extension omitted, + /// `.dll` extension is implicitly added. This behaviour may be suppressed by appending a + /// trailing `.` to the `filename`. + /// + /// This is equivalent to `GetModuleHandleExW(0, filename, _)`. + /// + /// [MSDN]: https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandleexw + pub fn open_already_loaded>(filename: P) -> Result { + let wide_filename: Vec = filename.as_ref().encode_wide().chain(Some(0)).collect(); + + let ret = unsafe { + let mut handle: HMODULE = std::ptr::null_mut(); + with_get_last_error(|source| crate::Error::GetModuleHandleExW { source }, || { + // Make sure no winapi calls as a result of drop happen inside this closure, because + // otherwise that might change the return value of the GetLastError. + let result = libloaderapi::GetModuleHandleExW(0, wide_filename.as_ptr(), &mut handle); + if result == 0 { + None + } else { + Some(Library(handle)) + } + }).map_err(|e| e.unwrap_or(crate::Error::GetModuleHandleExWUnknown)) + }; + + drop(wide_filename); // Drop wide_filename here to ensure it doesn’t get moved and dropped + // inside the closure by mistake. See comment inside the closure. + ret + } + /// Find and load a module, additionally adjusting behaviour with flags. /// /// See [`Library::new`] for documentation on handling of the `filename` argument. See the diff --git a/third_party/cargo/vendor/libloading-0.6.6/src/test_helpers.rs b/third_party/cargo/vendor/libloading-0.6.7/src/test_helpers.rs similarity index 100% rename from third_party/cargo/vendor/libloading-0.6.6/src/test_helpers.rs rename to third_party/cargo/vendor/libloading-0.6.7/src/test_helpers.rs diff --git a/third_party/cargo/vendor/libloading-0.6.6/src/util.rs b/third_party/cargo/vendor/libloading-0.6.7/src/util.rs similarity index 100% rename from third_party/cargo/vendor/libloading-0.6.6/src/util.rs rename to third_party/cargo/vendor/libloading-0.6.7/src/util.rs diff --git a/third_party/cargo/vendor/libloading-0.6.6/tests/constants.rs b/third_party/cargo/vendor/libloading-0.6.7/tests/constants.rs similarity index 100% rename from third_party/cargo/vendor/libloading-0.6.6/tests/constants.rs rename to third_party/cargo/vendor/libloading-0.6.7/tests/constants.rs diff --git a/third_party/cargo/vendor/libloading-0.6.6/tests/functions.rs b/third_party/cargo/vendor/libloading-0.6.7/tests/functions.rs similarity index 92% rename from third_party/cargo/vendor/libloading-0.6.6/tests/functions.rs rename to third_party/cargo/vendor/libloading-0.6.7/tests/functions.rs index e899344..35045e8 100644 --- a/third_party/cargo/vendor/libloading-0.6.6/tests/functions.rs +++ b/third_party/cargo/vendor/libloading-0.6.7/tests/functions.rs @@ -235,3 +235,23 @@ fn works_getlasterror0() { assert_eq!(errhandlingapi::GetLastError(), gle()) } } + +#[cfg(windows)] +#[test] +fn library_open_already_loaded() { + use libloading::os::windows::Library; + + // Present on Windows systems and NOT used by any other tests to prevent races. + const LIBPATH: &str = "Msftedit.dll"; + + // Not loaded yet. + assert!(match Library::open_already_loaded(LIBPATH) { + Err(libloading::Error::GetModuleHandleExW { .. }) => true, + _ => false, + }); + + let _lib = Library::new(LIBPATH).unwrap(); + + // Loaded now. + assert!(Library::open_already_loaded(LIBPATH).is_ok()); +} diff --git a/third_party/cargo/vendor/libloading-0.6.6/tests/library_filename.rs b/third_party/cargo/vendor/libloading-0.6.7/tests/library_filename.rs similarity index 100% rename from third_party/cargo/vendor/libloading-0.6.6/tests/library_filename.rs rename to third_party/cargo/vendor/libloading-0.6.7/tests/library_filename.rs diff --git a/third_party/cargo/vendor/libloading-0.6.6/tests/markers.rs b/third_party/cargo/vendor/libloading-0.6.7/tests/markers.rs similarity index 100% rename from third_party/cargo/vendor/libloading-0.6.6/tests/markers.rs rename to third_party/cargo/vendor/libloading-0.6.7/tests/markers.rs diff --git a/third_party/cargo/vendor/libloading-0.6.6/tests/nagisa32.dll b/third_party/cargo/vendor/libloading-0.6.7/tests/nagisa32.dll similarity index 100% rename from third_party/cargo/vendor/libloading-0.6.6/tests/nagisa32.dll rename to third_party/cargo/vendor/libloading-0.6.7/tests/nagisa32.dll diff --git a/third_party/cargo/vendor/libloading-0.6.6/tests/nagisa64.dll b/third_party/cargo/vendor/libloading-0.6.7/tests/nagisa64.dll similarity index 100% rename from third_party/cargo/vendor/libloading-0.6.6/tests/nagisa64.dll rename to third_party/cargo/vendor/libloading-0.6.7/tests/nagisa64.dll diff --git a/third_party/cargo/vendor/libloading-0.6.6/tests/windows.rs b/third_party/cargo/vendor/libloading-0.6.7/tests/windows.rs similarity index 100% rename from third_party/cargo/vendor/libloading-0.6.6/tests/windows.rs rename to third_party/cargo/vendor/libloading-0.6.7/tests/windows.rs diff --git a/third_party/cargo/vendor/libloading-0.7.0/.cargo-checksum.json b/third_party/cargo/vendor/libloading-0.7.0/.cargo-checksum.json new file mode 100644 index 0000000..3064970 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"031a61128684ea9d7a3049ee2e2719d6dd959d35b77eceb51a0fec4ae1d1fcf7","LICENSE":"b29f8b01452350c20dd1af16ef83b598fea3053578ccc1c7a0ef40e57be2620f","README.mkd":"a393e1f356cb808332ce9259dba73214b00595198bb8b6274e12f86c79ecfa5d","src/changelog.rs":"840f2b85f7e30e5db5c05b1d9b6d01a5c728d8b295185fca7b27a1ea90abf97c","src/error.rs":"156c53e299e8f1cd4694b277a5d92772a8a9e7ec4004bae067367f4c2502de8b","src/lib.rs":"9201c853657af7230338ccd6126a5666085604c34e205cdf26c948c08754652a","src/os/mod.rs":"0ea22a6628beb4793b164795e53d9541daa7b93b581d2aa0c965c14a264fbe21","src/os/unix/consts.rs":"471ffb42725d19374036fe2d75b4eb81dbd44e2960543c1f278611ff20257450","src/os/unix/mod.rs":"a9bcb1d57b2a06919349e64b8f974be32ef912a6e33cd1e8a911014f3f8f2843","src/os/windows/mod.rs":"7f8ce722303f6ac91fa66294534fd5b266fe97f86d72293c256ccf13d970be74","src/test_helpers.rs":"201403e143e5b3204864124cd38067cf8813d5273dc1a9099288a9dc4bdd15b6","src/util.rs":"571ce54e82c48bb4d678240da1f61c2c935248b4e5b3010b49174b32224b9542","tests/constants.rs":"f958b26be93bd26d37b25963f019b7856151cb18dd98d34923ddf968121f7f0a","tests/functions.rs":"93b57a398d17d07714003f9538f4d6aeec9c3ff23a8d35daa26494f01cc2a128","tests/library_filename.rs":"b1481f0bb374687c5f24e25113426d2a95f08a45fb8bc41a41e8702bd5a7b4bf","tests/markers.rs":"0ebc8f807b92e39452d35732988012cdca7ce96231c57eaac9c3f4217225ad39","tests/nagisa32.dll":"5c69b2bd9c8a6ad04165c221075fc9fade1dd66ca697399ace528a5a62328e36","tests/nagisa64.dll":"e20b95e3036f3289421abd100760874d4f455afd33c3b5b64fec56b191f7d477","tests/windows.rs":"35584a46658b305cd539712d3ba3c21fe7a130fd693aa1389e4886a67625d532"},"package":"6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a"} \ No newline at end of file diff --git a/third_party/cargo/vendor/libloading-0.6.6/BUILD.bazel b/third_party/cargo/vendor/libloading-0.7.0/BUILD.bazel similarity index 98% rename from third_party/cargo/vendor/libloading-0.6.6/BUILD.bazel rename to third_party/cargo/vendor/libloading-0.7.0/BUILD.bazel index e0148a0..46d8adc 100644 --- a/third_party/cargo/vendor/libloading-0.6.6/BUILD.bazel +++ b/third_party/cargo/vendor/libloading-0.7.0/BUILD.bazel @@ -48,7 +48,7 @@ rust_library( "cargo-raze", "manual", ], - version = "0.6.6", + version = "0.7.0", # buildifier: leave-alone deps = [ "//third_party/cargo/patches:libloading_global_static", diff --git a/third_party/cargo/vendor/libloading-0.7.0/Cargo.toml b/third_party/cargo/vendor/libloading-0.7.0/Cargo.toml new file mode 100644 index 0000000..396a5c2 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/Cargo.toml @@ -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] +name = "libloading" +version = "0.7.0" +authors = ["Simonas Kazlauskas "] +description = "A safer binding to platform’s dynamic library loading utilities" +documentation = "https://docs.rs/libloading/" +readme = "README.mkd" +keywords = ["dlopen", "load", "shared", "dylib"] +categories = ["api-bindings"] +license = "ISC" +repository = "https://github.com/nagisa/rust_libloading/" +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] +[dev-dependencies.libc] +version = "0.2" + +[dev-dependencies.static_assertions] +version = "1.1" +[target."cfg(unix)".dependencies.cfg-if] +version = "1" +[target."cfg(windows)".dependencies.winapi] +version = "0.3" +features = ["errhandlingapi", "libloaderapi"] diff --git a/third_party/cargo/vendor/libloading-0.7.0/LICENSE b/third_party/cargo/vendor/libloading-0.7.0/LICENSE new file mode 100644 index 0000000..9137d56 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/LICENSE @@ -0,0 +1,12 @@ +Copyright © 2015, Simonas Kazlauskas + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without +fee is hereby granted, provided that the above copyright notice and this permission notice appear +in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 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 +THIS SOFTWARE. diff --git a/third_party/cargo/vendor/libloading-0.7.0/README.mkd b/third_party/cargo/vendor/libloading-0.7.0/README.mkd new file mode 100644 index 0000000..8f7d342 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/README.mkd @@ -0,0 +1,16 @@ +# libloading + +Safer bindings around system dynamic library loading primitives. The most important safety +guarantee by this library is prevention of dangling-`Symbol`s that may occur after a `Library` is +unloaded. + +Using this library allows loading dynamic libraries (also known as shared libraries) as well as use +functions and static variables these libraries contain. + +* [Documentation][docs] +* [Changelog][changelog] + +[docs]: https://docs.rs/libloading/ +[changelog]: https://docs.rs/libloading/*/libloading/changelog/index.html + +libloading is available to use under ISC (MIT-like) license. diff --git a/third_party/cargo/vendor/libloading-0.7.0/src/changelog.rs b/third_party/cargo/vendor/libloading-0.7.0/src/changelog.rs new file mode 100644 index 0000000..c927551 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/src/changelog.rs @@ -0,0 +1,291 @@ +//! The change log. + +/// Release 0.7.0 (2021-01-31) +/// +/// ## Breaking changes +/// +/// ### Loading functions are now `unsafe` +/// +/// A number of associated methods involved in loading a library were changed to +/// be `unsafe`. The affected functions are: [`Library::new`], [`os::unix::Library::new`], +/// [`os::unix::Library::open`], [`os::windows::Library::new`], +/// [`os::windows::Library::load_with_flags`]. This is the most prominent breaking change in this +/// release and affects majority of the users of `libloading`. +/// +/// In order to see why it was necessary, consider the following snippet of C++ code: +/// +/// ```c++ +/// #include +/// #include +/// +/// static std::vector UNSHUU = { 1, 2, 3 }; +/// +/// int main() { +/// std::cout << UNSHUU[0] << UNSHUU[1] << UNSHUU[2] << std::endl; // Prints 123 +/// return 0; +/// } +/// ``` +/// +/// The `std::vector` type, much like in Rust's `Vec`, stores its contents in a buffer allocated on +/// the heap. In this example the vector object itself is stored and initialized as a static +/// variable – a compile time construct. The heap, on the other hand, is a runtime construct. And +/// yet the code works exactly as you'd expect – the vector contains numbers 1, 2 and 3 stored in +/// a buffer on heap. So, _what_ makes it work out, exactly? +/// +/// Various executable and shared library formats define conventions and machinery to execute +/// arbitrary code when a program or a shared library is loaded. On systems using the PE format +/// (e.g. Windows) this is available via the optional `DllMain` initializer. Various systems +/// utilizing the ELF format take a sightly different approach of maintaining an array of function +/// pointers in the `.init_array` section. A very similar mechanism exists on systems that utilize +/// the Mach-O format. +/// +/// For the C++ program above, the object stored in the `UNSHUU` global variable is constructed +/// by code run as part of such an initializer routine. This initializer is run before the entry +/// point (the `main` function) is executed, allowing for this magical behaviour to be possible. +/// Were the C++ code built as a shared library instead, the initialization routines would run as +/// the resulting shared library is loaded. In case of `libloading` – during the call to +/// `Library::new` and other methods affected by this change. +/// +/// These initialization (and very closely related termination) routines can be utilized outside of +/// C++ too. Anybody can build a shared library in variety of different programming languages and +/// set up the initializers to execute arbitrary code. Potentially code that does all sorts of +/// wildly unsound stuff. +/// +/// The routines are executed by components that are an integral part of the operating system. +/// Changing or controlling the operation of these components is infeasible. With that in +/// mind, the initializer and termination routines are something anybody loading a library must +/// carefully evaluate the libraries loaded for soundness. +/// +/// In practice, a vast majority of the libraries can be considered a good citizen and their +/// initialization and termination routines, if they have any at all, can be trusted to be sound. +/// +/// Also see: [issue #86]. +/// +/// ### Better & more consistent default behaviour on UNIX systems +/// +/// On UNIX systems the [`Library::new`], [`os::unix::Library::new`] and +/// [`os::unix::Library::this`] methods have been changed to use +/// [RTLD_LAZY] | [RTLD_LOCAL] as the default set of loader options (previously: +/// [`RTLD_NOW`]). This has a couple benefits. Namely: +/// +/// * Lazy binding is generally quicker to execute when only a subset of symbols from a library are +/// used and is typically the default when neither `RTLD_LAZY` nor `RTLD_NOW` are specified when +/// calling the underlying `dlopen` API; +/// * On most UNIX systems (macOS being a notable exception) `RTLD_LOCAL` is the default when +/// neither `RTLD_LOCAL` nor [`RTLD_GLOBAL`] are specified. The explicit setting of the +/// `RTLD_LOCAL` flag makes this behaviour consistent across platforms. +/// +/// ### Dropped support for Windows XP/Vista +/// +/// The (broken) support for Windows XP and Windows Vista environments was removed. This was +/// prompted primarily by a similar policy change in the [Rust +/// project](https://github.com/rust-lang/compiler-team/issues/378) but also as an acknowledgement +/// to the fact that `libloading` never worked in these environments anyway. +/// +/// ### More accurate error variant names +/// +/// Finally, the `Error::LoadLibraryW` renamed to [`Error::LoadLibraryExW`] to more accurately +/// represent the underlying API that's failing. No functional changes as part of this rename +/// intended. +/// +/// [issue #86]: https://github.com/nagisa/rust_libloading/issues/86 +/// [`Library::new`]: crate::Library::new +/// [`Error::LoadLibraryExW`]: crate::Error::LoadLibraryExW +/// [`os::unix::Library::this`]: crate::os::unix::Library::this +/// [`os::unix::Library::new`]: crate::os::unix::Library::new +/// [`os::unix::Library::open`]: crate::os::unix::Library::new +/// [`os::windows::Library::new`]: crate::os::windows::Library::new +/// [`os::windows::Library::load_with_flags`]: crate::os::windows::Library::load_with_flags +/// [`RTLD_NOW`]: crate::os::unix::RTLD_NOW +/// [RTLD_LAZY]: crate::os::unix::RTLD_LAZY +/// [RTLD_LOCAL]: crate::os::unix::RTLD_LOCAL +/// [`RTLD_GLOBAL`]: crate::os::unix::RTLD_GLOBAL +pub mod r0_7_0 {} + +/// Release 0.6.7 (2021-01-14) +/// +/// * Added a [`os::windows::Library::open_already_loaded`] to obtain a handle to a library that +/// must already be loaded. There is no portable equivalent for all UNIX targets. Users who do not +/// care about portability across UNIX platforms may use [`os::unix::Library::open`] with +/// `libc::RTLD_NOLOAD`; +/// +/// [`os::windows::Library::open_already_loaded`]: crate::os::windows::Library::open_already_loaded +/// [`os::unix::Library::open`]: crate::os::unix::Library::open +pub mod r0_6_7 {} + +/// Release 0.6.6 (2020-12-03) +/// +/// * Fix a double-release of resources when [`Library::close`] or [`os::windows::Library::close`] +/// is used on Windows. +/// +/// [`Library::close`]: crate::Library::close +/// [`os::windows::Library::close`]: crate::os::windows::Library::close +pub mod r0_6_6 {} + +/// Release 0.6.5 (2020-10-23) +/// +/// * Upgrade cfg-if 0.1 to 1.0 +pub mod r0_6_5 {} + +/// Release 0.6.4 (2020-10-10) +/// +/// * Remove use of `build.rs` making it easier to build `libloading` without cargo. It also +/// almost halves the build time of this crate. +pub mod r0_6_4 {} + +/// Release 0.6.3 (2020-08-22) +/// +/// * Improve documentation, allowing to view all of the os-specific functionality from +/// documentation generated for any target; +/// * Add [`os::windows::Library::this`]; +/// * Added constants to use with OS-specific `Library::open`; +/// * Add [`library_filename`]. +/// +/// [`os::windows::Library::this`]: crate::os::windows::Library::this +/// [`library_filename`]: crate::library_filename +pub mod r0_6_3 {} + +/// Release 0.6.2 (2020-05-06) +/// +/// * Fixed building of this library on Illumos. +pub mod r0_6_2 {} + +/// Release 0.6.1 (2020-04-15) +/// +/// * Introduced a new method [`os::windows::Library::load_with_flags`]; +/// * Added support for the Illumos triple. +/// +/// [`os::windows::Library::load_with_flags`]: crate::os::windows::Library::load_with_flags +pub mod r0_6_1 {} + +/// Release 0.6.0 (2020-04-05) +/// +/// * Introduced a new method [`os::unix::Library::get_singlethreaded`]; +/// * Added (untested) support for building when targetting Redox and Fuchsia; +/// * The APIs exposed by this library no longer panic and instead return an `Err` when it used +/// to panic. +/// +/// ## Breaking changes +/// +/// * Minimum required (stable) version of Rust to build this library is now 1.40.0; +/// * This crate now implements a custom [`Error`] type and all APIs now return this type rather +/// than returning the `std::io::Error`; +/// * `libloading::Result` has been removed; +/// * Removed the dependency on the C compiler to build this library on UNIX-like platforms. +/// `libloading` used to utilize a snippet written in C to work-around the unlikely possibility +/// of the target having a thread-unsafe implementation of the `dlerror` function. The effect of +/// the work-around was very opportunistic: it would not work if the function was called by +/// forgoing `libloading`. +/// +/// Starting with 0.6.0, [`Library::get`] on platforms where `dlerror` is not MT-safe (such as +/// FreeBSD, DragonflyBSD or NetBSD) will unconditionally return an error when the underlying +/// `dlsym` returns a null pointer. For the use-cases where loading null pointers is necessary +/// consider using [`os::unix::Library::get_singlethreaded`] instead. +/// +/// [`Library::get`]: crate::Library::get +/// [`os::unix::Library::get_singlethreaded`]: crate::os::unix::Library::get_singlethreaded +/// [`Error`]: crate::Error +pub mod r0_6_0 {} + + +/// Release 0.5.2 (2019-07-07) +/// +/// * Added API to convert OS-specific `Library` and `Symbol` conversion to underlying resources. +pub mod r0_5_2 {} + +/// Release 0.5.1 (2019-06-01) +/// +/// * Build on Haiku targets. +pub mod r0_5_1 {} + +/// Release 0.5.0 (2018-01-11) +/// +/// * Update to `winapi = ^0.3`; +/// +/// ## Breaking changes +/// +/// * libloading now requires a C compiler to build on UNIX; +/// * This is a temporary measure until the [`linkage`] attribute is stabilised; +/// * Necessary to resolve [#32]. +/// +/// [`linkage`]: https://github.com/rust-lang/rust/issues/29603 +/// [#32]: https://github.com/nagisa/rust_libloading/issues/32 +pub mod r0_5_0 {} + +/// Release 0.4.3 (2017-12-07) +/// +/// * Bump lazy-static dependency to `^1.0`; +/// * `cargo test --release` now works when testing libloading. +pub mod r0_4_3 {} + + +/// Release 0.4.2 (2017-09-24) +/// +/// * Improved error and race-condition handling on Windows; +/// * Improved documentation about thread-safety of Library; +/// * Added `Symbol::::lift_option() -> Option>` convenience method. +pub mod r0_4_2 {} + + +/// Release 0.4.1 (2017-08-29) +/// +/// * Solaris support +pub mod r0_4_1 {} + +/// Release 0.4.0 (2017-05-01) +/// +/// * Remove build-time dependency on target_build_utils (and by extension serde/phf); +/// * Require at least version 1.14.0 of rustc to build; +/// * Actually, it is cargo which has to be more recent here. The one shipped with rustc 1.14.0 +/// is what’s being required from now on. +pub mod r0_4_0 {} + +/// Release 0.3.4 (2017-03-25) +/// +/// * Remove rogue println! +pub mod r0_3_4 {} + +/// Release 0.3.3 (2017-03-25) +/// +/// * Panics when `Library::get` is called for incompatibly sized type such as named function +/// types (which are zero-sized). +pub mod r0_3_3 {} + +/// Release 0.3.2 (2017-02-10) +/// +/// * Minimum version required is now rustc 1.12.0; +/// * Updated dependency versions (most notably target_build_utils to 0.3.0) +pub mod r0_3_2 {} + +/// Release 0.3.1 (2016-10-01) +/// +/// * `Symbol` and `os::*::Symbol` now implement `Send` where `T: Send`; +/// * `Symbol` and `os::*::Symbol` now implement `Sync` where `T: Sync`; +/// * `Library` and `os::*::Library` now implement `Sync` (they were `Send` in 0.3.0 already). +pub mod r0_3_1 {} + +/// Release 0.3.0 (2016-07-27) +/// +/// * Greatly improved documentation, especially around platform-specific behaviours; +/// * Improved test suite by building our own library to test against; +/// * All `Library`-ies now implement `Send`. +/// * Added `impl From for Library` and `impl From for +/// os::platform::Library` allowing wrapping and extracting the platform-specific library handle; +/// * Added methods to wrap (`Symbol::from_raw`) and unwrap (`Symbol::into_raw`) the safe `Symbol` +/// wrapper into unsafe `os::platform::Symbol`. +/// +/// The last two additions focus on not restricting potential usecases of this library, allowing +/// users of the library to circumvent safety checks if need be. +/// +/// ## Breaking Changes +/// +/// `Library::new` defaults to `RTLD_NOW` instead of `RTLD_LAZY` on UNIX for more consistent +/// cross-platform behaviour. If a library loaded with `Library::new` had any linking errors, but +/// unresolved references weren’t forced to be resolved, the library would’ve “just worked”, +/// whereas now the call to `Library::new` will return an error signifying presence of such error. +/// +/// ## os::platform +/// * Added `os::unix::Library::open` which allows specifying arbitrary flags (e.g. `RTLD_LAZY`); +/// * Added `os::windows::Library::get_ordinal` which allows finding a function or variable by its +/// ordinal number; +pub mod r0_3_0 {} diff --git a/third_party/cargo/vendor/libloading-0.7.0/src/error.rs b/third_party/cargo/vendor/libloading-0.7.0/src/error.rs new file mode 100644 index 0000000..bd70ec3 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/src/error.rs @@ -0,0 +1,130 @@ +use std::ffi::CString; + +/// A `dlerror` error. +pub struct DlDescription(pub(crate) CString); + +impl std::fmt::Debug for DlDescription { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + std::fmt::Debug::fmt(&self.0, f) + } +} + +/// A Windows API error. +pub struct WindowsError(pub(crate) std::io::Error); + +impl std::fmt::Debug for WindowsError { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + std::fmt::Debug::fmt(&self.0, f) + } +} + +/// Errors. +#[derive(Debug)] +#[non_exhaustive] +pub enum Error { + /// The `dlopen` call failed. + DlOpen { + /// The source error. + desc: DlDescription + }, + /// The `dlopen` call failed and system did not report an error. + DlOpenUnknown, + /// The `dlsym` call failed. + DlSym { + /// The source error. + desc: DlDescription + }, + /// The `dlsym` call failed and system did not report an error. + DlSymUnknown, + /// The `dlclose` call failed. + DlClose { + /// The source error. + desc: DlDescription + }, + /// The `dlclose` call failed and system did not report an error. + DlCloseUnknown, + /// The `LoadLibraryW` call failed. + LoadLibraryExW { + /// The source error. + source: WindowsError + }, + /// The `LoadLibraryW` call failed and system did not report an error. + LoadLibraryExWUnknown, + /// The `GetModuleHandleExW` call failed. + GetModuleHandleExW { + /// The source error. + source: WindowsError + }, + /// The `GetModuleHandleExW` call failed and system did not report an error. + GetModuleHandleExWUnknown, + /// The `GetProcAddress` call failed. + GetProcAddress { + /// The source error. + source: WindowsError + }, + /// The `GetProcAddressUnknown` call failed and system did not report an error. + GetProcAddressUnknown, + /// The `FreeLibrary` call failed. + FreeLibrary { + /// The source error. + source: WindowsError + }, + /// The `FreeLibrary` call failed and system did not report an error. + FreeLibraryUnknown, + /// The requested type cannot possibly work. + IncompatibleSize, + /// Could not create a new CString. + CreateCString { + /// The source error. + source: std::ffi::NulError + }, + /// Could not create a new CString from bytes with trailing null. + CreateCStringWithTrailing { + /// The source error. + source: std::ffi::FromBytesWithNulError + }, +} + +impl std::error::Error for Error { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + use Error::*; + match *self { + CreateCString { ref source } => Some(source), + CreateCStringWithTrailing { ref source } => Some(source), + LoadLibraryExW { ref source } => Some(&source.0), + GetProcAddress { ref source } => Some(&source.0), + FreeLibrary { ref source } => Some(&source.0), + _ => None, + } + } +} + +impl std::fmt::Display for Error { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + use Error::*; + match *self { + DlOpen { ref desc } => write!(f, "{}", desc.0.to_string_lossy()), + DlOpenUnknown => write!(f, "dlopen failed, but system did not report the error"), + DlSym { ref desc } => write!(f, "{}", desc.0.to_string_lossy()), + DlSymUnknown => write!(f, "dlsym failed, but system did not report the error"), + DlClose { ref desc } => write!(f, "{}", desc.0.to_string_lossy()), + DlCloseUnknown => write!(f, "dlclose failed, but system did not report the error"), + LoadLibraryExW { .. } => write!(f, "LoadLibraryExW failed"), + LoadLibraryExWUnknown => + write!(f, "LoadLibraryExW failed, but system did not report the error"), + GetModuleHandleExW { .. } => write!(f, "GetModuleHandleExW failed"), + GetModuleHandleExWUnknown => + write!(f, "GetModuleHandleExWUnknown failed, but system did not report the error"), + GetProcAddress { .. } => write!(f, "GetProcAddress failed"), + GetProcAddressUnknown => + write!(f, "GetProcAddress failed, but system did not report the error"), + FreeLibrary { .. } => write!(f, "FreeLibrary failed"), + FreeLibraryUnknown => + write!(f, "FreeLibrary failed, but system did not report the error"), + CreateCString { .. } => write!(f, "could not create a C string from bytes"), + CreateCStringWithTrailing { .. } => + write!(f, "could not create a C string from bytes with trailing null"), + IncompatibleSize => write!(f, "requested type cannot possibly work"), + } + } +} diff --git a/third_party/cargo/vendor/libloading-0.7.0/src/lib.rs b/third_party/cargo/vendor/libloading-0.7.0/src/lib.rs new file mode 100644 index 0000000..9a531f1 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/src/lib.rs @@ -0,0 +1,368 @@ +//! A memory-safer wrapper around system dynamic library loading primitives. +//! +//! Using this library allows loading [dynamic libraries](struct.Library.html) (also known as +//! shared libraries) and use functions & global variables contained within the libraries. +//! +//! `libloading` crate exposes a cross-platform interface to load a library and utilize its +//! contents, but little is done to paper over the differences in behaviour between different +//! platforms. The API documentation strives to document such differences on the best-effort basis. +//! +//! Platform specific APIs are also available in the [`os`](crate::os) module. These APIs are more +//! flexible but less safe. +//! +//! # Usage +//! +//! Add a dependency on this library to your `Cargo.toml`: +//! +//! ```toml +//! [dependencies] +//! libloading = "0.7" +//! ``` +//! +//! Then inside your code: +//! +//! ```no_run +//! fn call_dynamic() -> Result> { +//! unsafe { +//! let lib = libloading::Library::new("/path/to/liblibrary.so")?; +//! let func: libloading::Symbol u32> = lib.get(b"my_func")?; +//! Ok(func()) +//! } +//! } +//! ``` +//! +//! The compiler will ensure that the loaded `function` will not outlive the `Library` it comes +//! from, preventing a common class of issues. +#![deny( + missing_docs, + clippy::all, + unreachable_pub, + unused, +)] +#![cfg_attr(docsrs, deny(broken_intra_doc_links))] +#![cfg_attr(docsrs, feature(doc_cfg))] + +use std::env::consts::{DLL_PREFIX, DLL_SUFFIX}; +use std::ffi::{OsStr, OsString}; +use std::fmt; +use std::ops; +use std::marker; + +#[cfg(unix)] +use self::os::unix as imp; +#[cfg(windows)] +use self::os::windows as imp; +pub use self::error::Error; + +pub mod os; +pub mod changelog; +mod util; +mod error; + +/// A loaded dynamic library. +pub struct Library(imp::Library); + +impl Library { + /// Find and load a dynamic library. + /// + /// The `filename` argument may be any of: + /// + /// * A library filename; + /// * Absolute path to the library; + /// * Relative (to the current working directory) path to the library. + /// + /// # Safety + /// + /// When a library is loaded initialization routines contained within the library are executed. + /// For the purposes of safety, execution of these routines is conceptually the same calling an + /// unknown foreign function and may impose arbitrary requirements on the caller for the call + /// to be sound. + /// + /// Additionally, the callers of this function must also ensure that execution of the + /// termination routines contained within the library is safe as well. These routines may be + /// executed when the library is unloaded. + /// + /// # Thread-safety + /// + /// The implementation strives to be as MT-safe as sanely possible, however on certain + /// platforms the underlying error-handling related APIs not always MT-safe. This library + /// shares these limitations on those platforms. In particular, on certain UNIX targets + /// `dlerror` is not MT-safe, resulting in garbage error messages in certain MT-scenarios. + /// + /// Calling this function from multiple threads is not MT-safe if used in conjunction with + /// library filenames and the library search path is modified (`SetDllDirectory` function on + /// Windows, `{DY,}LD_LIBRARY_PATH` environment variable on UNIX). + /// + /// # Platform-specific behaviour + /// + /// When a plain library filename is supplied, locations where library is searched for is + /// platform specific and cannot be adjusted in a portable manner. See documentation for + /// the platform specific [`os::unix::Library::new`] and [`os::windows::Library::new`] methods + /// for further information on library lookup behaviour. + /// + /// If the `filename` specifies a library filename without path and with extension omitted, + /// `.dll` extension is implicitly added on Windows. + /// + /// # Tips + /// + /// Distributing your dynamic libraries under a filename common to all platforms (e.g. + /// `awesome.module`) allows to avoid code which has to account for platform’s conventional + /// library filenames. + /// + /// Strive to specify an absolute or at least a relative path to your library, unless + /// system-wide libraries are being loaded. Platform-dependent library search locations + /// combined with various quirks related to path-less filenames may cause flakiness in + /// programs. + /// + /// # Examples + /// + /// ```no_run + /// # use ::libloading::Library; + /// // Any of the following are valid. + /// unsafe { + /// let _ = Library::new("/path/to/awesome.module").unwrap(); + /// let _ = Library::new("../awesome.module").unwrap(); + /// let _ = Library::new("libsomelib.so.1").unwrap(); + /// } + /// ``` + pub unsafe fn new>(filename: P) -> Result { + imp::Library::new(filename).map(From::from) + } + + /// Get a pointer to function or static variable by symbol name. + /// + /// The `symbol` may not contain any null bytes, with an exception of last byte. Providing a + /// null terminated `symbol` may help to avoid an allocation. + /// + /// Symbol is interpreted as-is; no mangling is done. This means that symbols like `x::y` are + /// most likely invalid. + /// + /// # Safety + /// + /// Users of this API must specify the correct type of the function or variable loaded. Using a + /// `Symbol` with a wrong type is undefined. + /// + /// # Platform-specific behaviour + /// + /// Implementation of thread local variables is extremely platform specific and uses of such + /// variables that work on e.g. Linux may have unintended behaviour on other targets. + /// + /// On POSIX implementations where the `dlerror` function is not confirmed to be MT-safe (such + /// as FreeBSD), this function will unconditionally return an error when the underlying `dlsym` + /// call returns a null pointer. There are rare situations where `dlsym` returns a genuine null + /// pointer without it being an error. If loading a null pointer is something you care about, + /// consider using the [`os::unix::Library::get_singlethreaded`] call. + /// + /// # Examples + /// + /// Given a loaded library: + /// + /// ```no_run + /// # use ::libloading::Library; + /// let lib = unsafe { + /// Library::new("/path/to/awesome.module").unwrap() + /// }; + /// ``` + /// + /// Loading and using a function looks like this: + /// + /// ```no_run + /// # use ::libloading::{Library, Symbol}; + /// # let lib = unsafe { + /// # Library::new("/path/to/awesome.module").unwrap() + /// # }; + /// unsafe { + /// let awesome_function: Symbol f64> = + /// lib.get(b"awesome_function\0").unwrap(); + /// awesome_function(0.42); + /// } + /// ``` + /// + /// A static variable may also be loaded and inspected: + /// + /// ```no_run + /// # use ::libloading::{Library, Symbol}; + /// # let lib = unsafe { Library::new("/path/to/awesome.module").unwrap() }; + /// unsafe { + /// let awesome_variable: Symbol<*mut f64> = lib.get(b"awesome_variable\0").unwrap(); + /// **awesome_variable = 42.0; + /// }; + /// ``` + pub unsafe fn get<'lib, T>(&'lib self, symbol: &[u8]) -> Result, Error> { + self.0.get(symbol).map(|from| Symbol::from_raw(from, self)) + } + + /// Unload the library. + /// + /// This method might be a no-op, depending on the flags with which the `Library` was opened, + /// what library was opened or other platform specifics. + /// + /// You only need to call this if you are interested in handling any errors that may arise when + /// library is unloaded. Otherwise the implementation of `Drop` for `Library` will close the + /// library and ignore the errors were they arise. + /// + /// The underlying data structures may still get leaked if an error does occur. + pub fn close(self) -> Result<(), Error> { + self.0.close() + } +} + +impl fmt::Debug for Library { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + +impl From for Library { + fn from(lib: imp::Library) -> Library { + Library(lib) + } +} + +impl From for imp::Library { + fn from(lib: Library) -> imp::Library { + lib.0 + } +} + +unsafe impl Send for Library {} +unsafe impl Sync for Library {} + +/// Symbol from a library. +/// +/// This type is a safeguard against using dynamically loaded symbols after a `Library` is +/// unloaded. Primary method to create an instance of a `Symbol` is via [`Library::get`]. +/// +/// The `Deref` trait implementation allows use of `Symbol` as if it was a function or variable +/// itself, without taking care to “extract” function or variable manually most of the time. +/// +/// [`Library::get`]: Library::get +pub struct Symbol<'lib, T: 'lib> { + inner: imp::Symbol, + pd: marker::PhantomData<&'lib T> +} + +impl<'lib, T> Symbol<'lib, T> { + /// Extract the wrapped `os::platform::Symbol`. + /// + /// # Safety + /// + /// Using this function relinquishes all the lifetime guarantees. It is up to programmer to + /// ensure the resulting `Symbol` is not used past the lifetime of the `Library` this symbol + /// was loaded from. + /// + /// # Examples + /// + /// ```no_run + /// # use ::libloading::{Library, Symbol}; + /// unsafe { + /// let lib = Library::new("/path/to/awesome.module").unwrap(); + /// let symbol: Symbol<*mut u32> = lib.get(b"symbol\0").unwrap(); + /// let symbol = symbol.into_raw(); + /// } + /// ``` + pub unsafe fn into_raw(self) -> imp::Symbol { + self.inner + } + + /// Wrap the `os::platform::Symbol` into this safe wrapper. + /// + /// Note that, in order to create association between the symbol and the library this symbol + /// came from, this function requires a reference to the library. + /// + /// # Safety + /// + /// The `library` reference must be exactly the library `sym` was loaded from. + /// + /// # Examples + /// + /// ```no_run + /// # use ::libloading::{Library, Symbol}; + /// unsafe { + /// let lib = Library::new("/path/to/awesome.module").unwrap(); + /// let symbol: Symbol<*mut u32> = lib.get(b"symbol\0").unwrap(); + /// let symbol = symbol.into_raw(); + /// let symbol = Symbol::from_raw(symbol, &lib); + /// } + /// ``` + pub unsafe fn from_raw(sym: imp::Symbol, library: &'lib L) -> Symbol<'lib, T> { + let _ = library; // ignore here for documentation purposes. + Symbol { + inner: sym, + pd: marker::PhantomData + } + } +} + +impl<'lib, T> Symbol<'lib, Option> { + /// Lift Option out of the symbol. + /// + /// # Examples + /// + /// ```no_run + /// # use ::libloading::{Library, Symbol}; + /// unsafe { + /// let lib = Library::new("/path/to/awesome.module").unwrap(); + /// let symbol: Symbol> = lib.get(b"symbol\0").unwrap(); + /// let symbol: Symbol<*mut u32> = symbol.lift_option().expect("static is not null"); + /// } + /// ``` + pub fn lift_option(self) -> Option> { + self.inner.lift_option().map(|is| Symbol { + inner: is, + pd: marker::PhantomData, + }) + } +} + +impl<'lib, T> Clone for Symbol<'lib, T> { + fn clone(&self) -> Symbol<'lib, T> { + Symbol { + inner: self.inner.clone(), + pd: marker::PhantomData + } + } +} + +// FIXME: implement FnOnce for callable stuff instead. +impl<'lib, T> ops::Deref for Symbol<'lib, T> { + type Target = T; + fn deref(&self) -> &T { + ops::Deref::deref(&self.inner) + } +} + +impl<'lib, T> fmt::Debug for Symbol<'lib, T> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.inner.fmt(f) + } +} + +unsafe impl<'lib, T: Send> Send for Symbol<'lib, T> {} +unsafe impl<'lib, T: Sync> Sync for Symbol<'lib, T> {} + +/// Converts a library name to a filename generally appropriate for use on the system. +/// +/// The function will prepend prefixes (such as `lib`) and suffixes (such as `.so`) to the library +/// `name` to construct the filename. +/// +/// # Examples +/// +/// It can be used to load global libraries in a platform independent manner: +/// +/// ``` +/// use libloading::{Library, library_filename}; +/// // Will attempt to load `libLLVM.so` on Linux, `libLLVM.dylib` on macOS and `LLVM.dll` on +/// // Windows. +/// let library = unsafe { +/// Library::new(library_filename("LLVM")) +/// }; +/// ``` +pub fn library_filename>(name: S) -> OsString { + let name = name.as_ref(); + let mut string = OsString::with_capacity(name.len() + DLL_PREFIX.len() + DLL_SUFFIX.len()); + string.push(DLL_PREFIX); + string.push(name); + string.push(DLL_SUFFIX); + string +} diff --git a/third_party/cargo/vendor/libloading-0.7.0/src/os/mod.rs b/third_party/cargo/vendor/libloading-0.7.0/src/os/mod.rs new file mode 100644 index 0000000..c03ebc1 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/src/os/mod.rs @@ -0,0 +1,27 @@ +//! Unsafe but flexible platform specific bindings to dynamic library loading facilities. +//! +//! These modules expose more extensive, powerful, less principled bindings to the dynamic +//! library loading facilities. Use of these bindings come at the cost of less (in most cases, +//! none at all) safety guarantees, which are provided by the top-level bindings. +//! +//! # Examples +//! +//! Using these modules will likely involve conditional compilation: +//! +//! ```ignore +//! # extern crate libloading; +//! #[cfg(unix)] +//! use libloading::os::unix::*; +//! #[cfg(windows)] +//! use libloading::os::windows::*; +//! ``` + +/// UNIX implementation of dynamic library loading. +#[cfg(any(unix, docsrs))] +#[cfg_attr(docsrs, doc(cfg(unix)))] +pub mod unix; + +/// Windows implementation of dynamic library loading. +#[cfg(any(windows, docsrs))] +#[cfg_attr(docsrs, doc(cfg(windows)))] +pub mod windows; diff --git a/third_party/cargo/vendor/libloading-0.7.0/src/os/unix/consts.rs b/third_party/cargo/vendor/libloading-0.7.0/src/os/unix/consts.rs new file mode 100644 index 0000000..2c18f95 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/src/os/unix/consts.rs @@ -0,0 +1,230 @@ +use std::os::raw::c_int; + +/// Perform lazy binding. +/// +/// Relocations shall be performed at an implementation-defined time, ranging from the time +/// of the [`Library::open`] call until the first reference to a given symbol occurs. +/// Specifying `RTLD_LAZY` should improve performance on implementations supporting dynamic +/// symbol binding since a process might not reference all of the symbols in an executable +/// object file. And, for systems supporting dynamic symbol resolution for normal process +/// execution, this behavior mimics the normal handling of process execution. +/// +/// Conflicts with [`RTLD_NOW`]. +/// +/// [`Library::open`]: crate::os::unix::Library::open +pub const RTLD_LAZY: c_int = posix::RTLD_LAZY; + +/// Perform eager binding. +/// +/// All necessary relocations shall be performed when the executable object file is first +/// loaded. This may waste some processing if relocations are performed for symbols +/// that are never referenced. This behavior may be useful for applications that need to +/// know that all symbols referenced during execution will be available before +/// [`Library::open`] returns. +/// +/// Conflicts with [`RTLD_LAZY`]. +/// +/// [`Library::open`]: crate::os::unix::Library::open +pub const RTLD_NOW: c_int = posix::RTLD_NOW; + +/// Make loaded symbols available for resolution globally. +/// +/// The executable object file's symbols shall be made available for relocation processing of any +/// other executable object file. In addition, calls to [`Library::get`] on `Library` obtained from +/// [`Library::this`] allows executable object files loaded with this mode to be searched. +/// +/// [`Library::this`]: crate::os::unix::Library::this +/// [`Library::get`]: crate::os::unix::Library::get +pub const RTLD_GLOBAL: c_int = posix::RTLD_GLOBAL; + +/// Load symbols into an isolated namespace. +/// +/// The executable object file's symbols shall not be made available for relocation processing of +/// any other executable object file. This mode of operation is most appropriate for e.g. plugins. +pub const RTLD_LOCAL: c_int = posix::RTLD_LOCAL; + +#[cfg(all(docsrs, not(unix)))] +mod posix { + use super::c_int; + pub(super) const RTLD_LAZY: c_int = !0; + pub(super) const RTLD_NOW: c_int = !0; + pub(super) const RTLD_GLOBAL: c_int = !0; + pub(super) const RTLD_LOCAL: c_int = !0; +} + +#[cfg(any(not(docsrs), unix))] +mod posix { + extern crate cfg_if; + use self::cfg_if::cfg_if; + use super::c_int; + cfg_if! { + if #[cfg(target_os = "haiku")] { + pub(super) const RTLD_LAZY: c_int = 0; + } else if #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "emscripten", + + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "openbsd", + target_os = "netbsd", + + target_os = "solaris", + target_os = "illumos", + + target_env = "uclibc", + target_env = "newlib", + + target_os = "fuchsia", + target_os = "redox", + ))] { + pub(super) const RTLD_LAZY: c_int = 1; + } else { + compile_error!( + "Target has no known `RTLD_LAZY` value. Please submit an issue or PR adding it." + ); + } + } + + cfg_if! { + if #[cfg(target_os = "haiku")] { + pub(super) const RTLD_NOW: c_int = 1; + } else if #[cfg(any( + target_os = "linux", + all(target_os = "android", target_pointer_width = "64"), + target_os = "emscripten", + + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "openbsd", + target_os = "netbsd", + + target_os = "solaris", + target_os = "illumos", + + target_env = "uclibc", + target_env = "newlib", + + target_os = "fuchsia", + target_os = "redox", + ))] { + pub(super) const RTLD_NOW: c_int = 2; + } else if #[cfg(all(target_os = "android",target_pointer_width = "32"))] { + pub(super) const RTLD_NOW: c_int = 0; + } else { + compile_error!( + "Target has no known `RTLD_NOW` value. Please submit an issue or PR adding it." + ); + } + } + + cfg_if! { + if #[cfg(any( + target_os = "haiku", + all(target_os = "android",target_pointer_width = "32"), + ))] { + pub(super) const RTLD_GLOBAL: c_int = 2; + } else if #[cfg(any( + target_env = "uclibc", + all(target_os = "linux", target_arch = "mips"), + all(target_os = "linux", target_arch = "mips64"), + ))] { + pub(super) const RTLD_GLOBAL: c_int = 4; + } else if #[cfg(any( + target_os = "macos", + target_os = "ios", + ))] { + pub(super) const RTLD_GLOBAL: c_int = 8; + } else if #[cfg(any( + target_os = "linux", + all(target_os = "android", target_pointer_width = "64"), + target_os = "emscripten", + + target_os = "freebsd", + target_os = "dragonfly", + target_os = "openbsd", + target_os = "netbsd", + + target_os = "solaris", + target_os = "illumos", + + target_env = "newlib", + + target_os = "fuchsia", + target_os = "redox", + ))] { + pub(super) const RTLD_GLOBAL: c_int = 0x100; + } else { + compile_error!( + "Target has no known `RTLD_GLOBAL` value. Please submit an issue or PR adding it." + ); + } + } + + cfg_if! { + if #[cfg(target_os = "netbsd")] { + pub(super) const RTLD_LOCAL: c_int = 0x200; + } else if #[cfg(any( + target_os = "macos", + target_os = "ios", + ))] { + pub(super) const RTLD_LOCAL: c_int = 4; + } else if #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "emscripten", + + target_os = "freebsd", + target_os = "dragonfly", + target_os = "openbsd", + + target_os = "haiku", + + target_os = "solaris", + target_os = "illumos", + + target_env = "uclibc", + target_env = "newlib", + + target_os = "fuchsia", + target_os = "redox", + ))] { + pub(super) const RTLD_LOCAL: c_int = 0; + } else { + compile_error!( + "Target has no known `RTLD_LOCAL` value. Please submit an issue or PR adding it." + ); + } + } +} + +// Other constants that exist but are not bound because they are platform-specific (non-posix) +// extensions. Some of these constants are only relevant to `dlsym` or `dlmopen` calls. +// +// RTLD_CONFGEN +// RTLD_DEFAULT +// RTLD_DI_CONFIGADDR +// RTLD_DI_LINKMAP +// RTLD_DI_LMID +// RTLD_DI_ORIGIN +// RTLD_DI_PROFILENAME +// RTLD_DI_PROFILEOUT +// RTLD_DI_SERINFO +// RTLD_DI_SERINFOSIZE +// RTLD_DI_TLS_DATA +// RTLD_DI_TLS_MODID +// RTLD_FIRST +// RTLD_GROUP +// RTLD_NEXT +// RTLD_PARENT +// RTLD_PROBE +// RTLD_SELF +// RTLD_WORLD +// RTLD_NODELETE +// RTLD_NOLOAD +// RTLD_DEEPBIND diff --git a/third_party/cargo/vendor/libloading-0.7.0/src/os/unix/mod.rs b/third_party/cargo/vendor/libloading-0.7.0/src/os/unix/mod.rs new file mode 100644 index 0000000..45e8230 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/src/os/unix/mod.rs @@ -0,0 +1,448 @@ +// A hack for docs.rs to build documentation that has both windows and linux documentation in the +// same rustdoc build visible. +#[cfg(all(docsrs, not(unix)))] +mod unix_imports { +} +#[cfg(any(not(docsrs), unix))] +mod unix_imports { + pub(super) use std::os::unix::ffi::OsStrExt; +} + +use self::unix_imports::*; +use util::{ensure_compatible_types, cstr_cow_from_bytes}; +use std::ffi::{CStr, OsStr}; +use std::{fmt, marker, mem, ptr}; +use std::os::raw; +pub use self::consts::*; + +mod consts; + +// dl* family of functions did not have enough thought put into it. +// +// Whole error handling scheme is done via setting and querying some global state, therefore it is +// not safe to use dynamic library loading in MT-capable environment at all. Only in POSIX 2008+TC1 +// a thread-local state was allowed for `dlerror`, making the dl* family of functions MT-safe. +// +// In practice (as of 2020-04-01) most of the widely used targets use a thread-local for error +// state and have been doing so for a long time. Regardless the comments in this function shall +// remain as a documentation for the future generations. +fn with_dlerror(wrap: fn(crate::error::DlDescription) -> crate::Error, closure: F) +-> Result> +where F: FnOnce() -> Option { + // We used to guard all uses of dl* functions with our own mutex. This made them safe to use in + // MT programs provided the only way a program used dl* was via this library. However, it also + // had a number of downsides or cases where it failed to handle the problems. For instance, + // if any other library called `dlerror` internally concurrently with `libloading` things would + // still go awry. + // + // On platforms where `dlerror` is still MT-unsafe, `dlsym` (`Library::get`) can spuriously + // succeed and return a null pointer for a symbol when the actual symbol look-up operation + // fails. Instances where the actual symbol _could_ be `NULL` are platform specific. For + // instance on GNU glibc based-systems (an excerpt from dlsym(3)): + // + // > The value of a symbol returned by dlsym() will never be NULL if the shared object is the + // > result of normal compilation, since a global symbol is never placed at the NULL + // > address. There are nevertheless cases where a lookup using dlsym() may return NULL as the + // > value of a symbol. For example, the symbol value may be the result of a GNU indirect + // > function (IFUNC) resolver function that returns NULL as the resolved value. + + // While we could could call `dlerror` here to clear the previous error value, only the `dlsym` + // call depends on it being cleared beforehand and only in some cases too. We will instead + // clear the error inside the dlsym binding instead. + // + // In all the other cases, clearing the error here will only be hiding misuse of these bindings + // or a bug in implementation of dl* family of functions. + closure().ok_or_else(|| unsafe { + // This code will only get executed if the `closure` returns `None`. + let error = dlerror(); + if error.is_null() { + // In non-dlsym case this may happen when there’re bugs in our bindings or there’s + // non-libloading user of libdl; possibly in another thread. + None + } else { + // You can’t even rely on error string being static here; call to subsequent dlerror + // may invalidate or overwrite the error message. Why couldn’t they simply give up the + // ownership over the message? + // TODO: should do locale-aware conversion here. OTOH Rust doesn’t seem to work well in + // any system that uses non-utf8 locale, so I doubt there’s a problem here. + let message = CStr::from_ptr(error).into(); + Some(wrap(crate::error::DlDescription(message))) + // Since we do a copy of the error string above, maybe we should call dlerror again to + // let libdl know it may free its copy of the string now? + } + }) +} + +/// A platform-specific counterpart of the cross-platform [`Library`](crate::Library). +pub struct Library { + handle: *mut raw::c_void +} + +unsafe impl Send for Library {} + +// That being said... this section in the volume 2 of POSIX.1-2008 states: +// +// > All functions defined by this volume of POSIX.1-2008 shall be thread-safe, except that the +// > following functions need not be thread-safe. +// +// With notable absence of any dl* function other than dlerror in the list. By “this volume” +// I suppose they refer precisely to the “volume 2”. dl* family of functions are specified +// by this same volume, so the conclusion is indeed that dl* functions are required by POSIX +// to be thread-safe. Great! +// +// See for more details: +// +// * https://github.com/nagisa/rust_libloading/pull/17 +// * http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_09_01 +unsafe impl Sync for Library {} + +impl Library { + /// Find and eagerly load a shared library (module). + /// + /// If the `filename` contains a [path separator], the `filename` is interpreted as a `path` to + /// a file. Otherwise, platform-specific algorithms are employed to find a library with a + /// matching file name. + /// + /// This is equivalent to [Library::open](filename, [RTLD_LAZY] | [RTLD_LOCAL]). + /// + /// [path separator]: std::path::MAIN_SEPARATOR + /// + /// # Safety + /// + /// When a library is loaded initialization routines contained within the library are executed. + /// For the purposes of safety, execution of these routines is conceptually the same calling an + /// unknown foreign function and may impose arbitrary requirements on the caller for the call + /// to be sound. + /// + /// Additionally, the callers of this function must also ensure that execution of the + /// termination routines contained within the library is safe as well. These routines may be + /// executed when the library is unloaded. + #[inline] + pub unsafe fn new>(filename: P) -> Result { + Library::open(Some(filename), RTLD_LAZY | RTLD_LOCAL) + } + + /// Load the `Library` representing the current executable. + /// + /// [`Library::get`] calls of the returned `Library` will look for symbols in following + /// locations in order: + /// + /// 1. Original program image; + /// 2. Any executable object files (e.g. shared libraries) loaded at program startup; + /// 3. Executable object files loaded at runtime (e.g. via other `Library::new` calls or via + /// calls to the `dlopen` function) + /// + /// Note that behaviour of `Library` loaded with this method is different from + /// Libraries loaded with [`os::windows::Library::this`]. + /// + /// This is equivalent to [Library::open](None, [RTLD_LAZY] | [RTLD_LOCAL]). + /// + /// [`os::windows::Library::this`]: crate::os::windows::Library::this + #[inline] + pub fn this() -> Library { + unsafe { + // SAFE: this does not load any new shared library images, no danger in it executing + // initializer routines. + Library::open(None::<&OsStr>, RTLD_LAZY | RTLD_LOCAL).expect("this should never fail") + } + } + + /// Find and load an executable object file (shared library). + /// + /// See documentation for [`Library::this`] for further description of behaviour + /// when the `filename` is `None`. Otherwise see [`Library::new`]. + /// + /// Corresponds to `dlopen(filename, flags)`. + /// + /// # Safety + /// + /// When a library is loaded initialization routines contained within the library are executed. + /// For the purposes of safety, execution of these routines is conceptually the same calling an + /// unknown foreign function and may impose arbitrary requirements on the caller for the call + /// to be sound. + /// + /// Additionally, the callers of this function must also ensure that execution of the + /// termination routines contained within the library is safe as well. These routines may be + /// executed when the library is unloaded. + pub unsafe fn open

(filename: Option

, flags: raw::c_int) -> Result + where P: AsRef { + let filename = match filename { + None => None, + Some(ref f) => Some(cstr_cow_from_bytes(f.as_ref().as_bytes())?), + }; + with_dlerror(|desc| crate::Error::DlOpen { desc }, move || { + let result = dlopen(match filename { + None => ptr::null(), + Some(ref f) => f.as_ptr() + }, flags); + // ensure filename lives until dlopen completes + drop(filename); + if result.is_null() { + None + } else { + Some(Library { + handle: result + }) + } + }).map_err(|e| e.unwrap_or(crate::Error::DlOpenUnknown)) + } + + unsafe fn get_impl(&self, symbol: &[u8], on_null: F) -> Result, crate::Error> + where F: FnOnce() -> Result, crate::Error> + { + ensure_compatible_types::()?; + let symbol = cstr_cow_from_bytes(symbol)?; + // `dlsym` may return nullptr in two cases: when a symbol genuinely points to a null + // pointer or the symbol cannot be found. In order to detect this case a double dlerror + // pattern must be used, which is, sadly, a little bit racy. + // + // We try to leave as little space as possible for this to occur, but we can’t exactly + // fully prevent it. + match with_dlerror(|desc| crate::Error::DlSym { desc }, || { + dlerror(); + let symbol = dlsym(self.handle, symbol.as_ptr()); + if symbol.is_null() { + None + } else { + Some(Symbol { + pointer: symbol, + pd: marker::PhantomData + }) + } + }) { + Err(None) => on_null(), + Err(Some(e)) => Err(e), + Ok(x) => Ok(x) + } + + } + + /// Get a pointer to function or static variable by symbol name. + /// + /// The `symbol` may not contain any null bytes, with an exception of last byte. Providing a + /// null terminated `symbol` may help to avoid an allocation. + /// + /// Symbol is interpreted as-is; no mangling is done. This means that symbols like `x::y` are + /// most likely invalid. + /// + /// # Safety + /// + /// Users of this API must specify the correct type of the function or variable loaded. Using a + /// `Symbol` with a wrong type is undefined. + /// + /// # Platform-specific behaviour + /// + /// Implementation of thread local variables is extremely platform specific and uses of such + /// variables that work on e.g. Linux may have unintended behaviour on other targets. + /// + /// On POSIX implementations where the `dlerror` function is not confirmed to be MT-safe (such + /// as FreeBSD), this function will unconditionally return an error when the underlying `dlsym` + /// call returns a null pointer. There are rare situations where `dlsym` returns a genuine null + /// pointer without it being an error. If loading a null pointer is something you care about, + /// consider using the [`Library::get_singlethreaded`] call. + #[inline(always)] + pub unsafe fn get(&self, symbol: &[u8]) -> Result, crate::Error> { + extern crate cfg_if; + cfg_if::cfg_if! { + // These targets are known to have MT-safe `dlerror`. + if #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "openbsd", + target_os = "macos", + target_os = "ios", + target_os = "solaris", + target_os = "illumos", + target_os = "redox", + target_os = "fuchsia" + ))] { + self.get_singlethreaded(symbol) + } else { + self.get_impl(symbol, || Err(crate::Error::DlSymUnknown)) + } + } + } + + /// Get a pointer to function or static variable by symbol name. + /// + /// The `symbol` may not contain any null bytes, with an exception of last byte. Providing a + /// null terminated `symbol` may help to avoid an allocation. + /// + /// Symbol is interpreted as-is; no mangling is done. This means that symbols like `x::y` are + /// most likely invalid. + /// + /// # Safety + /// + /// Users of this API must specify the correct type of the function or variable loaded. Using a + /// `Symbol` with a wrong type is undefined. + /// + /// It is up to the user of this library to ensure that no other calls to an MT-unsafe + /// implementation of `dlerror` occur during execution of this function. Failing that, the + /// behaviour of this function is not defined. + /// + /// # Platform-specific behaviour + /// + /// Implementation of thread local variables is extremely platform specific and uses of such + /// variables that work on e.g. Linux may have unintended behaviour on other targets. + #[inline(always)] + pub unsafe fn get_singlethreaded(&self, symbol: &[u8]) -> Result, crate::Error> { + self.get_impl(symbol, || Ok(Symbol { + pointer: ptr::null_mut(), + pd: marker::PhantomData + })) + } + + /// Convert the `Library` to a raw handle. + /// + /// The handle returned by this function shall be usable with APIs which accept handles + /// as returned by `dlopen`. + pub fn into_raw(self) -> *mut raw::c_void { + let handle = self.handle; + mem::forget(self); + handle + } + + /// Convert a raw handle returned by `dlopen`-family of calls to a `Library`. + /// + /// # Safety + /// + /// The pointer shall be a result of a successful call of the `dlopen`-family of functions or a + /// pointer previously returned by `Library::into_raw` call. It must be valid to call `dlclose` + /// with this pointer as an argument. + pub unsafe fn from_raw(handle: *mut raw::c_void) -> Library { + Library { + handle + } + } + + /// Unload the library. + /// + /// This method might be a no-op, depending on the flags with which the `Library` was opened, + /// what library was opened or other platform specifics. + /// + /// You only need to call this if you are interested in handling any errors that may arise when + /// library is unloaded. Otherwise the implementation of `Drop` for `Library` will close the + /// library and ignore the errors were they arise. + /// + /// The underlying data structures may still get leaked if an error does occur. + pub fn close(self) -> Result<(), crate::Error> { + let result = with_dlerror(|desc| crate::Error::DlClose { desc }, || { + if unsafe { dlclose(self.handle) } == 0 { + Some(()) + } else { + None + } + }).map_err(|e| e.unwrap_or(crate::Error::DlCloseUnknown)); + // While the library is not free'd yet in case of an error, there is no reason to try + // dropping it again, because all that will do is try calling `dlclose` again. only + // this time it would ignore the return result, which we already seen failing… + std::mem::forget(self); + result + } +} + +impl Drop for Library { + fn drop(&mut self) { + unsafe { + dlclose(self.handle); + } + } +} + +impl fmt::Debug for Library { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(&format!("Library@{:p}", self.handle)) + } +} + +/// Symbol from a library. +/// +/// A major difference compared to the cross-platform `Symbol` is that this does not ensure the +/// `Symbol` does not outlive `Library` it comes from. +pub struct Symbol { + pointer: *mut raw::c_void, + pd: marker::PhantomData +} + +impl Symbol { + /// Convert the loaded Symbol into a raw pointer. + pub fn into_raw(self) -> *mut raw::c_void { + let pointer = self.pointer; + mem::forget(self); + pointer + } +} + +impl Symbol> { + /// Lift Option out of the symbol. + pub fn lift_option(self) -> Option> { + if self.pointer.is_null() { + None + } else { + Some(Symbol { + pointer: self.pointer, + pd: marker::PhantomData, + }) + } + } +} + +unsafe impl Send for Symbol {} +unsafe impl Sync for Symbol {} + +impl Clone for Symbol { + fn clone(&self) -> Symbol { + Symbol { ..*self } + } +} + +impl ::std::ops::Deref for Symbol { + type Target = T; + fn deref(&self) -> &T { + unsafe { + // Additional reference level for a dereference on `deref` return value. + &*(&self.pointer as *const *mut _ as *const T) + } + } +} + +impl fmt::Debug for Symbol { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + unsafe { + let mut info = mem::MaybeUninit::::uninit(); + if dladdr(self.pointer, info.as_mut_ptr()) != 0 { + let info = info.assume_init(); + if info.dli_sname.is_null() { + f.write_str(&format!("Symbol@{:p} from {:?}", + self.pointer, + CStr::from_ptr(info.dli_fname))) + } else { + f.write_str(&format!("Symbol {:?}@{:p} from {:?}", + CStr::from_ptr(info.dli_sname), self.pointer, + CStr::from_ptr(info.dli_fname))) + } + } else { + f.write_str(&format!("Symbol@{:p}", self.pointer)) + } + } + } +} + +// Platform specific things +#[cfg_attr(any(target_os = "linux", target_os = "android"), link(name="dl"))] +#[cfg_attr(any(target_os = "freebsd", target_os = "dragonfly"), link(name="c"))] +extern { + fn dlopen(filename: *const raw::c_char, flags: raw::c_int) -> *mut raw::c_void; + fn dlclose(handle: *mut raw::c_void) -> raw::c_int; + fn dlsym(handle: *mut raw::c_void, symbol: *const raw::c_char) -> *mut raw::c_void; + fn dlerror() -> *mut raw::c_char; + fn dladdr(addr: *mut raw::c_void, info: *mut DlInfo) -> raw::c_int; +} + +#[repr(C)] +struct DlInfo { + dli_fname: *const raw::c_char, + dli_fbase: *mut raw::c_void, + dli_sname: *const raw::c_char, + dli_saddr: *mut raw::c_void +} diff --git a/third_party/cargo/vendor/libloading-0.7.0/src/os/windows/mod.rs b/third_party/cargo/vendor/libloading-0.7.0/src/os/windows/mod.rs new file mode 100644 index 0000000..7e28527 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/src/os/windows/mod.rs @@ -0,0 +1,536 @@ +// A hack for docs.rs to build documentation that has both windows and linux documentation in the +// same rustdoc build visible. +#[cfg(all(docsrs, not(windows)))] +mod windows_imports { + pub(super) enum WORD {} + pub(super) struct DWORD; + pub(super) enum HMODULE {} + pub(super) enum FARPROC {} + + pub(super) mod consts { + use super::DWORD; + pub(crate) const LOAD_IGNORE_CODE_AUTHZ_LEVEL: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_AS_DATAFILE: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_AS_IMAGE_RESOURCE: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_SEARCH_APPLICATION_DIR: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_SEARCH_DEFAULT_DIRS: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_SEARCH_SYSTEM32: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_SEARCH_USER_DIRS: DWORD = DWORD; + pub(crate) const LOAD_WITH_ALTERED_SEARCH_PATH: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_REQUIRE_SIGNED_TARGET: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_SAFE_CURRENT_DIRS: DWORD = DWORD; + } +} +#[cfg(any(not(docsrs), windows))] +mod windows_imports { + extern crate winapi; + pub(super) use self::winapi::shared::minwindef::{WORD, DWORD, HMODULE, FARPROC}; + pub(super) use self::winapi::shared::ntdef::WCHAR; + pub(super) use self::winapi::um::{errhandlingapi, libloaderapi}; + pub(super) use std::os::windows::ffi::{OsStrExt, OsStringExt}; + pub(super) const SEM_FAILCE: DWORD = 1; + + pub(super) mod consts { + pub(crate) use super::winapi::um::libloaderapi::{ + LOAD_IGNORE_CODE_AUTHZ_LEVEL, + LOAD_LIBRARY_AS_DATAFILE, + LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE, + LOAD_LIBRARY_AS_IMAGE_RESOURCE, + LOAD_LIBRARY_SEARCH_APPLICATION_DIR, + LOAD_LIBRARY_SEARCH_DEFAULT_DIRS, + LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR, + LOAD_LIBRARY_SEARCH_SYSTEM32, + LOAD_LIBRARY_SEARCH_USER_DIRS, + LOAD_WITH_ALTERED_SEARCH_PATH, + LOAD_LIBRARY_REQUIRE_SIGNED_TARGET, + LOAD_LIBRARY_SAFE_CURRENT_DIRS, + }; + } +} + +use self::windows_imports::*; +use util::{ensure_compatible_types, cstr_cow_from_bytes}; +use std::ffi::{OsStr, OsString}; +use std::{fmt, io, marker, mem, ptr}; + +/// A platform-specific counterpart of the cross-platform [`Library`](crate::Library). +pub struct Library(HMODULE); + +unsafe impl Send for Library {} +// Now, this is sort-of-tricky. MSDN documentation does not really make any claims as to safety of +// the Win32 APIs. Sadly, whomever I asked, even current and former Microsoft employees, couldn’t +// say for sure, whether the Win32 APIs used to implement `Library` are thread-safe or not. +// +// My investigation ended up with a question about thread-safety properties of the API involved +// being sent to an internal (to MS) general question mailing-list. The conclusion of the mail is +// as such: +// +// * Nobody inside MS (at least out of all the people who have seen the question) knows for +// sure either; +// * However, the general consensus between MS developers is that one can rely on the API being +// thread-safe. In case it is not thread-safe it should be considered a bug on the Windows +// part. (NB: bugs filled at https://connect.microsoft.com/ against Windows Server) +unsafe impl Sync for Library {} + +impl Library { + /// Find and load a module. + /// + /// If the `filename` specifies a full path, the function only searches that path for the + /// module. Otherwise, if the `filename` specifies a relative path or a module name without a + /// path, the function uses a windows-specific search strategy to find the module; for more + /// information, see the [Remarks on MSDN][msdn]. + /// + /// If the `filename` specifies a library filename without path and with extension omitted, + /// `.dll` extension is implicitly added. This behaviour may be suppressed by appending a + /// trailing `.` to the `filename`. + /// + /// This is equivalent to [Library::load_with_flags](filename, 0). + /// + /// [msdn]: https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryw#remarks + /// + /// # Safety + /// + /// When a library is loaded initialization routines contained within the library are executed. + /// For the purposes of safety, execution of these routines is conceptually the same calling an + /// unknown foreign function and may impose arbitrary requirements on the caller for the call + /// to be sound. + /// + /// Additionally, the callers of this function must also ensure that execution of the + /// termination routines contained within the library is safe as well. These routines may be + /// executed when the library is unloaded. + #[inline] + pub unsafe fn new>(filename: P) -> Result { + Library::load_with_flags(filename, 0) + } + + /// Get the `Library` representing the original program executable. + /// + /// Note that behaviour of `Library` loaded with this method is different from + /// Libraries loaded with [`os::unix::Library::this`]. For more information refer to [MSDN]. + /// + /// Corresponds to `GetModuleHandleExW(0, NULL, _)`. + /// + /// [`os::unix::Library::this`]: crate::os::unix::Library::this + /// [MSDN]: https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandleexw + pub fn this() -> Result { + unsafe { + let mut handle: HMODULE = std::ptr::null_mut(); + with_get_last_error(|source| crate::Error::GetModuleHandleExW { source }, || { + let result = libloaderapi::GetModuleHandleExW(0, std::ptr::null_mut(), &mut handle); + if result == 0 { + None + } else { + Some(Library(handle)) + } + }).map_err(|e| e.unwrap_or(crate::Error::GetModuleHandleExWUnknown)) + } + } + + /// Get a module that is already loaded by the program. + /// + /// This function returns a `Library` corresponding to a module with the given name that is + /// already mapped into the address space of the process. If the module isn't found an error is + /// returned. + /// + /// If the `filename` does not include a full path and there are multiple different loaded + /// modules corresponding to the `filename`, it is impossible to predict which module handle + /// will be returned. For more information refer to [MSDN]. + /// + /// If the `filename` specifies a library filename without path and with extension omitted, + /// `.dll` extension is implicitly added. This behaviour may be suppressed by appending a + /// trailing `.` to the `filename`. + /// + /// This is equivalent to `GetModuleHandleExW(0, filename, _)`. + /// + /// [MSDN]: https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandleexw + pub fn open_already_loaded>(filename: P) -> Result { + let wide_filename: Vec = filename.as_ref().encode_wide().chain(Some(0)).collect(); + + let ret = unsafe { + let mut handle: HMODULE = std::ptr::null_mut(); + with_get_last_error(|source| crate::Error::GetModuleHandleExW { source }, || { + // Make sure no winapi calls as a result of drop happen inside this closure, because + // otherwise that might change the return value of the GetLastError. + let result = libloaderapi::GetModuleHandleExW(0, wide_filename.as_ptr(), &mut handle); + if result == 0 { + None + } else { + Some(Library(handle)) + } + }).map_err(|e| e.unwrap_or(crate::Error::GetModuleHandleExWUnknown)) + }; + + drop(wide_filename); // Drop wide_filename here to ensure it doesn’t get moved and dropped + // inside the closure by mistake. See comment inside the closure. + ret + } + + /// Find and load a module, additionally adjusting behaviour with flags. + /// + /// See [`Library::new`] for documentation on handling of the `filename` argument. See the + /// [flag table on MSDN][flags] for information on applicable values for the `flags` argument. + /// + /// Corresponds to `LoadLibraryExW(filename, reserved: NULL, flags)`. + /// + /// [flags]: https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters + /// + /// # Safety + /// + /// When a library is loaded initialization routines contained within the library are executed. + /// For the purposes of safety, execution of these routines is conceptually the same calling an + /// unknown foreign function and may impose arbitrary requirements on the caller for the call + /// to be sound. + /// + /// Additionally, the callers of this function must also ensure that execution of the + /// termination routines contained within the library is safe as well. These routines may be + /// executed when the library is unloaded. + pub unsafe fn load_with_flags>(filename: P, flags: DWORD) -> Result { + let wide_filename: Vec = filename.as_ref().encode_wide().chain(Some(0)).collect(); + let _guard = ErrorModeGuard::new(); + + let ret = with_get_last_error(|source| crate::Error::LoadLibraryExW { source }, || { + // Make sure no winapi calls as a result of drop happen inside this closure, because + // otherwise that might change the return value of the GetLastError. + let handle = + libloaderapi::LoadLibraryExW(wide_filename.as_ptr(), std::ptr::null_mut(), flags); + if handle.is_null() { + None + } else { + Some(Library(handle)) + } + }).map_err(|e| e.unwrap_or(crate::Error::LoadLibraryExWUnknown)); + drop(wide_filename); // Drop wide_filename here to ensure it doesn’t get moved and dropped + // inside the closure by mistake. See comment inside the closure. + ret + } + + /// Get a pointer to function or static variable by symbol name. + /// + /// The `symbol` may not contain any null bytes, with an exception of last byte. A null + /// terminated `symbol` may avoid a string allocation in some cases. + /// + /// Symbol is interpreted as-is; no mangling is done. This means that symbols like `x::y` are + /// most likely invalid. + /// + /// # Safety + /// + /// Users of this API must specify the correct type of the function or variable loaded. Using a + /// `Symbol` with a wrong type is undefined. + pub unsafe fn get(&self, symbol: &[u8]) -> Result, crate::Error> { + ensure_compatible_types::()?; + let symbol = cstr_cow_from_bytes(symbol)?; + with_get_last_error(|source| crate::Error::GetProcAddress { source }, || { + let symbol = libloaderapi::GetProcAddress(self.0, symbol.as_ptr()); + if symbol.is_null() { + None + } else { + Some(Symbol { + pointer: symbol, + pd: marker::PhantomData + }) + } + }).map_err(|e| e.unwrap_or(crate::Error::GetProcAddressUnknown)) + } + + /// Get a pointer to function or static variable by ordinal number. + /// + /// # Safety + /// + /// Users of this API must specify the correct type of the function or variable loaded. Using a + /// `Symbol` with a wrong type is undefined. + pub unsafe fn get_ordinal(&self, ordinal: WORD) -> Result, crate::Error> { + ensure_compatible_types::()?; + with_get_last_error(|source| crate::Error::GetProcAddress { source }, || { + let ordinal = ordinal as usize as *mut _; + let symbol = libloaderapi::GetProcAddress(self.0, ordinal); + if symbol.is_null() { + None + } else { + Some(Symbol { + pointer: symbol, + pd: marker::PhantomData + }) + } + }).map_err(|e| e.unwrap_or(crate::Error::GetProcAddressUnknown)) + } + + /// Convert the `Library` to a raw handle. + pub fn into_raw(self) -> HMODULE { + let handle = self.0; + mem::forget(self); + handle + } + + /// Convert a raw handle to a `Library`. + /// + /// # Safety + /// + /// The handle shall be a result of a successful call of `LoadLibraryA`, `LoadLibraryW`, + /// `LoadLibraryExW`, `LoadLibraryExA` or a handle previously returned by the + /// `Library::into_raw` call. + pub unsafe fn from_raw(handle: HMODULE) -> Library { + Library(handle) + } + + /// Unload the library. + /// + /// You only need to call this if you are interested in handling any errors that may arise when + /// library is unloaded. Otherwise this will be done when `Library` is dropped. + /// + /// The underlying data structures may still get leaked if an error does occur. + pub fn close(self) -> Result<(), crate::Error> { + let result = with_get_last_error(|source| crate::Error::FreeLibrary { source }, || { + if unsafe { libloaderapi::FreeLibrary(self.0) == 0 } { + None + } else { + Some(()) + } + }).map_err(|e| e.unwrap_or(crate::Error::FreeLibraryUnknown)); + // While the library is not free'd yet in case of an error, there is no reason to try + // dropping it again, because all that will do is try calling `FreeLibrary` again. only + // this time it would ignore the return result, which we already seen failing… + std::mem::forget(self); + result + } +} + +impl Drop for Library { + fn drop(&mut self) { + unsafe { libloaderapi::FreeLibrary(self.0); } + } +} + +impl fmt::Debug for Library { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + unsafe { + // FIXME: use Maybeuninit::uninit_array when stable + let mut buf = + mem::MaybeUninit::<[mem::MaybeUninit::; 1024]>::uninit().assume_init(); + let len = libloaderapi::GetModuleFileNameW(self.0, + (&mut buf[..]).as_mut_ptr().cast(), 1024) as usize; + if len == 0 { + f.write_str(&format!("Library@{:p}", self.0)) + } else { + let string: OsString = OsString::from_wide( + // FIXME: use Maybeuninit::slice_get_ref when stable + &*(&buf[..len] as *const [_] as *const [WCHAR]) + ); + f.write_str(&format!("Library@{:p} from {:?}", self.0, string)) + } + } + } +} + +/// Symbol from a library. +/// +/// A major difference compared to the cross-platform `Symbol` is that this does not ensure the +/// `Symbol` does not outlive `Library` it comes from. +pub struct Symbol { + pointer: FARPROC, + pd: marker::PhantomData +} + +impl Symbol { + /// Convert the loaded Symbol into a handle. + pub fn into_raw(self) -> FARPROC { + let pointer = self.pointer; + mem::forget(self); + pointer + } +} + +impl Symbol> { + /// Lift Option out of the symbol. + pub fn lift_option(self) -> Option> { + if self.pointer.is_null() { + None + } else { + Some(Symbol { + pointer: self.pointer, + pd: marker::PhantomData, + }) + } + } +} + +unsafe impl Send for Symbol {} +unsafe impl Sync for Symbol {} + +impl Clone for Symbol { + fn clone(&self) -> Symbol { + Symbol { ..*self } + } +} + +impl ::std::ops::Deref for Symbol { + type Target = T; + fn deref(&self) -> &T { + unsafe { + // Additional reference level for a dereference on `deref` return value. + &*(&self.pointer as *const *mut _ as *const T) + } + } +} + +impl fmt::Debug for Symbol { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(&format!("Symbol@{:p}", self.pointer)) + } +} + +struct ErrorModeGuard(DWORD); + +impl ErrorModeGuard { + #[allow(clippy::if_same_then_else)] + fn new() -> Option { + unsafe { + let mut previous_mode = 0; + if errhandlingapi::SetThreadErrorMode(SEM_FAILCE, &mut previous_mode) == 0 { + // How in the world is it possible for what is essentially a simple variable swap + // to fail? For now we just ignore the error -- the worst that can happen here is + // the previous mode staying on and user seeing a dialog error on older Windows + // machines. + None + } else if previous_mode == SEM_FAILCE { + None + } else { + Some(ErrorModeGuard(previous_mode)) + } + } + } +} + +impl Drop for ErrorModeGuard { + fn drop(&mut self) { + unsafe { + errhandlingapi::SetThreadErrorMode(self.0, ptr::null_mut()); + } + } +} + +fn with_get_last_error(wrap: fn(crate::error::WindowsError) -> crate::Error, closure: F) +-> Result> +where F: FnOnce() -> Option { + closure().ok_or_else(|| { + let error = unsafe { errhandlingapi::GetLastError() }; + if error == 0 { + None + } else { + Some(wrap(crate::error::WindowsError(io::Error::from_raw_os_error(error as i32)))) + } + }) +} + +/// Do not check AppLocker rules or apply Software Restriction Policies for the DLL. +/// +/// This action applies only to the DLL being loaded and not to its dependencies. This value is +/// recommended for use in setup programs that must run extracted DLLs during installation. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_IGNORE_CODE_AUTHZ_LEVEL: DWORD = consts::LOAD_IGNORE_CODE_AUTHZ_LEVEL; + +/// Map the file into the calling process’ virtual address space as if it were a data file. +/// +/// Nothing is done to execute or prepare to execute the mapped file. Therefore, you cannot call +/// functions like [`Library::get`] with this DLL. Using this value causes writes to read-only +/// memory to raise an access violation. Use this flag when you want to load a DLL only to extract +/// messages or resources from it. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_AS_DATAFILE: DWORD = consts::LOAD_LIBRARY_AS_DATAFILE; + +/// Map the file into the calling process’ virtual address space as if it were a data file. +/// +/// Similar to [`LOAD_LIBRARY_AS_DATAFILE`], except that the DLL file is opened with exclusive +/// write access for the calling process. Other processes cannot open the DLL file for write access +/// while it is in use. However, the DLL can still be opened by other processes. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE: DWORD = consts::LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE; + +/// Map the file into the process’ virtual address space as an image file. +/// +/// The loader does not load the static imports or perform the other usual initialization steps. +/// Use this flag when you want to load a DLL only to extract messages or resources from it. +/// +/// Unless the application depends on the file having the in-memory layout of an image, this value +/// should be used with either [`LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE`] or +/// [`LOAD_LIBRARY_AS_DATAFILE`]. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_AS_IMAGE_RESOURCE: DWORD = consts::LOAD_LIBRARY_AS_IMAGE_RESOURCE; + +/// Search application's installation directory for the DLL and its dependencies. +/// +/// Directories in the standard search path are not searched. This value cannot be combined with +/// [`LOAD_WITH_ALTERED_SEARCH_PATH`]. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_SEARCH_APPLICATION_DIR: DWORD = consts::LOAD_LIBRARY_SEARCH_APPLICATION_DIR; + +/// Search default directories when looking for the DLL and its dependencies. +/// +/// This value is a combination of [`LOAD_LIBRARY_SEARCH_APPLICATION_DIR`], +/// [`LOAD_LIBRARY_SEARCH_SYSTEM32`], and [`LOAD_LIBRARY_SEARCH_USER_DIRS`]. Directories in the +/// standard search path are not searched. This value cannot be combined with +/// [`LOAD_WITH_ALTERED_SEARCH_PATH`]. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_SEARCH_DEFAULT_DIRS: DWORD = consts::LOAD_LIBRARY_SEARCH_DEFAULT_DIRS; + +/// Directory that contains the DLL is temporarily added to the beginning of the list of +/// directories that are searched for the DLL’s dependencies. +/// +/// Directories in the standard search path are not searched. +/// +/// The `filename` parameter must specify a fully qualified path. This value cannot be combined +/// with [`LOAD_WITH_ALTERED_SEARCH_PATH`]. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR: DWORD = consts::LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR; + +/// Search `%windows%\system32` for the DLL and its dependencies. +/// +/// Directories in the standard search path are not searched. This value cannot be combined with +/// [`LOAD_WITH_ALTERED_SEARCH_PATH`]. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_SEARCH_SYSTEM32: DWORD = consts::LOAD_LIBRARY_SEARCH_SYSTEM32; + +/// Directories added using the `AddDllDirectory` or the `SetDllDirectory` function are searched +/// for the DLL and its dependencies. +/// +/// If more than one directory has been added, the order in which the directories are searched is +/// unspecified. Directories in the standard search path are not searched. This value cannot be +/// combined with [`LOAD_WITH_ALTERED_SEARCH_PATH`]. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_SEARCH_USER_DIRS: DWORD = consts::LOAD_LIBRARY_SEARCH_USER_DIRS; + +/// If `filename specifies an absolute path, the system uses the alternate file search strategy +/// discussed in the [Remarks section] to find associated executable modules that the specified +/// module causes to be loaded. +/// +/// If this value is used and `filename` specifies a relative path, the behavior is undefined. +/// +/// If this value is not used, or if `filename` does not specify a path, the system uses the +/// standard search strategy discussed in the [Remarks section] to find associated executable +/// modules that the specified module causes to be loaded. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +/// +/// [Remarks]: https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#remarks +pub const LOAD_WITH_ALTERED_SEARCH_PATH: DWORD = consts::LOAD_WITH_ALTERED_SEARCH_PATH; + +/// Specifies that the digital signature of the binary image must be checked at load time. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_REQUIRE_SIGNED_TARGET: DWORD = consts::LOAD_LIBRARY_REQUIRE_SIGNED_TARGET; + +/// Allow loading a DLL for execution from the current directory only if it is under a directory in +/// the Safe load list. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_SAFE_CURRENT_DIRS: DWORD = consts::LOAD_LIBRARY_SAFE_CURRENT_DIRS; diff --git a/third_party/cargo/vendor/libloading-0.7.0/src/test_helpers.rs b/third_party/cargo/vendor/libloading-0.7.0/src/test_helpers.rs new file mode 100644 index 0000000..9e3e992 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/src/test_helpers.rs @@ -0,0 +1,37 @@ +//! This is a separate file containing helpers for tests of this library. It is built into a +//! dynamic library by the build.rs script. +#![crate_type="cdylib"] + +#[no_mangle] +pub static mut TEST_STATIC_U32: u32 = 0; + +#[no_mangle] +pub static mut TEST_STATIC_PTR: *mut () = 0 as *mut _; + +#[no_mangle] +pub extern "C" fn test_identity_u32(x: u32) -> u32 { + x +} + +#[repr(C)] +pub struct S { + a: u64, + b: u32, + c: u16, + d: u8 +} + +#[no_mangle] +pub extern "C" fn test_identity_struct(x: S) -> S { + x +} + +#[no_mangle] +pub unsafe extern "C" fn test_get_static_u32() -> u32 { + TEST_STATIC_U32 +} + +#[no_mangle] +pub unsafe extern "C" fn test_check_static_ptr() -> bool { + TEST_STATIC_PTR == (&mut TEST_STATIC_PTR as *mut *mut _ as *mut _) +} diff --git a/third_party/cargo/vendor/libloading-0.7.0/src/util.rs b/third_party/cargo/vendor/libloading-0.7.0/src/util.rs new file mode 100644 index 0000000..880b689 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/src/util.rs @@ -0,0 +1,31 @@ +use std::ffi::{CStr, CString}; +use std::borrow::Cow; +use std::os::raw; + +use crate::Error; + +/// Checks for last byte and avoids allocating if it is zero. +/// +/// Non-last null bytes still result in an error. +pub(crate) fn cstr_cow_from_bytes(slice: &[u8]) -> Result, Error> { + static ZERO: raw::c_char = 0; + Ok(match slice.last() { + // Slice out of 0 elements + None => unsafe { Cow::Borrowed(CStr::from_ptr(&ZERO)) }, + // Slice with trailing 0 + Some(&0) => Cow::Borrowed(CStr::from_bytes_with_nul(slice) + .map_err(|source| Error::CreateCStringWithTrailing { source })?), + // Slice with no trailing 0 + Some(_) => Cow::Owned(CString::new(slice) + .map_err(|source| Error::CreateCString { source })?), + }) +} + +#[inline] +pub(crate) fn ensure_compatible_types() -> Result<(), Error> { + if ::std::mem::size_of::() != ::std::mem::size_of::() { + Err(Error::IncompatibleSize) + } else { + Ok(()) + } +} diff --git a/third_party/cargo/vendor/libloading-0.7.0/tests/constants.rs b/third_party/cargo/vendor/libloading-0.7.0/tests/constants.rs new file mode 100644 index 0000000..ad910c4 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/tests/constants.rs @@ -0,0 +1,13 @@ +extern crate libloading; +extern crate libc; +extern crate static_assertions; + +#[cfg(all(test, unix))] +mod unix { + use super::static_assertions::const_assert_eq; + + const_assert_eq!(libloading::os::unix::RTLD_LOCAL, libc::RTLD_LOCAL); + const_assert_eq!(libloading::os::unix::RTLD_GLOBAL, libc::RTLD_GLOBAL); + const_assert_eq!(libloading::os::unix::RTLD_NOW, libc::RTLD_NOW); + const_assert_eq!(libloading::os::unix::RTLD_LAZY, libc::RTLD_LAZY); +} diff --git a/third_party/cargo/vendor/libloading-0.7.0/tests/functions.rs b/third_party/cargo/vendor/libloading-0.7.0/tests/functions.rs new file mode 100644 index 0000000..eef41e6 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/tests/functions.rs @@ -0,0 +1,256 @@ +#[cfg(windows)] +extern crate winapi; + +extern crate libloading; +use libloading::{Symbol, Library}; + +const LIBPATH: &'static str = "target/libtest_helpers.module"; + +fn make_helpers() { + static ONCE: ::std::sync::Once = ::std::sync::Once::new(); + ONCE.call_once(|| { + let rustc = std::env::var_os("RUSTC").unwrap_or_else(|| { "rustc".into() }); + let mut cmd = ::std::process::Command::new(rustc); + cmd + .arg("src/test_helpers.rs") + .arg("-o") + .arg(LIBPATH); + if let Some(target) = std::env::var_os("TARGET") { + cmd.arg("--target").arg(target); + } else { + eprintln!("WARNING: $TARGET NOT SPECIFIED! BUILDING HELPER MODULE FOR NATIVE TARGET."); + } + assert!(cmd + .status() + .expect("could not compile the test helpers!") + .success() + ); + }); +} + +#[test] +fn test_id_u32() { + make_helpers(); + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + let f: Symbol u32> = lib.get(b"test_identity_u32\0").unwrap(); + assert_eq!(42, f(42)); + } +} + +#[repr(C)] +#[derive(Clone,Copy,PartialEq,Debug)] +struct S { + a: u64, + b: u32, + c: u16, + d: u8 +} + +#[test] +fn test_id_struct() { + make_helpers(); + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + let f: Symbol S> = lib.get(b"test_identity_struct\0").unwrap(); + assert_eq!(S { a: 1, b: 2, c: 3, d: 4 }, f(S { a: 1, b: 2, c: 3, d: 4 })); + } +} + +#[test] +fn test_0_no_0() { + make_helpers(); + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + let f: Symbol S> = lib.get(b"test_identity_struct\0").unwrap(); + let f2: Symbol S> = lib.get(b"test_identity_struct").unwrap(); + assert_eq!(*f, *f2); + } +} + +#[test] +fn wrong_name_fails() { + unsafe { + Library::new("target/this_location_is_definitely_non existent:^~").err().unwrap(); + } +} + +#[test] +fn missing_symbol_fails() { + make_helpers(); + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + lib.get::<*mut ()>(b"test_does_not_exist").err().unwrap(); + lib.get::<*mut ()>(b"test_does_not_exist\0").err().unwrap(); + } +} + +#[test] +fn interior_null_fails() { + make_helpers(); + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + lib.get::<*mut ()>(b"test_does\0_not_exist").err().unwrap(); + lib.get::<*mut ()>(b"test\0_does_not_exist\0").err().unwrap(); + } +} + +#[test] +fn test_incompatible_type() { + make_helpers(); + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + assert!(match lib.get::<()>(b"test_identity_u32\0") { + Err(libloading::Error::IncompatibleSize) => true, + _ => false, + }) + } +} + +#[test] +fn test_incompatible_type_named_fn() { + make_helpers(); + unsafe fn get<'a, T>(l: &'a Library, _: T) -> Result, libloading::Error> { + l.get::(b"test_identity_u32\0") + } + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + assert!(match get(&lib, test_incompatible_type_named_fn) { + Err(libloading::Error::IncompatibleSize) => true, + _ => false, + }) + } +} + +#[test] +fn test_static_u32() { + make_helpers(); + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + let var: Symbol<*mut u32> = lib.get(b"TEST_STATIC_U32\0").unwrap(); + **var = 42; + let help: Symbol u32> = lib.get(b"test_get_static_u32\0").unwrap(); + assert_eq!(42, help()); + } +} + +#[test] +fn test_static_ptr() { + make_helpers(); + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + let var: Symbol<*mut *mut ()> = lib.get(b"TEST_STATIC_PTR\0").unwrap(); + **var = *var as *mut _; + let works: Symbol bool> = + lib.get(b"test_check_static_ptr\0").unwrap(); + assert!(works()); + } +} + +#[test] +// Something about i686-pc-windows-gnu, makes dll initialization code call abort when it is loaded +// and unloaded many times. So far it seems like an issue with mingw, not libloading, so ignoring +// the target. Especially since it is very unlikely to be fixed given the state of support its +// support. +#[cfg(not(all(target_arch="x86", target_os="windows", target_env="gnu")))] +fn manual_close_many_times() { + make_helpers(); + let join_handles: Vec<_> = (0..16).map(|_| { + std::thread::spawn(|| unsafe { + for _ in 0..10000 { + let lib = Library::new(LIBPATH).expect("open library"); + let _: Symbol u32> = + lib.get(b"test_identity_u32").expect("get fn"); + lib.close().expect("close is successful"); + } + }) + }).collect(); + for handle in join_handles { + handle.join().expect("thread should succeed"); + } +} + + +#[cfg(unix)] +#[test] +fn library_this_get() { + use libloading::os::unix::Library; + make_helpers(); + // SAFE: functions are never called + unsafe { + let _lib = Library::new(LIBPATH).unwrap(); + let this = Library::this(); + // Library we loaded in `_lib` (should be RTLD_LOCAL). + assert!(this.get::(b"test_identity_u32").is_err()); + // Something obscure from libc... + assert!(this.get::(b"freopen").is_ok()); + } +} + +#[cfg(windows)] +#[test] +fn library_this() { + use libloading::os::windows::Library; + make_helpers(); + unsafe { + // SAFE: well-known library without initializers is loaded. + let _lib = Library::new(LIBPATH).unwrap(); + let this = Library::this().expect("this library"); + // SAFE: functions are never called. + // Library we loaded in `_lib`. + assert!(this.get::(b"test_identity_u32").is_err()); + // Something "obscure" from kernel32... + assert!(this.get::(b"GetLastError").is_err()); + } +} + +#[cfg(windows)] +#[test] +fn works_getlasterror() { + use winapi::um::errhandlingapi; + use winapi::shared::minwindef::DWORD; + use libloading::os::windows::{Library, Symbol}; + + unsafe { + let lib = Library::new("kernel32.dll").unwrap(); + let gle: Symbol DWORD> = lib.get(b"GetLastError").unwrap(); + errhandlingapi::SetLastError(42); + assert_eq!(errhandlingapi::GetLastError(), gle()) + } +} + +#[cfg(windows)] +#[test] +fn works_getlasterror0() { + use winapi::um::errhandlingapi; + use winapi::shared::minwindef::DWORD; + use libloading::os::windows::{Library, Symbol}; + + unsafe { + let lib = Library::new("kernel32.dll").unwrap(); + let gle: Symbol DWORD> = lib.get(b"GetLastError\0").unwrap(); + errhandlingapi::SetLastError(42); + assert_eq!(errhandlingapi::GetLastError(), gle()) + } +} + +#[cfg(windows)] +#[test] +fn library_open_already_loaded() { + use libloading::os::windows::Library; + + // Present on Windows systems and NOT used by any other tests to prevent races. + const LIBPATH: &str = "Msftedit.dll"; + + // Not loaded yet. + assert!(match Library::open_already_loaded(LIBPATH) { + Err(libloading::Error::GetModuleHandleExW { .. }) => true, + _ => false, + }); + + unsafe { + let _lib = Library::new(LIBPATH).unwrap(); + // Loaded now. + assert!(Library::open_already_loaded(LIBPATH).is_ok()); + } +} diff --git a/third_party/cargo/vendor/libloading-0.7.0/tests/library_filename.rs b/third_party/cargo/vendor/libloading-0.7.0/tests/library_filename.rs new file mode 100644 index 0000000..efe51b8 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/tests/library_filename.rs @@ -0,0 +1,17 @@ +extern crate libloading; +use libloading::library_filename; +use std::path::Path; + +#[cfg(target_os = "windows")] +const EXPECTED: &str = "audioengine.dll"; +#[cfg(target_os = "linux")] +const EXPECTED: &str = "libaudioengine.so"; +#[cfg(target_os = "macos")] +const EXPECTED: &str = "libaudioengine.dylib"; + +#[test] +fn test_library_filename() { + let name = "audioengine"; + let resolved = library_filename(name); + assert!(Path::new(&resolved).ends_with(EXPECTED)); +} diff --git a/third_party/cargo/vendor/libloading-0.7.0/tests/markers.rs b/third_party/cargo/vendor/libloading-0.7.0/tests/markers.rs new file mode 100644 index 0000000..330c034 --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/tests/markers.rs @@ -0,0 +1,96 @@ +extern crate libloading; + +#[cfg(test)] +fn assert_send() {} +#[cfg(test)] +fn assert_sync() {} +#[cfg(test)] +fn assert_display() {} + +#[test] +fn check_error_send() { + assert_send::(); +} + +#[test] +fn check_error_sync() { + assert_sync::(); +} + +#[test] +fn check_error_display() { + assert_display::(); +} + +#[test] +fn check_library_send() { + assert_send::(); +} + +#[cfg(unix)] +#[test] +fn check_unix_library_send() { + assert_send::(); +} + +#[cfg(windows)] +#[test] +fn check_windows_library_send() { + assert_send::(); +} + +#[test] +fn check_library_sync() { + assert_sync::(); +} + +#[cfg(unix)] +#[test] +fn check_unix_library_sync() { + assert_sync::(); +} + +#[cfg(windows)] +#[test] +fn check_windows_library_sync() { + assert_sync::(); +} + +#[test] +fn check_symbol_send() { + assert_send:: ()>>(); + // assert_not_send::>(); +} + +#[cfg(unix)] +#[test] +fn check_unix_symbol_send() { + assert_send:: ()>>(); + // assert_not_send::>(); +} + +#[cfg(windows)] +#[test] +fn check_windows_symbol_send() { + assert_send:: ()>>(); +} + +#[test] +fn check_symbol_sync() { + assert_sync:: ()>>(); + // assert_not_sync::>(); +} + +#[cfg(unix)] +#[test] +fn check_unix_symbol_sync() { + assert_sync:: ()>>(); + // assert_not_sync::>(); +} + +#[cfg(windows)] +#[test] +fn check_windows_symbol_sync() { + assert_sync:: ()>>(); + // assert_not_sync::>(); +} diff --git a/third_party/cargo/vendor/libloading-0.7.0/tests/nagisa32.dll b/third_party/cargo/vendor/libloading-0.7.0/tests/nagisa32.dll new file mode 100644 index 0000000000000000000000000000000000000000..0a6218ade9c051e3ebc34c5ad4a687c44263fb33 GIT binary patch literal 3072 zcmeHHK}!Nr5S}%SvJ?*;gP!1dkvw@@qM(D3SrG+`uI{1>`ZiX@@-GC{wf|utoun>Z z`~?#91G;qUW;1X1gooe83O zpTP0eTOZPp(4TOX8EE>WxV7`%cF^ApCm=O6hBZrQHHIby5@WevKwiOE+AhX9v^*MV zQIR}wqiQ#e%%*DA>(H^e>2#XJBQS?_OK4cC!3D>JUV+prhB4`@YI(v$y_6^xdY0;T ryJoqHG2U6BSyI1<3NZZy%5Basr#}{)_$w2@f07hGjQ>-B|2Kh8N)2p9 literal 0 HcmV?d00001 diff --git a/third_party/cargo/vendor/libloading-0.7.0/tests/nagisa64.dll b/third_party/cargo/vendor/libloading-0.7.0/tests/nagisa64.dll new file mode 100644 index 0000000000000000000000000000000000000000..bacaa4b969411958776c0aad5a848114b1b7bf51 GIT binary patch literal 2560 zcmeHH&r1SP5FRzd3dLiGz-R1v35>v-2LlgAVnP&%ySkza`Zm^;%2TJnLqD$l9|qDX z@X{gw0_lIKTb*p??LJxvLXU>S&dkpDzW10n?0yHQ_YeYr74+#8V2GJ4BjVqIxUs}j z3vQCreGU!_I80Ve4&H(>b>sR;@F;%bCep_V9?cEu*eRqw9)y^hY@L_GpxE zrBBi)cLS^^>9UtAA{WhClQ^=Y!ajg;9fH*7!?DEPVVi9PV*o)!=t5}mI0f-~6%YUh zTwfK?PZk&U_5?vgs=G<1-?fV{29Wd4nkgZFYbN4sB-N>3I7k)qq?UbmmnSd)O|=c( z(E(lvL_qN55C}ud;G?=UcRo7^(s>bdpJf1^edY3XfhUl=34bL3Mz5ab`&nhPUsB?^ zeqMt~bn%zPGCy ztrnb{+_26&grgycbV_KJ(&hqVt{h2yVpx-&s&!Y0s27cDp0JO0T8z5#EZZ?*sc literal 0 HcmV?d00001 diff --git a/third_party/cargo/vendor/libloading-0.7.0/tests/windows.rs b/third_party/cargo/vendor/libloading-0.7.0/tests/windows.rs new file mode 100644 index 0000000..b4aad4a --- /dev/null +++ b/third_party/cargo/vendor/libloading-0.7.0/tests/windows.rs @@ -0,0 +1,64 @@ +#![cfg(windows)] +extern crate libloading; +use libloading::os::windows::*; +use std::ffi::CStr; + +// The ordinal DLL contains exactly one function (other than DllMain, that is) with ordinal number +// 1. This function has the sugnature `fn() -> *const c_char` and returns a string "bunny\0" (in +// reference to WindowsBunny). +// +// Both x86_64 and x86 versions of the .dll are functionally the same. Ideally we would compile the +// dlls with well known ordinals from our own testing helpers library, but rustc does not allow +// specifying a custom .def file (https://github.com/rust-lang/rust/issues/35089) +// +// The DLLs were kindly compiled by WindowsBunny (aka. @retep998). + +#[cfg(target_arch="x86")] +fn load_ordinal_lib() -> Library { + unsafe { + Library::new("tests/nagisa32.dll").expect("nagisa32.dll") + } +} + +#[cfg(target_arch="x86_64")] +fn load_ordinal_lib() -> Library { + unsafe { + Library::new("tests/nagisa64.dll").expect("nagisa64.dll") + } +} + +#[cfg(any(target_arch="x86", target_arch="x86_64"))] +#[test] +fn test_ordinal() { + let lib = load_ordinal_lib(); + unsafe { + let windows: Symbol *const i8> = lib.get_ordinal(1).expect("function"); + assert_eq!(CStr::from_ptr(windows()).to_bytes(), b"bunny"); + } +} + +#[cfg(any(target_arch="x86", target_arch="x86_64"))] +#[test] +fn test_ordinal_missing_fails() { + let lib = load_ordinal_lib(); + unsafe { + let r: Result *const i8>, _> = lib.get_ordinal(2); + r.err().unwrap(); + let r: Result *const i8>, _> = lib.get_ordinal(!0); + r.err().unwrap(); + } +} + +#[test] +fn test_new_kernel23() { + unsafe { + Library::new("kernel23").err().unwrap(); + } +} + +#[test] +fn test_new_kernel32_no_ext() { + unsafe { + Library::new("kernel32").unwrap(); + } +} diff --git a/third_party/cargo/vendor/lock_api-0.4.2/.cargo-checksum.json b/third_party/cargo/vendor/lock_api-0.4.2/.cargo-checksum.json deleted file mode 100644 index f22814f..0000000 --- a/third_party/cargo/vendor/lock_api-0.4.2/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"Cargo.toml":"0b7ec1020d4c5b58310956b970789207f7e257062d4045786773b4a34338161f","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5","src/lib.rs":"e30eee3009000171f340316683699e7a6bcbb63e241fc29f836acf3be5544fb7","src/mutex.rs":"db7f0dcb09fc5aaab2b04d6eac7b80b799da8fdb669fa43ddbb7007663760782","src/remutex.rs":"1049b5c824a1f2df4e0ed348fbe8a9d5697f9ad4779b174ad7a02610d23bcf7c","src/rwlock.rs":"6639e140c50ee81e212647e5a2596c0e247a0a062ee8471c79d268c1280c7330"},"package":"dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312"} \ No newline at end of file diff --git a/third_party/cargo/vendor/lock_api-0.4.3/.cargo-checksum.json b/third_party/cargo/vendor/lock_api-0.4.3/.cargo-checksum.json new file mode 100644 index 0000000..b8e13f1 --- /dev/null +++ b/third_party/cargo/vendor/lock_api-0.4.3/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"06563e3dc0450ad2719f696feca64c1d037d23a20bb488ee06748fac3a843513","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5","src/lib.rs":"e30eee3009000171f340316683699e7a6bcbb63e241fc29f836acf3be5544fb7","src/mutex.rs":"db7f0dcb09fc5aaab2b04d6eac7b80b799da8fdb669fa43ddbb7007663760782","src/remutex.rs":"83f6704348eb5052364c98aea2c5eaa621b22e3f4b03c4c130069496f7825595","src/rwlock.rs":"6639e140c50ee81e212647e5a2596c0e247a0a062ee8471c79d268c1280c7330"},"package":"5a3c91c24eae6777794bb1997ad98bbb87daf92890acab859f7eaa4320333176"} \ No newline at end of file diff --git a/third_party/cargo/vendor/lock_api-0.4.2/BUILD.bazel b/third_party/cargo/vendor/lock_api-0.4.3/BUILD.bazel similarity index 97% rename from third_party/cargo/vendor/lock_api-0.4.2/BUILD.bazel rename to third_party/cargo/vendor/lock_api-0.4.3/BUILD.bazel index 68f7f37..b4e7d38 100644 --- a/third_party/cargo/vendor/lock_api-0.4.2/BUILD.bazel +++ b/third_party/cargo/vendor/lock_api-0.4.3/BUILD.bazel @@ -46,7 +46,7 @@ rust_library( "cargo-raze", "manual", ], - version = "0.4.2", + version = "0.4.3", # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/scopeguard-1.1.0:scopeguard", diff --git a/third_party/cargo/vendor/lock_api-0.4.2/Cargo.toml b/third_party/cargo/vendor/lock_api-0.4.3/Cargo.toml similarity index 98% rename from third_party/cargo/vendor/lock_api-0.4.2/Cargo.toml rename to third_party/cargo/vendor/lock_api-0.4.3/Cargo.toml index cdc5b16..5f5c439 100644 --- a/third_party/cargo/vendor/lock_api-0.4.2/Cargo.toml +++ b/third_party/cargo/vendor/lock_api-0.4.3/Cargo.toml @@ -13,7 +13,7 @@ [package] edition = "2018" name = "lock_api" -version = "0.4.2" +version = "0.4.3" authors = ["Amanieu d'Antras "] description = "Wrappers to create fully-featured Mutex and RwLock types. Compatible with no_std." keywords = ["mutex", "rwlock", "lock", "no_std"] diff --git a/third_party/cargo/vendor/lock_api-0.4.2/LICENSE-APACHE b/third_party/cargo/vendor/lock_api-0.4.3/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/lock_api-0.4.2/LICENSE-APACHE rename to third_party/cargo/vendor/lock_api-0.4.3/LICENSE-APACHE diff --git a/third_party/cargo/vendor/lock_api-0.4.2/LICENSE-MIT b/third_party/cargo/vendor/lock_api-0.4.3/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/lock_api-0.4.2/LICENSE-MIT rename to third_party/cargo/vendor/lock_api-0.4.3/LICENSE-MIT diff --git a/third_party/cargo/vendor/lock_api-0.4.2/src/lib.rs b/third_party/cargo/vendor/lock_api-0.4.3/src/lib.rs similarity index 100% rename from third_party/cargo/vendor/lock_api-0.4.2/src/lib.rs rename to third_party/cargo/vendor/lock_api-0.4.3/src/lib.rs diff --git a/third_party/cargo/vendor/lock_api-0.4.2/src/mutex.rs b/third_party/cargo/vendor/lock_api-0.4.3/src/mutex.rs similarity index 100% rename from third_party/cargo/vendor/lock_api-0.4.2/src/mutex.rs rename to third_party/cargo/vendor/lock_api-0.4.3/src/mutex.rs diff --git a/third_party/cargo/vendor/lock_api-0.4.2/src/remutex.rs b/third_party/cargo/vendor/lock_api-0.4.3/src/remutex.rs similarity index 98% rename from third_party/cargo/vendor/lock_api-0.4.2/src/remutex.rs rename to third_party/cargo/vendor/lock_api-0.4.3/src/remutex.rs index 09833b0..b49ec6c 100644 --- a/third_party/cargo/vendor/lock_api-0.4.2/src/remutex.rs +++ b/third_party/cargo/vendor/lock_api-0.4.3/src/remutex.rs @@ -135,6 +135,13 @@ impl RawReentrantMutex { pub fn is_locked(&self) -> bool { self.mutex.is_locked() } + + /// Checks whether the mutex is currently held by the current thread. + #[inline] + pub fn is_owned_by_current_thread(&self) -> bool { + let id = self.get_thread_id.nonzero_thread_id().get(); + self.owner.load(Ordering::Relaxed) == id + } } impl RawReentrantMutex { @@ -333,6 +340,12 @@ impl ReentrantMutex { self.raw.is_locked() } + /// Checks whether the mutex is currently held by the current thread. + #[inline] + pub fn is_owned_by_current_thread(&self) -> bool { + self.raw.is_owned_by_current_thread() + } + /// Forcibly unlocks the mutex. /// /// This is useful when combined with `mem::forget` to hold a lock without diff --git a/third_party/cargo/vendor/lock_api-0.4.2/src/rwlock.rs b/third_party/cargo/vendor/lock_api-0.4.3/src/rwlock.rs similarity index 100% rename from third_party/cargo/vendor/lock_api-0.4.2/src/rwlock.rs rename to third_party/cargo/vendor/lock_api-0.4.3/src/rwlock.rs diff --git a/third_party/cargo/vendor/log-0.4.11/.cargo-checksum.json b/third_party/cargo/vendor/log-0.4.11/.cargo-checksum.json deleted file mode 100644 index abdd0c3..0000000 --- a/third_party/cargo/vendor/log-0.4.11/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"CHANGELOG.md":"6bfd384195d8e9c46af91ae2a1fdd1c591abd0c972ccd06458218dcde1203450","Cargo.toml":"469ba284ed309c18436265d65d1c7e457a3049c8f36d19b0fce656f12b01be6f","LICENSE-APACHE":"7cfd738c53d61c79f07e348f622bf7707c9084237054d37fbe07788a75f5881c","LICENSE-MIT":"705aaaaecefa087c187bd2eacdb01b8ac1c5ee95b1d5d04d8d7efe0363207df8","README.md":"ca758a44f4a226f21b3bc997d27a5356b5e77ee13a1daad24ee8bbbebb301c5d","build.rs":"dcfc572577b8e4284562d25e918911f4f9d74eb2c1cec6d07ee69930e3ee2dd5","src/kv/error.rs":"ba46a4bcac717e6dc58fc5101833c825d7b95777c1dd907be46c8fa573a27d2d","src/kv/key.rs":"d51bda7b2f044b88bcb7ae931832ac4ad41a9dd57c0cacd9194bda36515ee282","src/kv/mod.rs":"c52735bf5f0af0941f5ad33b27591eaaccfd37e95b5988b2c1286c4c7b37b4fb","src/kv/source.rs":"7d71d5986bedd9fe89fbf27ba32f4f7e26450147b44aa61cbc0a14bb4c97821e","src/kv/value/fill.rs":"36d278d8ce276106d15a2f1577284b17be63a9206997196a7b4fe40d853dfd24","src/kv/value/impls.rs":"32e0f5a71555b93537bd1ce478f60edc7c9f061769781f2d1e78d6bf7735645d","src/kv/value/internal/cast.rs":"8ba168778a20a5f94910e7921d4c5779dd45c0abdb78d57e25524e5a80368fca","src/kv/value/internal/fmt.rs":"7529e1969b077b0e1d1f54ed8ed393e51553404344202bccad52121f49616ee0","src/kv/value/internal/mod.rs":"a86190763dd30dedf6197b5f2c79f6ff607f6b540119cf7cef0d2a5c3796f2e5","src/kv/value/internal/sval.rs":"602770bb9dcdb67cd89495999079f66b814e5c489c626ab123ba3892e868b5c8","src/kv/value/mod.rs":"79bebb51f6a66a6e599e1c38938f9deb327d256e9d755ee95d79bdae03c117ea","src/kv/value/test.rs":"0d882f045fd5d989ac56ddb6a44ef12dae238452373c41578785af7da590f257","src/lib.rs":"1e54bf3628310b6a8543cedd3138e9bebe19a2798560dcacfab9027428e17a0c","src/macros.rs":"eeb0758b8d1d712d2e4d143612fe866c74c988c502d58bc4d4c86b25f4de2ca6","src/serde.rs":"4423fb062f6f63cf53c8161645feaef17154ce435bddd211b19b87c4ddd9e565","tests/filters.rs":"c31150132042e0263e9d26b4a7d56dad67dd449e54a5ed135a4432646e98ee2a","tests/macros.rs":"5b9cd4041b9e23ac06ba7ead57c60105c1e69bb55e0e3557b11994d865b6d438","triagebot.toml":"2d1d46d069bc4e3739069676707ca2801e0e0ba58a784a264392362ff9ac4a77"},"package":"4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"} \ No newline at end of file diff --git a/third_party/cargo/vendor/log-0.4.11/build.rs b/third_party/cargo/vendor/log-0.4.11/build.rs deleted file mode 100644 index 65d2398..0000000 --- a/third_party/cargo/vendor/log-0.4.11/build.rs +++ /dev/null @@ -1,14 +0,0 @@ -//! This build script detects target platforms that lack proper support for -//! atomics and sets `cfg` flags accordingly. - -use std::env; - -fn main() { - let target = env::var("TARGET").unwrap(); - - if !target.starts_with("thumbv6") { - println!("cargo:rustc-cfg=atomic_cas"); - } - - println!("cargo:rerun-if-changed=build.rs"); -} diff --git a/third_party/cargo/vendor/log-0.4.11/src/kv/source.rs b/third_party/cargo/vendor/log-0.4.11/src/kv/source.rs deleted file mode 100644 index eeac1ec..0000000 --- a/third_party/cargo/vendor/log-0.4.11/src/kv/source.rs +++ /dev/null @@ -1,393 +0,0 @@ -//! Sources for key-value pairs. - -use kv::{Error, Key, ToKey, ToValue, Value}; -use std::fmt; - -/// A source of key-value pairs. -/// -/// The source may be a single pair, a set of pairs, or a filter over a set of pairs. -/// Use the [`Visitor`](trait.Visitor.html) trait to inspect the structured data -/// in a source. -pub trait Source { - /// Visit key-value pairs. - /// - /// A source doesn't have to guarantee any ordering or uniqueness of key-value pairs. - /// If the given visitor returns an error then the source may early-return with it, - /// even if there are more key-value pairs. - /// - /// # Implementation notes - /// - /// A source should yield the same key-value pairs to a subsequent visitor unless - /// that visitor itself fails. - fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error>; - - /// Get the value for a given key. - /// - /// If the key appears multiple times in the source then which key is returned - /// is implementation specific. - /// - /// # Implementation notes - /// - /// A source that can provide a more efficient implementation of this method - /// should override it. - fn get<'v>(&'v self, key: Key) -> Option> { - struct Get<'k, 'v> { - key: Key<'k>, - found: Option>, - } - - impl<'k, 'kvs> Visitor<'kvs> for Get<'k, 'kvs> { - fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { - if self.key == key { - self.found = Some(value); - } - - Ok(()) - } - } - - let mut get = Get { key, found: None }; - - let _ = self.visit(&mut get); - get.found - } - - /// Count the number of key-value pairs that can be visited. - /// - /// # Implementation notes - /// - /// A source that knows the number of key-value pairs upfront may provide a more - /// efficient implementation. - /// - /// A subsequent call to `visit` should yield the same number of key-value pairs - /// to the visitor, unless that visitor fails part way through. - fn count(&self) -> usize { - struct Count(usize); - - impl<'kvs> Visitor<'kvs> for Count { - fn visit_pair(&mut self, _: Key<'kvs>, _: Value<'kvs>) -> Result<(), Error> { - self.0 += 1; - - Ok(()) - } - } - - let mut count = Count(0); - let _ = self.visit(&mut count); - count.0 - } -} - -impl<'a, T> Source for &'a T -where - T: Source + ?Sized, -{ - fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { - Source::visit(&**self, visitor) - } - - fn get<'v>(&'v self, key: Key) -> Option> { - Source::get(&**self, key) - } - - fn count(&self) -> usize { - Source::count(&**self) - } -} - -impl Source for (K, V) -where - K: ToKey, - V: ToValue, -{ - fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { - visitor.visit_pair(self.0.to_key(), self.1.to_value()) - } - - fn get<'v>(&'v self, key: Key) -> Option> { - if self.0.to_key() == key { - Some(self.1.to_value()) - } else { - None - } - } - - fn count(&self) -> usize { - 1 - } -} - -impl Source for [S] -where - S: Source, -{ - fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { - for source in self { - source.visit(visitor)?; - } - - Ok(()) - } - - fn count(&self) -> usize { - self.len() - } -} - -impl Source for Option -where - S: Source, -{ - fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { - if let Some(ref source) = *self { - source.visit(visitor)?; - } - - Ok(()) - } - - fn count(&self) -> usize { - self.as_ref().map(Source::count).unwrap_or(0) - } -} - -/// A visitor for the key-value pairs in a [`Source`](trait.Source.html). -pub trait Visitor<'kvs> { - /// Visit a key-value pair. - fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error>; -} - -impl<'a, 'kvs, T> Visitor<'kvs> for &'a mut T -where - T: Visitor<'kvs> + ?Sized, -{ - fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { - (**self).visit_pair(key, value) - } -} - -impl<'a, 'b: 'a, 'kvs> Visitor<'kvs> for fmt::DebugMap<'a, 'b> { - fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { - self.entry(&key, &value); - Ok(()) - } -} - -impl<'a, 'b: 'a, 'kvs> Visitor<'kvs> for fmt::DebugList<'a, 'b> { - fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { - self.entry(&(key, value)); - Ok(()) - } -} - -impl<'a, 'b: 'a, 'kvs> Visitor<'kvs> for fmt::DebugSet<'a, 'b> { - fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { - self.entry(&(key, value)); - Ok(()) - } -} - -impl<'a, 'b: 'a, 'kvs> Visitor<'kvs> for fmt::DebugTuple<'a, 'b> { - fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { - self.field(&key); - self.field(&value); - Ok(()) - } -} - -#[cfg(feature = "std")] -mod std_support { - use super::*; - use std::borrow::Borrow; - use std::collections::{BTreeMap, HashMap}; - use std::hash::{BuildHasher, Hash}; - - impl Source for Box - where - S: Source + ?Sized, - { - fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { - Source::visit(&**self, visitor) - } - - fn get<'v>(&'v self, key: Key) -> Option> { - Source::get(&**self, key) - } - - fn count(&self) -> usize { - Source::count(&**self) - } - } - - impl Source for Vec - where - S: Source, - { - fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { - Source::visit(&**self, visitor) - } - - fn get<'v>(&'v self, key: Key) -> Option> { - Source::get(&**self, key) - } - - fn count(&self) -> usize { - Source::count(&**self) - } - } - - impl<'kvs, V> Visitor<'kvs> for Box - where - V: Visitor<'kvs> + ?Sized, - { - fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { - (**self).visit_pair(key, value) - } - } - - impl Source for HashMap - where - K: ToKey + Borrow + Eq + Hash, - V: ToValue, - S: BuildHasher, - { - fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { - for (key, value) in self { - visitor.visit_pair(key.to_key(), value.to_value())?; - } - Ok(()) - } - - fn get<'v>(&'v self, key: Key) -> Option> { - HashMap::get(self, key.as_str()).map(|v| v.to_value()) - } - - fn count(&self) -> usize { - self.len() - } - } - - impl Source for BTreeMap - where - K: ToKey + Borrow + Ord, - V: ToValue, - { - fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { - for (key, value) in self { - visitor.visit_pair(key.to_key(), value.to_value())?; - } - Ok(()) - } - - fn get<'v>(&'v self, key: Key) -> Option> { - BTreeMap::get(self, key.as_str()).map(|v| v.to_value()) - } - - fn count(&self) -> usize { - self.len() - } - } - - #[cfg(test)] - mod tests { - use super::*; - use kv::value::test::Token; - use std::collections::{BTreeMap, HashMap}; - - #[test] - fn count() { - assert_eq!(1, Source::count(&Box::new(("a", 1)))); - assert_eq!(2, Source::count(&vec![("a", 1), ("b", 2)])); - } - - #[test] - fn get() { - let source = vec![("a", 1), ("b", 2), ("a", 1)]; - assert_eq!( - Token::I64(1), - Source::get(&source, Key::from_str("a")).unwrap().to_token() - ); - - let source = Box::new(Option::None::<(&str, i32)>); - assert!(Source::get(&source, Key::from_str("a")).is_none()); - } - - #[test] - fn hash_map() { - let mut map = HashMap::new(); - map.insert("a", 1); - map.insert("b", 2); - - assert_eq!(2, Source::count(&map)); - assert_eq!( - Token::I64(1), - Source::get(&map, Key::from_str("a")).unwrap().to_token() - ); - } - - #[test] - fn btree_map() { - let mut map = BTreeMap::new(); - map.insert("a", 1); - map.insert("b", 2); - - assert_eq!(2, Source::count(&map)); - assert_eq!( - Token::I64(1), - Source::get(&map, Key::from_str("a")).unwrap().to_token() - ); - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - use kv::value::test::Token; - - #[test] - fn source_is_object_safe() { - fn _check(_: &dyn Source) {} - } - - #[test] - fn visitor_is_object_safe() { - fn _check(_: &dyn Visitor) {} - } - - #[test] - fn count() { - struct OnePair { - key: &'static str, - value: i32, - } - - impl Source for OnePair { - fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { - visitor.visit_pair(self.key.to_key(), self.value.to_value()) - } - } - - assert_eq!(1, Source::count(&("a", 1))); - assert_eq!(2, Source::count(&[("a", 1), ("b", 2)] as &[_])); - assert_eq!(0, Source::count(&Option::None::<(&str, i32)>)); - assert_eq!(1, Source::count(&OnePair { key: "a", value: 1 })); - } - - #[test] - fn get() { - let source = &[("a", 1), ("b", 2), ("a", 1)] as &[_]; - assert_eq!( - Token::I64(1), - Source::get(source, Key::from_str("a")).unwrap().to_token() - ); - assert_eq!( - Token::I64(2), - Source::get(source, Key::from_str("b")).unwrap().to_token() - ); - assert!(Source::get(&source, Key::from_str("c")).is_none()); - - let source = Option::None::<(&str, i32)>; - assert!(Source::get(&source, Key::from_str("a")).is_none()); - } -} diff --git a/third_party/cargo/vendor/log-0.4.11/src/kv/value/fill.rs b/third_party/cargo/vendor/log-0.4.11/src/kv/value/fill.rs deleted file mode 100644 index 2e74899..0000000 --- a/third_party/cargo/vendor/log-0.4.11/src/kv/value/fill.rs +++ /dev/null @@ -1,164 +0,0 @@ -//! Lazy value initialization. - -use std::fmt; - -use super::internal::{Erased, Inner, Visitor}; -use super::{Error, Value}; - -impl<'v> Value<'v> { - /// Get a value from a fillable slot. - pub fn from_fill(value: &'v T) -> Self - where - T: Fill + 'static, - { - Value { - inner: Inner::Fill(unsafe { Erased::new_unchecked::(value) }), - } - } -} - -/// A type that requires extra work to convert into a [`Value`](struct.Value.html). -/// -/// This trait is a more advanced initialization API than [`ToValue`](trait.ToValue.html). -/// It's intended for erased values coming from other logging frameworks that may need -/// to perform extra work to determine the concrete type to use. -pub trait Fill { - /// Fill a value. - fn fill(&self, slot: &mut Slot) -> Result<(), Error>; -} - -impl<'a, T> Fill for &'a T -where - T: Fill + ?Sized, -{ - fn fill(&self, slot: &mut Slot) -> Result<(), Error> { - (**self).fill(slot) - } -} - -/// A value slot to fill using the [`Fill`](trait.Fill.html) trait. -pub struct Slot<'s, 'f> { - filled: bool, - visitor: &'s mut dyn Visitor<'f>, -} - -impl<'s, 'f> fmt::Debug for Slot<'s, 'f> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("Slot").finish() - } -} - -impl<'s, 'f> Slot<'s, 'f> { - pub(super) fn new(visitor: &'s mut dyn Visitor<'f>) -> Self { - Slot { - visitor, - filled: false, - } - } - - pub(super) fn fill(&mut self, f: F) -> Result<(), Error> - where - F: FnOnce(&mut dyn Visitor<'f>) -> Result<(), Error>, - { - assert!(!self.filled, "the slot has already been filled"); - self.filled = true; - - f(self.visitor) - } - - /// Fill the slot with a value. - /// - /// The given value doesn't need to satisfy any particular lifetime constraints. - /// - /// # Panics - /// - /// Calling more than a single `fill` method on this slot will panic. - pub fn fill_any(&mut self, value: T) -> Result<(), Error> - where - T: Into>, - { - self.fill(|visitor| value.into().inner.visit(visitor)) - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn fill_value_borrowed() { - struct TestFill; - - impl Fill for TestFill { - fn fill(&self, slot: &mut Slot) -> Result<(), Error> { - let dbg: &dyn fmt::Debug = &1; - - slot.fill_debug(&dbg) - } - } - - assert_eq!("1", Value::from_fill(&TestFill).to_string()); - } - - #[test] - fn fill_value_owned() { - struct TestFill; - - impl Fill for TestFill { - fn fill(&self, slot: &mut Slot) -> Result<(), Error> { - slot.fill_any("a string") - } - } - } - - #[test] - #[should_panic] - fn fill_multiple_times_panics() { - struct BadFill; - - impl Fill for BadFill { - fn fill(&self, slot: &mut Slot) -> Result<(), Error> { - slot.fill_any(42)?; - slot.fill_any(6789)?; - - Ok(()) - } - } - - let _ = Value::from_fill(&BadFill).to_string(); - } - - #[test] - fn fill_cast() { - struct TestFill; - - impl Fill for TestFill { - fn fill(&self, slot: &mut Slot) -> Result<(), Error> { - slot.fill_any("a string") - } - } - - assert_eq!( - "a string", - Value::from_fill(&TestFill) - .to_borrowed_str() - .expect("invalid value") - ); - } - - #[test] - fn fill_debug() { - struct TestFill; - - impl Fill for TestFill { - fn fill(&self, slot: &mut Slot) -> Result<(), Error> { - slot.fill_any(42u64) - } - } - - assert_eq!( - format!("{:04?}", 42u64), - format!("{:04?}", Value::from_fill(&TestFill)), - ) - } -} diff --git a/third_party/cargo/vendor/log-0.4.11/src/kv/value/impls.rs b/third_party/cargo/vendor/log-0.4.11/src/kv/value/impls.rs deleted file mode 100644 index 8752dbe..0000000 --- a/third_party/cargo/vendor/log-0.4.11/src/kv/value/impls.rs +++ /dev/null @@ -1,159 +0,0 @@ -//! Converting standard types into `Value`s. -//! -//! This module provides `ToValue` implementations for commonly -//! logged types from the standard library. - -use std::fmt; - -use super::{Primitive, ToValue, Value}; - -macro_rules! impl_into_owned { - ($($into_ty:ty => $convert:ident,)*) => { - $( - impl ToValue for $into_ty { - fn to_value(&self) -> Value { - Value::from(*self) - } - } - - impl<'v> From<$into_ty> for Value<'v> { - fn from(value: $into_ty) -> Self { - Value::from_primitive(value as $convert) - } - } - )* - }; -} - -impl<'v> ToValue for &'v str { - fn to_value(&self) -> Value { - Value::from(*self) - } -} - -impl<'v> From<&'v str> for Value<'v> { - fn from(value: &'v str) -> Self { - Value::from_primitive(value) - } -} - -impl<'v> ToValue for fmt::Arguments<'v> { - fn to_value(&self) -> Value { - Value::from(*self) - } -} - -impl<'v> From> for Value<'v> { - fn from(value: fmt::Arguments<'v>) -> Self { - Value::from_primitive(value) - } -} - -impl ToValue for () { - fn to_value(&self) -> Value { - Value::from_primitive(Primitive::None) - } -} - -impl ToValue for Option -where - T: ToValue, -{ - fn to_value(&self) -> Value { - match *self { - Some(ref value) => value.to_value(), - None => Value::from_primitive(Primitive::None), - } - } -} - -impl_into_owned! [ - usize => u64, - u8 => u64, - u16 => u64, - u32 => u64, - u64 => u64, - - isize => i64, - i8 => i64, - i16 => i64, - i32 => i64, - i64 => i64, - - f32 => f64, - f64 => f64, - - char => char, - bool => bool, -]; - -#[cfg(feature = "std")] -mod std_support { - use super::*; - - use std::borrow::Cow; - - impl ToValue for Box - where - T: ToValue + ?Sized, - { - fn to_value(&self) -> Value { - (**self).to_value() - } - } - - impl ToValue for String { - fn to_value(&self) -> Value { - Value::from_primitive(Primitive::Str(&*self)) - } - } - - impl<'v> ToValue for Cow<'v, str> { - fn to_value(&self) -> Value { - Value::from_primitive(Primitive::Str(&*self)) - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - use kv::value::test::Token; - - #[test] - fn test_to_value_display() { - assert_eq!(42u64.to_value().to_string(), "42"); - assert_eq!(42i64.to_value().to_string(), "42"); - assert_eq!(42.01f64.to_value().to_string(), "42.01"); - assert_eq!(true.to_value().to_string(), "true"); - assert_eq!('a'.to_value().to_string(), "a"); - assert_eq!( - format_args!("a {}", "value").to_value().to_string(), - "a value" - ); - assert_eq!("a loong string".to_value().to_string(), "a loong string"); - assert_eq!(Some(true).to_value().to_string(), "true"); - assert_eq!(().to_value().to_string(), "None"); - assert_eq!(Option::None::.to_value().to_string(), "None"); - } - - #[test] - fn test_to_value_structured() { - assert_eq!(42u64.to_value().to_token(), Token::U64(42)); - assert_eq!(42i64.to_value().to_token(), Token::I64(42)); - assert_eq!(42.01f64.to_value().to_token(), Token::F64(42.01)); - assert_eq!(true.to_value().to_token(), Token::Bool(true)); - assert_eq!('a'.to_value().to_token(), Token::Char('a')); - assert_eq!( - format_args!("a {}", "value").to_value().to_token(), - Token::Str("a value".into()) - ); - assert_eq!( - "a loong string".to_value().to_token(), - Token::Str("a loong string".into()) - ); - assert_eq!(Some(true).to_value().to_token(), Token::Bool(true)); - assert_eq!(().to_value().to_token(), Token::None); - assert_eq!(Option::None::.to_value().to_token(), Token::None); - } -} diff --git a/third_party/cargo/vendor/log-0.4.11/src/kv/value/internal/cast.rs b/third_party/cargo/vendor/log-0.4.11/src/kv/value/internal/cast.rs deleted file mode 100644 index aaa4b07..0000000 --- a/third_party/cargo/vendor/log-0.4.11/src/kv/value/internal/cast.rs +++ /dev/null @@ -1,475 +0,0 @@ -//! Coerce a `Value` into some concrete types. -//! -//! These operations are cheap when the captured value is a simple primitive, -//! but may end up executing arbitrary caller code if the value is complex. -//! They will also attempt to downcast erased types into a primitive where possible. - -use std::any::TypeId; -use std::fmt; - -use super::{Erased, Inner, Primitive, Visitor}; -use crate::kv::value::{Error, Value}; - -impl<'v> Value<'v> { - /// Try get a `usize` from this value. - /// - /// This method is cheap for primitive types, but may call arbitrary - /// serialization implementations for complex ones. - pub fn to_usize(&self) -> Option { - self.inner - .cast() - .into_primitive() - .into_u64() - .map(|v| v as usize) - } - - /// Try get a `u8` from this value. - /// - /// This method is cheap for primitive types, but may call arbitrary - /// serialization implementations for complex ones. - pub fn to_u8(&self) -> Option { - self.inner - .cast() - .into_primitive() - .into_u64() - .map(|v| v as u8) - } - - /// Try get a `u16` from this value. - /// - /// This method is cheap for primitive types, but may call arbitrary - /// serialization implementations for complex ones. - pub fn to_u16(&self) -> Option { - self.inner - .cast() - .into_primitive() - .into_u64() - .map(|v| v as u16) - } - - /// Try get a `u32` from this value. - /// - /// This method is cheap for primitive types, but may call arbitrary - /// serialization implementations for complex ones. - pub fn to_u32(&self) -> Option { - self.inner - .cast() - .into_primitive() - .into_u64() - .map(|v| v as u32) - } - - /// Try get a `u64` from this value. - /// - /// This method is cheap for primitive types, but may call arbitrary - /// serialization implementations for complex ones. - pub fn to_u64(&self) -> Option { - self.inner.cast().into_primitive().into_u64() - } - - /// Try get a `isize` from this value. - /// - /// This method is cheap for primitive types, but may call arbitrary - /// serialization implementations for complex ones. - pub fn to_isize(&self) -> Option { - self.inner - .cast() - .into_primitive() - .into_i64() - .map(|v| v as isize) - } - - /// Try get a `i8` from this value. - /// - /// This method is cheap for primitive types, but may call arbitrary - /// serialization implementations for complex ones. - pub fn to_i8(&self) -> Option { - self.inner - .cast() - .into_primitive() - .into_i64() - .map(|v| v as i8) - } - - /// Try get a `i16` from this value. - /// - /// This method is cheap for primitive types, but may call arbitrary - /// serialization implementations for complex ones. - pub fn to_i16(&self) -> Option { - self.inner - .cast() - .into_primitive() - .into_i64() - .map(|v| v as i16) - } - - /// Try get a `i32` from this value. - /// - /// This method is cheap for primitive types, but may call arbitrary - /// serialization implementations for complex ones. - pub fn to_i32(&self) -> Option { - self.inner - .cast() - .into_primitive() - .into_i64() - .map(|v| v as i32) - } - - /// Try get a `i64` from this value. - /// - /// This method is cheap for primitive types, but may call arbitrary - /// serialization implementations for complex ones. - pub fn to_i64(&self) -> Option { - self.inner.cast().into_primitive().into_i64() - } - - /// Try get a `f32` from this value. - /// - /// This method is cheap for primitive types, but may call arbitrary - /// serialization implementations for complex ones. - pub fn to_f32(&self) -> Option { - self.inner - .cast() - .into_primitive() - .into_f64() - .map(|v| v as f32) - } - - /// Try get a `f64` from this value. - /// - /// This method is cheap for primitive types, but may call arbitrary - /// serialization implementations for complex ones. - pub fn to_f64(&self) -> Option { - self.inner.cast().into_primitive().into_f64() - } - - /// Try get a `bool` from this value. - /// - /// This method is cheap for primitive types, but may call arbitrary - /// serialization implementations for complex ones. - pub fn to_bool(&self) -> Option { - self.inner.cast().into_primitive().into_bool() - } - - /// Try get a `char` from this value. - /// - /// This method is cheap for primitive types, but may call arbitrary - /// serialization implementations for complex ones. - pub fn to_char(&self) -> Option { - self.inner.cast().into_primitive().into_char() - } - - /// Try get a `str` from this value. - /// - /// This method is cheap for primitive types. It won't allocate an owned - /// `String` if the value is a complex type. - pub fn to_borrowed_str(&self) -> Option<&str> { - self.inner.cast().into_primitive().into_borrowed_str() - } -} - -impl<'v> Inner<'v> { - /// Cast the inner value to another type. - fn cast(self) -> Cast<'v> { - struct CastVisitor<'v>(Cast<'v>); - - impl<'v> Visitor<'v> for CastVisitor<'v> { - fn debug(&mut self, _: &dyn fmt::Debug) -> Result<(), Error> { - Ok(()) - } - - fn u64(&mut self, v: u64) -> Result<(), Error> { - self.0 = Cast::Primitive(Primitive::Unsigned(v)); - Ok(()) - } - - fn i64(&mut self, v: i64) -> Result<(), Error> { - self.0 = Cast::Primitive(Primitive::Signed(v)); - Ok(()) - } - - fn f64(&mut self, v: f64) -> Result<(), Error> { - self.0 = Cast::Primitive(Primitive::Float(v)); - Ok(()) - } - - fn bool(&mut self, v: bool) -> Result<(), Error> { - self.0 = Cast::Primitive(Primitive::Bool(v)); - Ok(()) - } - - fn char(&mut self, v: char) -> Result<(), Error> { - self.0 = Cast::Primitive(Primitive::Char(v)); - Ok(()) - } - - fn borrowed_str(&mut self, v: &'v str) -> Result<(), Error> { - self.0 = Cast::Primitive(Primitive::Str(v)); - Ok(()) - } - - #[cfg(not(feature = "std"))] - fn str(&mut self, _: &str) -> Result<(), Error> { - Ok(()) - } - - #[cfg(feature = "std")] - fn str(&mut self, v: &str) -> Result<(), Error> { - self.0 = Cast::String(v.into()); - Ok(()) - } - - fn none(&mut self) -> Result<(), Error> { - self.0 = Cast::Primitive(Primitive::None); - Ok(()) - } - - #[cfg(feature = "kv_unstable_sval")] - fn sval(&mut self, v: &dyn super::sval::Value) -> Result<(), Error> { - self.0 = super::sval::cast(v); - Ok(()) - } - } - - // Try downcast an erased value first - // It also lets us avoid the Visitor infrastructure for simple primitives - let primitive = match self { - Inner::Primitive(value) => Some(value), - Inner::Fill(value) => value.downcast_primitive(), - Inner::Debug(value) => value.downcast_primitive(), - Inner::Display(value) => value.downcast_primitive(), - - #[cfg(feature = "sval")] - Inner::Sval(value) => value.downcast_primitive(), - }; - - primitive.map(Cast::Primitive).unwrap_or_else(|| { - // If the erased value isn't a primitive then we visit it - let mut cast = CastVisitor(Cast::Primitive(Primitive::None)); - let _ = self.visit(&mut cast); - cast.0 - }) - } -} - -pub(super) enum Cast<'v> { - Primitive(Primitive<'v>), - #[cfg(feature = "std")] - String(String), -} - -impl<'v> Cast<'v> { - fn into_primitive(self) -> Primitive<'v> { - match self { - Cast::Primitive(value) => value, - #[cfg(feature = "std")] - _ => Primitive::None, - } - } -} - -impl<'v> Primitive<'v> { - fn into_borrowed_str(self) -> Option<&'v str> { - if let Primitive::Str(value) = self { - Some(value) - } else { - None - } - } - - fn into_u64(self) -> Option { - match self { - Primitive::Unsigned(value) => Some(value), - Primitive::Signed(value) => Some(value as u64), - Primitive::Float(value) => Some(value as u64), - _ => None, - } - } - - fn into_i64(self) -> Option { - match self { - Primitive::Signed(value) => Some(value), - Primitive::Unsigned(value) => Some(value as i64), - Primitive::Float(value) => Some(value as i64), - _ => None, - } - } - - fn into_f64(self) -> Option { - match self { - Primitive::Float(value) => Some(value), - Primitive::Unsigned(value) => Some(value as f64), - Primitive::Signed(value) => Some(value as f64), - _ => None, - } - } - - fn into_char(self) -> Option { - if let Primitive::Char(value) = self { - Some(value) - } else { - None - } - } - - fn into_bool(self) -> Option { - if let Primitive::Bool(value) = self { - Some(value) - } else { - None - } - } -} - -impl<'v, T: ?Sized + 'static> Erased<'v, T> { - // NOTE: This function is a perfect candidate for memoization - // The outcome could be stored in a `Cell` - fn downcast_primitive(self) -> Option> { - macro_rules! type_ids { - ($($value:ident : $ty:ty => $cast:expr,)*) => {{ - struct TypeIds; - - impl TypeIds { - fn downcast_primitive<'v, T: ?Sized>(&self, value: Erased<'v, T>) -> Option> { - $( - if TypeId::of::<$ty>() == value.type_id { - let $value = unsafe { value.downcast_unchecked::<$ty>() }; - return Some(Primitive::from($cast)); - } - )* - - None - } - } - - TypeIds - }}; - } - - let type_ids = type_ids![ - value: usize => *value as u64, - value: u8 => *value as u64, - value: u16 => *value as u64, - value: u32 => *value as u64, - value: u64 => *value, - - value: isize => *value as i64, - value: i8 => *value as i64, - value: i16 => *value as i64, - value: i32 => *value as i64, - value: i64 => *value, - - value: f32 => *value as f64, - value: f64 => *value, - - value: char => *value, - value: bool => *value, - - value: &str => *value, - ]; - - type_ids.downcast_primitive(self) - } -} - -#[cfg(feature = "std")] -mod std_support { - use super::*; - - use std::borrow::Cow; - - impl<'v> Value<'v> { - /// Try get a `usize` from this value. - /// - /// This method is cheap for primitive types, but may call arbitrary - /// serialization implementations for complex ones. If the serialization - /// implementation produces a short lived string it will be allocated. - pub fn to_str(&self) -> Option> { - self.inner.cast().into_str() - } - } - - impl<'v> Cast<'v> { - pub(super) fn into_str(self) -> Option> { - match self { - Cast::Primitive(Primitive::Str(value)) => Some(value.into()), - Cast::String(value) => Some(value.into()), - _ => None, - } - } - } - - #[cfg(test)] - mod tests { - use crate::kv::ToValue; - - #[test] - fn primitive_cast() { - assert_eq!( - "a string", - "a string" - .to_owned() - .to_value() - .to_borrowed_str() - .expect("invalid value") - ); - assert_eq!( - "a string", - &*"a string".to_value().to_str().expect("invalid value") - ); - assert_eq!( - "a string", - &*"a string" - .to_owned() - .to_value() - .to_str() - .expect("invalid value") - ); - } - } -} - -#[cfg(test)] -mod tests { - use crate::kv::ToValue; - - #[test] - fn primitive_cast() { - assert_eq!( - "a string", - "a string" - .to_value() - .to_borrowed_str() - .expect("invalid value") - ); - assert_eq!( - "a string", - Some("a string") - .to_value() - .to_borrowed_str() - .expect("invalid value") - ); - - assert_eq!(1u8, 1u64.to_value().to_u8().expect("invalid value")); - assert_eq!(1u16, 1u64.to_value().to_u16().expect("invalid value")); - assert_eq!(1u32, 1u64.to_value().to_u32().expect("invalid value")); - assert_eq!(1u64, 1u64.to_value().to_u64().expect("invalid value")); - assert_eq!(1usize, 1u64.to_value().to_usize().expect("invalid value")); - - assert_eq!(-1i8, -1i64.to_value().to_i8().expect("invalid value")); - assert_eq!(-1i16, -1i64.to_value().to_i16().expect("invalid value")); - assert_eq!(-1i32, -1i64.to_value().to_i32().expect("invalid value")); - assert_eq!(-1i64, -1i64.to_value().to_i64().expect("invalid value")); - assert_eq!(-1isize, -1i64.to_value().to_isize().expect("invalid value")); - - assert!(1f32.to_value().to_f32().is_some(), "invalid value"); - assert!(1f64.to_value().to_f64().is_some(), "invalid value"); - - assert_eq!(1u32, 1i64.to_value().to_u32().expect("invalid value")); - assert_eq!(1i32, 1u64.to_value().to_i32().expect("invalid value")); - assert!(1f32.to_value().to_i32().is_some(), "invalid value"); - - assert_eq!('a', 'a'.to_value().to_char().expect("invalid value")); - assert_eq!(true, true.to_value().to_bool().expect("invalid value")); - } -} diff --git a/third_party/cargo/vendor/log-0.4.11/src/kv/value/internal/fmt.rs b/third_party/cargo/vendor/log-0.4.11/src/kv/value/internal/fmt.rs deleted file mode 100644 index 66817d4..0000000 --- a/third_party/cargo/vendor/log-0.4.11/src/kv/value/internal/fmt.rs +++ /dev/null @@ -1,249 +0,0 @@ -//! Integration between `Value` and `std::fmt`. -//! -//! This module allows any `Value` to implement the `fmt::Debug` and `fmt::Display` traits, -//! and for any `fmt::Debug` or `fmt::Display` to be captured as a `Value`. - -use std::fmt; - -use super::{Erased, Inner, Visitor}; -use crate::kv; -use crate::kv::value::{Error, Slot}; - -impl<'v> kv::Value<'v> { - /// Get a value from a debuggable type. - pub fn from_debug(value: &'v T) -> Self - where - T: fmt::Debug + 'static, - { - kv::Value { - inner: Inner::Debug(unsafe { Erased::new_unchecked::(value) }), - } - } - - /// Get a value from a displayable type. - pub fn from_display(value: &'v T) -> Self - where - T: fmt::Display + 'static, - { - kv::Value { - inner: Inner::Display(unsafe { Erased::new_unchecked::(value) }), - } - } -} - -impl<'s, 'f> Slot<'s, 'f> { - /// Fill the slot with a debuggable value. - /// - /// The given value doesn't need to satisfy any particular lifetime constraints. - /// - /// # Panics - /// - /// Calling more than a single `fill` method on this slot will panic. - pub fn fill_debug(&mut self, value: T) -> Result<(), Error> - where - T: fmt::Debug, - { - self.fill(|visitor| visitor.debug(&value)) - } - - /// Fill the slot with a displayable value. - /// - /// The given value doesn't need to satisfy any particular lifetime constraints. - /// - /// # Panics - /// - /// Calling more than a single `fill` method on this slot will panic. - pub fn fill_display(&mut self, value: T) -> Result<(), Error> - where - T: fmt::Display, - { - self.fill(|visitor| visitor.display(&value)) - } -} - -pub(in kv::value) use self::fmt::{Arguments, Debug, Display}; - -impl<'v> fmt::Debug for kv::Value<'v> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - struct DebugVisitor<'a, 'b: 'a>(&'a mut fmt::Formatter<'b>); - - impl<'a, 'b: 'a, 'v> Visitor<'v> for DebugVisitor<'a, 'b> { - fn debug(&mut self, v: &dyn fmt::Debug) -> Result<(), Error> { - fmt::Debug::fmt(v, self.0)?; - - Ok(()) - } - - fn display(&mut self, v: &dyn fmt::Display) -> Result<(), Error> { - fmt::Display::fmt(v, self.0)?; - - Ok(()) - } - - fn u64(&mut self, v: u64) -> Result<(), Error> { - fmt::Debug::fmt(&v, self.0)?; - - Ok(()) - } - - fn i64(&mut self, v: i64) -> Result<(), Error> { - fmt::Debug::fmt(&v, self.0)?; - - Ok(()) - } - - fn f64(&mut self, v: f64) -> Result<(), Error> { - fmt::Debug::fmt(&v, self.0)?; - - Ok(()) - } - - fn bool(&mut self, v: bool) -> Result<(), Error> { - fmt::Debug::fmt(&v, self.0)?; - - Ok(()) - } - - fn char(&mut self, v: char) -> Result<(), Error> { - fmt::Debug::fmt(&v, self.0)?; - - Ok(()) - } - - fn str(&mut self, v: &str) -> Result<(), Error> { - fmt::Debug::fmt(&v, self.0)?; - - Ok(()) - } - - fn none(&mut self) -> Result<(), Error> { - self.debug(&format_args!("None")) - } - - #[cfg(feature = "kv_unstable_sval")] - fn sval(&mut self, v: &dyn super::sval::Value) -> Result<(), Error> { - super::sval::fmt(self.0, v) - } - } - - self.visit(&mut DebugVisitor(f)).map_err(|_| fmt::Error)?; - - Ok(()) - } -} - -impl<'v> fmt::Display for kv::Value<'v> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - struct DisplayVisitor<'a, 'b: 'a>(&'a mut fmt::Formatter<'b>); - - impl<'a, 'b: 'a, 'v> Visitor<'v> for DisplayVisitor<'a, 'b> { - fn debug(&mut self, v: &dyn fmt::Debug) -> Result<(), Error> { - fmt::Debug::fmt(v, self.0)?; - - Ok(()) - } - - fn display(&mut self, v: &dyn fmt::Display) -> Result<(), Error> { - fmt::Display::fmt(v, self.0)?; - - Ok(()) - } - - fn u64(&mut self, v: u64) -> Result<(), Error> { - fmt::Display::fmt(&v, self.0)?; - - Ok(()) - } - - fn i64(&mut self, v: i64) -> Result<(), Error> { - fmt::Display::fmt(&v, self.0)?; - - Ok(()) - } - - fn f64(&mut self, v: f64) -> Result<(), Error> { - fmt::Display::fmt(&v, self.0)?; - - Ok(()) - } - - fn bool(&mut self, v: bool) -> Result<(), Error> { - fmt::Display::fmt(&v, self.0)?; - - Ok(()) - } - - fn char(&mut self, v: char) -> Result<(), Error> { - fmt::Display::fmt(&v, self.0)?; - - Ok(()) - } - - fn str(&mut self, v: &str) -> Result<(), Error> { - fmt::Display::fmt(&v, self.0)?; - - Ok(()) - } - - fn none(&mut self) -> Result<(), Error> { - self.debug(&format_args!("None")) - } - - #[cfg(feature = "kv_unstable_sval")] - fn sval(&mut self, v: &dyn super::sval::Value) -> Result<(), Error> { - super::sval::fmt(self.0, v) - } - } - - self.visit(&mut DisplayVisitor(f)).map_err(|_| fmt::Error)?; - - Ok(()) - } -} - -#[cfg(test)] -mod tests { - use super::*; - - use crate::kv::value::ToValue; - - #[test] - fn fmt_cast() { - assert_eq!( - 42u32, - kv::Value::from_debug(&42u64) - .to_u32() - .expect("invalid value") - ); - - assert_eq!( - "a string", - kv::Value::from_display(&"a string") - .to_borrowed_str() - .expect("invalid value") - ); - } - - #[test] - fn fmt_debug() { - assert_eq!( - format!("{:?}", "a string"), - format!("{:?}", "a string".to_value()), - ); - - assert_eq!( - format!("{:04?}", 42u64), - format!("{:04?}", 42u64.to_value()), - ); - } - - #[test] - fn fmt_display() { - assert_eq!( - format!("{}", "a string"), - format!("{}", "a string".to_value()), - ); - - assert_eq!(format!("{:04}", 42u64), format!("{:04}", 42u64.to_value()),); - } -} diff --git a/third_party/cargo/vendor/log-0.4.11/src/kv/value/internal/mod.rs b/third_party/cargo/vendor/log-0.4.11/src/kv/value/internal/mod.rs deleted file mode 100644 index 01b72a7..0000000 --- a/third_party/cargo/vendor/log-0.4.11/src/kv/value/internal/mod.rs +++ /dev/null @@ -1,181 +0,0 @@ -//! The internal `Value` serialization API. -//! -//! This implementation isn't intended to be public. It may need to change -//! for optimizations or to support new external serialization frameworks. - -use std::any::TypeId; - -use super::{Error, Fill, Slot}; - -pub(super) mod cast; -pub(super) mod fmt; -#[cfg(feature = "kv_unstable_sval")] -pub(super) mod sval; - -/// A container for a structured value for a specific kind of visitor. -#[derive(Clone, Copy)] -pub(super) enum Inner<'v> { - /// A simple primitive value that can be copied without allocating. - Primitive(Primitive<'v>), - /// A value that can be filled. - Fill(Erased<'v, dyn Fill + 'static>), - /// A debuggable value. - Debug(Erased<'v, dyn fmt::Debug + 'static>), - /// A displayable value. - Display(Erased<'v, dyn fmt::Display + 'static>), - - #[cfg(feature = "kv_unstable_sval")] - /// A structured value from `sval`. - Sval(Erased<'v, dyn sval::Value + 'static>), -} - -impl<'v> Inner<'v> { - pub(super) fn visit(self, visitor: &mut dyn Visitor<'v>) -> Result<(), Error> { - match self { - Inner::Primitive(value) => value.visit(visitor), - Inner::Fill(value) => value.get().fill(&mut Slot::new(visitor)), - Inner::Debug(value) => visitor.debug(value.get()), - Inner::Display(value) => visitor.display(value.get()), - - #[cfg(feature = "kv_unstable_sval")] - Inner::Sval(value) => visitor.sval(value.get()), - } - } -} - -/// The internal serialization contract. -pub(super) trait Visitor<'v> { - fn debug(&mut self, v: &dyn fmt::Debug) -> Result<(), Error>; - fn display(&mut self, v: &dyn fmt::Display) -> Result<(), Error> { - self.debug(&format_args!("{}", v)) - } - - fn u64(&mut self, v: u64) -> Result<(), Error>; - fn i64(&mut self, v: i64) -> Result<(), Error>; - fn f64(&mut self, v: f64) -> Result<(), Error>; - fn bool(&mut self, v: bool) -> Result<(), Error>; - fn char(&mut self, v: char) -> Result<(), Error>; - - fn str(&mut self, v: &str) -> Result<(), Error>; - fn borrowed_str(&mut self, v: &'v str) -> Result<(), Error> { - self.str(v) - } - - fn none(&mut self) -> Result<(), Error>; - - #[cfg(feature = "kv_unstable_sval")] - fn sval(&mut self, v: &dyn sval::Value) -> Result<(), Error>; -} - -/// A captured primitive value. -/// -/// These values are common and cheap to copy around. -#[derive(Clone, Copy)] -pub(super) enum Primitive<'v> { - Signed(i64), - Unsigned(u64), - Float(f64), - Bool(bool), - Char(char), - Str(&'v str), - Fmt(fmt::Arguments<'v>), - None, -} - -impl<'v> Primitive<'v> { - fn visit(self, visitor: &mut dyn Visitor<'v>) -> Result<(), Error> { - match self { - Primitive::Signed(value) => visitor.i64(value), - Primitive::Unsigned(value) => visitor.u64(value), - Primitive::Float(value) => visitor.f64(value), - Primitive::Bool(value) => visitor.bool(value), - Primitive::Char(value) => visitor.char(value), - Primitive::Str(value) => visitor.borrowed_str(value), - Primitive::Fmt(value) => visitor.debug(&value), - Primitive::None => visitor.none(), - } - } -} - -impl<'v> From for Primitive<'v> { - fn from(v: u64) -> Self { - Primitive::Unsigned(v) - } -} - -impl<'v> From for Primitive<'v> { - fn from(v: i64) -> Self { - Primitive::Signed(v) - } -} - -impl<'v> From for Primitive<'v> { - fn from(v: f64) -> Self { - Primitive::Float(v) - } -} - -impl<'v> From for Primitive<'v> { - fn from(v: bool) -> Self { - Primitive::Bool(v) - } -} - -impl<'v> From for Primitive<'v> { - fn from(v: char) -> Self { - Primitive::Char(v) - } -} - -impl<'v> From<&'v str> for Primitive<'v> { - fn from(v: &'v str) -> Self { - Primitive::Str(v) - } -} - -impl<'v> From> for Primitive<'v> { - fn from(v: fmt::Arguments<'v>) -> Self { - Primitive::Fmt(v) - } -} - -/// A downcastable dynamic type. -pub(super) struct Erased<'v, T: ?Sized> { - type_id: TypeId, - inner: &'v T, -} - -impl<'v, T: ?Sized> Clone for Erased<'v, T> { - fn clone(&self) -> Self { - Erased { - type_id: self.type_id, - inner: self.inner, - } - } -} - -impl<'v, T: ?Sized> Copy for Erased<'v, T> {} - -impl<'v, T: ?Sized> Erased<'v, T> { - // SAFETY: `U: Unsize` and the underlying value `T` must not change - // We could add a safe variant of this method with the `Unsize` trait - pub(super) unsafe fn new_unchecked(inner: &'v T) -> Self - where - U: 'static, - T: 'static, - { - Erased { - type_id: TypeId::of::(), - inner, - } - } - - pub(super) fn get(self) -> &'v T { - self.inner - } - - // SAFETY: The underlying type of `T` is `U` - pub(super) unsafe fn downcast_unchecked(self) -> &'v U { - &*(self.inner as *const T as *const U) - } -} diff --git a/third_party/cargo/vendor/log-0.4.11/src/kv/value/internal/sval.rs b/third_party/cargo/vendor/log-0.4.11/src/kv/value/internal/sval.rs deleted file mode 100644 index 618a036..0000000 --- a/third_party/cargo/vendor/log-0.4.11/src/kv/value/internal/sval.rs +++ /dev/null @@ -1,210 +0,0 @@ -//! Integration between `Value` and `sval`. -//! -//! This module allows any `Value` to implement the `sval::Value` trait, -//! and for any `sval::Value` to be captured as a `Value`. - -extern crate sval; - -use std::fmt; - -use super::cast::Cast; -use super::{Erased, Inner, Primitive, Visitor}; -use crate::kv; -use crate::kv::value::{Error, Slot}; - -impl<'v> kv::Value<'v> { - /// Get a value from a structured type. - pub fn from_sval(value: &'v T) -> Self - where - T: sval::Value + 'static, - { - kv::Value { - inner: Inner::Sval(unsafe { Erased::new_unchecked::(value) }), - } - } -} - -impl<'s, 'f> Slot<'s, 'f> { - /// Fill the slot with a structured value. - /// - /// The given value doesn't need to satisfy any particular lifetime constraints. - /// - /// # Panics - /// - /// Calling more than a single `fill` method on this slot will panic. - pub fn fill_sval(&mut self, value: T) -> Result<(), Error> - where - T: sval::Value, - { - self.fill(|visitor| visitor.sval(&value)) - } -} - -impl<'v> sval::Value for kv::Value<'v> { - fn stream(&self, s: &mut sval::value::Stream) -> sval::value::Result { - struct SvalVisitor<'a, 'b: 'a>(&'a mut sval::value::Stream<'b>); - - impl<'a, 'b: 'a, 'v> Visitor<'v> for SvalVisitor<'a, 'b> { - fn debug(&mut self, v: &dyn fmt::Debug) -> Result<(), Error> { - self.0 - .fmt(format_args!("{:?}", v)) - .map_err(Error::from_sval) - } - - fn u64(&mut self, v: u64) -> Result<(), Error> { - self.0.u64(v).map_err(Error::from_sval) - } - - fn i64(&mut self, v: i64) -> Result<(), Error> { - self.0.i64(v).map_err(Error::from_sval) - } - - fn f64(&mut self, v: f64) -> Result<(), Error> { - self.0.f64(v).map_err(Error::from_sval) - } - - fn bool(&mut self, v: bool) -> Result<(), Error> { - self.0.bool(v).map_err(Error::from_sval) - } - - fn char(&mut self, v: char) -> Result<(), Error> { - self.0.char(v).map_err(Error::from_sval) - } - - fn str(&mut self, v: &str) -> Result<(), Error> { - self.0.str(v).map_err(Error::from_sval) - } - - fn none(&mut self) -> Result<(), Error> { - self.0.none().map_err(Error::from_sval) - } - - fn sval(&mut self, v: &dyn sval::Value) -> Result<(), Error> { - self.0.any(v).map_err(Error::from_sval) - } - } - - self.visit(&mut SvalVisitor(s)).map_err(Error::into_sval)?; - - Ok(()) - } -} - -pub(in kv::value) use self::sval::Value; - -pub(super) fn fmt(f: &mut fmt::Formatter, v: &dyn sval::Value) -> Result<(), Error> { - sval::fmt::debug(f, v)?; - Ok(()) -} - -pub(super) fn cast<'v>(v: &dyn sval::Value) -> Cast<'v> { - struct CastStream<'v>(Cast<'v>); - - impl<'v> sval::Stream for CastStream<'v> { - fn u64(&mut self, v: u64) -> sval::stream::Result { - self.0 = Cast::Primitive(Primitive::Unsigned(v)); - Ok(()) - } - - fn i64(&mut self, v: i64) -> sval::stream::Result { - self.0 = Cast::Primitive(Primitive::Signed(v)); - Ok(()) - } - - fn f64(&mut self, v: f64) -> sval::stream::Result { - self.0 = Cast::Primitive(Primitive::Float(v)); - Ok(()) - } - - fn char(&mut self, v: char) -> sval::stream::Result { - self.0 = Cast::Primitive(Primitive::Char(v)); - Ok(()) - } - - fn bool(&mut self, v: bool) -> sval::stream::Result { - self.0 = Cast::Primitive(Primitive::Bool(v)); - Ok(()) - } - - #[cfg(feature = "std")] - fn str(&mut self, s: &str) -> sval::stream::Result { - self.0 = Cast::String(s.into()); - Ok(()) - } - } - - let mut cast = CastStream(Cast::Primitive(Primitive::None)); - let _ = sval::stream(&mut cast, v); - - cast.0 -} - -impl Error { - fn from_sval(_: sval::value::Error) -> Self { - Error::msg("`sval` serialization failed") - } - - fn into_sval(self) -> sval::value::Error { - sval::value::Error::msg("`sval` serialization failed") - } -} - -#[cfg(test)] -mod tests { - use super::*; - use kv::value::test::Token; - - #[test] - fn test_from_sval() { - assert_eq!(kv::Value::from_sval(&42u64).to_token(), Token::Sval); - } - - #[test] - fn test_sval_structured() { - let value = kv::Value::from(42u64); - let expected = vec![sval::test::Token::Unsigned(42)]; - - assert_eq!(sval::test::tokens(value), expected); - } - - #[test] - fn sval_cast() { - assert_eq!( - 42u32, - kv::Value::from_sval(&42u64) - .to_u32() - .expect("invalid value") - ); - - assert_eq!( - "a string", - kv::Value::from_sval(&"a string") - .to_borrowed_str() - .expect("invalid value") - ); - - #[cfg(feature = "std")] - assert_eq!( - "a string", - kv::Value::from_sval(&"a string") - .to_str() - .expect("invalid value") - ); - } - - #[test] - fn sval_debug() { - struct TestSval; - - impl sval::Value for TestSval { - fn stream(&self, stream: &mut sval::value::Stream) -> sval::value::Result { - stream.u64(42) - } - } - - assert_eq!( - format!("{:04?}", 42u64), - format!("{:04?}", kv::Value::from_sval(&TestSval)), - ); - } -} diff --git a/third_party/cargo/vendor/log-0.4.11/src/kv/value/mod.rs b/third_party/cargo/vendor/log-0.4.11/src/kv/value/mod.rs deleted file mode 100644 index 1d59dbf..0000000 --- a/third_party/cargo/vendor/log-0.4.11/src/kv/value/mod.rs +++ /dev/null @@ -1,56 +0,0 @@ -//! Structured values. - -mod fill; -mod impls; -mod internal; - -#[cfg(test)] -pub(in kv) mod test; - -pub use self::fill::{Fill, Slot}; -pub use kv::Error; - -use self::internal::{Inner, Primitive, Visitor}; - -/// A type that can be converted into a [`Value`](struct.Value.html). -pub trait ToValue { - /// Perform the conversion. - fn to_value(&self) -> Value; -} - -impl<'a, T> ToValue for &'a T -where - T: ToValue + ?Sized, -{ - fn to_value(&self) -> Value { - (**self).to_value() - } -} - -impl<'v> ToValue for Value<'v> { - fn to_value(&self) -> Value { - Value { inner: self.inner } - } -} - -/// A value in a structured key-value pair. -pub struct Value<'v> { - inner: Inner<'v>, -} - -impl<'v> Value<'v> { - /// Get a value from an internal primitive. - fn from_primitive(value: T) -> Self - where - T: Into>, - { - Value { - inner: Inner::Primitive(value.into()), - } - } - - /// Visit the value using an internal visitor. - fn visit<'a>(&'a self, visitor: &mut dyn Visitor<'a>) -> Result<(), Error> { - self.inner.visit(visitor) - } -} diff --git a/third_party/cargo/vendor/log-0.4.11/src/kv/value/test.rs b/third_party/cargo/vendor/log-0.4.11/src/kv/value/test.rs deleted file mode 100644 index c8d6d5c..0000000 --- a/third_party/cargo/vendor/log-0.4.11/src/kv/value/test.rs +++ /dev/null @@ -1,81 +0,0 @@ -// Test support for inspecting Values - -use std::fmt; -use std::str; - -use super::internal; -use super::{Error, Value}; - -#[derive(Debug, PartialEq)] -pub(in kv) enum Token { - U64(u64), - I64(i64), - F64(f64), - Char(char), - Bool(bool), - Str(String), - None, - - #[cfg(feature = "kv_unstable_sval")] - Sval, -} - -#[cfg(test)] -impl<'v> Value<'v> { - pub(in kv) fn to_token(&self) -> Token { - struct TestVisitor(Option); - - impl<'v> internal::Visitor<'v> for TestVisitor { - fn debug(&mut self, v: &dyn fmt::Debug) -> Result<(), Error> { - self.0 = Some(Token::Str(format!("{:?}", v))); - Ok(()) - } - - fn u64(&mut self, v: u64) -> Result<(), Error> { - self.0 = Some(Token::U64(v)); - Ok(()) - } - - fn i64(&mut self, v: i64) -> Result<(), Error> { - self.0 = Some(Token::I64(v)); - Ok(()) - } - - fn f64(&mut self, v: f64) -> Result<(), Error> { - self.0 = Some(Token::F64(v)); - Ok(()) - } - - fn bool(&mut self, v: bool) -> Result<(), Error> { - self.0 = Some(Token::Bool(v)); - Ok(()) - } - - fn char(&mut self, v: char) -> Result<(), Error> { - self.0 = Some(Token::Char(v)); - Ok(()) - } - - fn str(&mut self, v: &str) -> Result<(), Error> { - self.0 = Some(Token::Str(v.into())); - Ok(()) - } - - fn none(&mut self) -> Result<(), Error> { - self.0 = Some(Token::None); - Ok(()) - } - - #[cfg(feature = "kv_unstable_sval")] - fn sval(&mut self, _: &dyn internal::sval::Value) -> Result<(), Error> { - self.0 = Some(Token::Sval); - Ok(()) - } - } - - let mut visitor = TestVisitor(None); - self.visit(&mut visitor).unwrap(); - - visitor.0.unwrap() - } -} diff --git a/third_party/cargo/vendor/log-0.4.11/tests/filters.rs b/third_party/cargo/vendor/log-0.4.11/tests/filters.rs deleted file mode 100644 index 661c034..0000000 --- a/third_party/cargo/vendor/log-0.4.11/tests/filters.rs +++ /dev/null @@ -1,72 +0,0 @@ -#[macro_use] -extern crate log; - -use log::{Level, LevelFilter, Log, Metadata, Record}; -use std::sync::{Arc, Mutex}; - -#[cfg(feature = "std")] -use log::set_boxed_logger; - -#[cfg(not(feature = "std"))] -fn set_boxed_logger(logger: Box) -> Result<(), log::SetLoggerError> { - log::set_logger(Box::leak(logger)) -} - -struct State { - last_log: Mutex>, -} - -struct Logger(Arc); - -impl Log for Logger { - fn enabled(&self, _: &Metadata) -> bool { - true - } - - fn log(&self, record: &Record) { - *self.0.last_log.lock().unwrap() = Some(record.level()); - } - fn flush(&self) {} -} - -fn main() { - let me = Arc::new(State { - last_log: Mutex::new(None), - }); - let a = me.clone(); - set_boxed_logger(Box::new(Logger(me))).unwrap(); - - test(&a, LevelFilter::Off); - test(&a, LevelFilter::Error); - test(&a, LevelFilter::Warn); - test(&a, LevelFilter::Info); - test(&a, LevelFilter::Debug); - test(&a, LevelFilter::Trace); -} - -fn test(a: &State, filter: LevelFilter) { - log::set_max_level(filter); - error!(""); - last(&a, t(Level::Error, filter)); - warn!(""); - last(&a, t(Level::Warn, filter)); - info!(""); - last(&a, t(Level::Info, filter)); - debug!(""); - last(&a, t(Level::Debug, filter)); - trace!(""); - last(&a, t(Level::Trace, filter)); - - fn t(lvl: Level, filter: LevelFilter) -> Option { - if lvl <= filter { - Some(lvl) - } else { - None - } - } -} - -fn last(state: &State, expected: Option) { - let lvl = state.last_log.lock().unwrap().take(); - assert_eq!(lvl, expected); -} diff --git a/third_party/cargo/vendor/log-0.4.11/tests/macros.rs b/third_party/cargo/vendor/log-0.4.11/tests/macros.rs deleted file mode 100644 index e9dc133..0000000 --- a/third_party/cargo/vendor/log-0.4.11/tests/macros.rs +++ /dev/null @@ -1,36 +0,0 @@ -#[macro_use] -extern crate log; - -#[test] -fn base() { - info!("hello"); - info!("hello",); -} - -#[test] -fn base_expr_context() { - let _ = info!("hello"); -} - -#[test] -fn with_args() { - info!("hello {}", "cats"); - info!("hello {}", "cats",); - info!("hello {}", "cats",); -} - -#[test] -fn with_args_expr_context() { - match "cats" { - cats => info!("hello {}", cats), - }; -} - -#[test] -fn with_named_args() { - let cats = "cats"; - - info!("hello {cats}", cats = cats); - info!("hello {cats}", cats = cats,); - info!("hello {cats}", cats = cats,); -} diff --git a/third_party/cargo/vendor/log-0.4.14/.cargo-checksum.json b/third_party/cargo/vendor/log-0.4.14/.cargo-checksum.json new file mode 100644 index 0000000..e6244f0 --- /dev/null +++ b/third_party/cargo/vendor/log-0.4.14/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"5fa3f03a8dfa3934f5b1cfba9a41781700ed6e67afe0f10717cc16b6855ceb16","Cargo.toml":"2863cdd3382ede73ecc608ad22a4d8ee476abed3b0016f9724deba59e9317338","LICENSE-APACHE":"7cfd738c53d61c79f07e348f622bf7707c9084237054d37fbe07788a75f5881c","LICENSE-MIT":"705aaaaecefa087c187bd2eacdb01b8ac1c5ee95b1d5d04d8d7efe0363207df8","README.md":"ca758a44f4a226f21b3bc997d27a5356b5e77ee13a1daad24ee8bbbebb301c5d","benches/value.rs":"55bd5f795a524f0699b2858eb14cc456abebeb43d50c90d2bfc77cd7856e8050","build.rs":"2bfb7564209da7c4d10433d9639d33541a89d63fc52cbe47d479a967cf746769","src/kv/error.rs":"ba46a4bcac717e6dc58fc5101833c825d7b95777c1dd907be46c8fa573a27d2d","src/kv/key.rs":"e74b489cde28960f76d4038b02867b4cb724c206d31abd461abeaa04e73cf7ef","src/kv/mod.rs":"9d916f43fd9c2829991fcff6db32f23bb7864e1113a622d49e59f110e2f290cf","src/kv/source.rs":"3f7aadc5f30c0c821fd20d899d8529eba8088eeda0c8603814de689da25dd4e8","src/kv/value.rs":"4d46ced0adbe385701c1d80d03c0f2abde2e43acf16521a9d26f058462f43799","src/lib.rs":"320a18401e7f9edc812a52b5be029fb9ef8c6d7435ab7b52650878477d21103b","src/macros.rs":"b0174b17f5e06b6a7bafb7873c79c7f8e2c70a531686adf03c027739ee040a44","src/serde.rs":"d8190561ed64398fe45142b261000255ea1bcda8707e6f1b07ef4b805da6829b","triagebot.toml":"2d1d46d069bc4e3739069676707ca2801e0e0ba58a784a264392362ff9ac4a77"},"package":"51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"} \ No newline at end of file diff --git a/third_party/cargo/vendor/log-0.4.11/BUILD.bazel b/third_party/cargo/vendor/log-0.4.14/BUILD.bazel similarity index 89% rename from third_party/cargo/vendor/log-0.4.11/BUILD.bazel rename to third_party/cargo/vendor/log-0.4.14/BUILD.bazel index 248f271..0b35c9a 100644 --- a/third_party/cargo/vendor/log-0.4.11/BUILD.bazel +++ b/third_party/cargo/vendor/log-0.4.14/BUILD.bazel @@ -30,6 +30,8 @@ licenses([ # Generated Targets +# Unsupported target "value" with type "bench" omitted + # Unsupported target "build-script-build" with type "custom-build" omitted rust_library( @@ -50,10 +52,10 @@ rust_library( "cargo-raze", "manual", ], - version = "0.4.11", + version = "0.4.14", # buildifier: leave-alone deps = [ - "//third_party/cargo/vendor/cfg-if-0.1.10:cfg_if", + "//third_party/cargo/vendor/cfg-if-1.0.0:cfg_if", ], ) diff --git a/third_party/cargo/vendor/log-0.4.11/CHANGELOG.md b/third_party/cargo/vendor/log-0.4.14/CHANGELOG.md similarity index 82% rename from third_party/cargo/vendor/log-0.4.11/CHANGELOG.md rename to third_party/cargo/vendor/log-0.4.14/CHANGELOG.md index 296b49b..63c3ccd 100644 --- a/third_party/cargo/vendor/log-0.4.11/CHANGELOG.md +++ b/third_party/cargo/vendor/log-0.4.14/CHANGELOG.md @@ -2,6 +2,32 @@ ## [Unreleased] +## [0.4.14] - 2021-01-27 + +* Remove the `__private_api_log_lit` special case. +* Fixed incorrect combination of `kv_unstable` and `std` features causing compile failures. +* Remove unstable `Value::to_*` conversions that were incorrectly using `as`. +* Rename unstable `Value::to_error` to `Value::to_borrowed_error`. + +## [0.4.13] - 2021-01-11 + +* This is the same as `0.4.11`, except with a `kv_unstable_std` feature added to aid migrating current dependents to `0.4.14` (which was originally going to be `0.4.13` until it was decided to create a patch from `0.4.11` to minimize disruption). + +## [0.4.12] - 2020-12-24 + +### New + +* Support platforms without atomics by racing instead of failing to compile +* Implement `Log` for `Box` +* Update `cfg-if` to `1.0` +* Internal reworks of the structured logging API. Removed the `Fill` API +and added `source::as_map` and `source::as_list` to easily serialize a `Source` +as either a map of `{key: value, ..}` or as a list of `[(key, value), ..]`. + +### Fixed + +* Fixed deserialization of `LevelFilter` to use their `u64` index variants + ## [0.4.11] - 2020-07-09 ### New @@ -170,7 +196,10 @@ version using log 0.4.x to avoid losing module and file information. Look at the [release tags] for information about older releases. -[Unreleased]: https://github.com/rust-lang-nursery/log/compare/0.4.11...HEAD +[Unreleased]: https://github.com/rust-lang-nursery/log/compare/0.4.14...HEAD +[0.4.14]: https://github.com/rust-lang-nursery/log/compare/0.4.13...0.4.14 +[0.4.13]: https://github.com/rust-lang-nursery/log/compare/0.4.11...0.4.13 +[0.4.12]: https://github.com/rust-lang-nursery/log/compare/0.4.11...0.4.12 [0.4.11]: https://github.com/rust-lang-nursery/log/compare/0.4.10...0.4.11 [0.4.10]: https://github.com/rust-lang-nursery/log/compare/0.4.9...0.4.10 [0.4.9]: https://github.com/rust-lang-nursery/log/compare/0.4.8...0.4.9 diff --git a/third_party/cargo/vendor/log-0.4.11/Cargo.toml b/third_party/cargo/vendor/log-0.4.14/Cargo.toml similarity index 70% rename from third_party/cargo/vendor/log-0.4.11/Cargo.toml rename to third_party/cargo/vendor/log-0.4.14/Cargo.toml index bd654d2..3cbe5e0 100644 --- a/third_party/cargo/vendor/log-0.4.11/Cargo.toml +++ b/third_party/cargo/vendor/log-0.4.14/Cargo.toml @@ -12,7 +12,7 @@ [package] name = "log" -version = "0.4.11" +version = "0.4.14" authors = ["The Rust Project Developers"] build = "build.rs" exclude = ["rfcs/**/*", "/.travis.yml", "/appveyor.yml"] @@ -24,17 +24,19 @@ categories = ["development-tools::debugging"] license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/log" [package.metadata.docs.rs] -features = ["std", "serde", "kv_unstable_sval"] +features = ["std", "serde", "kv_unstable_std", "kv_unstable_sval", "kv_unstable_serde"] [[test]] name = "filters" +path = "tests/filters.rs" harness = false [[test]] name = "macros" +path = "tests/macros.rs" harness = true [dependencies.cfg-if] -version = "0.1.2" +version = "1.0" [dependencies.serde] version = "1.0" @@ -42,19 +44,34 @@ optional = true default-features = false [dependencies.sval] -version = "0.5.2" +version = "1.0.0-alpha.5" optional = true default-features = false + +[dependencies.value-bag] +version = "1.0.0-alpha.6" +optional = true +default-features = false +[dev-dependencies.serde] +version = "1.0" +features = ["derive"] + [dev-dependencies.serde_test] version = "1.0" [dev-dependencies.sval] -version = "0.5.2" +version = "1.0.0-alpha.5" +features = ["derive"] + +[dev-dependencies.value-bag] +version = "1.0.0-alpha.6" features = ["test"] [features] -kv_unstable = [] -kv_unstable_sval = ["kv_unstable", "sval/fmt"] +kv_unstable = ["value-bag"] +kv_unstable_serde = ["kv_unstable_std", "value-bag/serde", "serde"] +kv_unstable_std = ["std", "kv_unstable", "value-bag/error"] +kv_unstable_sval = ["kv_unstable", "value-bag/sval", "sval"] max_level_debug = [] max_level_error = [] max_level_info = [] diff --git a/third_party/cargo/vendor/log-0.4.11/LICENSE-APACHE b/third_party/cargo/vendor/log-0.4.14/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/log-0.4.11/LICENSE-APACHE rename to third_party/cargo/vendor/log-0.4.14/LICENSE-APACHE diff --git a/third_party/cargo/vendor/log-0.4.11/LICENSE-MIT b/third_party/cargo/vendor/log-0.4.14/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/log-0.4.11/LICENSE-MIT rename to third_party/cargo/vendor/log-0.4.14/LICENSE-MIT diff --git a/third_party/cargo/vendor/log-0.4.11/README.md b/third_party/cargo/vendor/log-0.4.14/README.md similarity index 100% rename from third_party/cargo/vendor/log-0.4.11/README.md rename to third_party/cargo/vendor/log-0.4.14/README.md diff --git a/third_party/cargo/vendor/log-0.4.14/benches/value.rs b/third_party/cargo/vendor/log-0.4.14/benches/value.rs new file mode 100644 index 0000000..3dab3bf --- /dev/null +++ b/third_party/cargo/vendor/log-0.4.14/benches/value.rs @@ -0,0 +1,30 @@ +#![cfg(feature = "kv_unstable")] +#![feature(test)] + +extern crate log; +extern crate test; + +use log::kv::Value; + +#[bench] +fn u8_to_value(b: &mut test::Bencher) { + b.iter(|| Value::from(1u8)) +} + +#[bench] +fn u8_to_value_debug(b: &mut test::Bencher) { + b.iter(|| Value::from_debug(&1u8)) +} + +#[bench] +fn str_to_value_debug(b: &mut test::Bencher) { + b.iter(|| Value::from_debug(&"a string")) +} + +#[bench] +fn custom_to_value_debug(b: &mut test::Bencher) { + #[derive(Debug)] + struct A; + + b.iter(|| Value::from_debug(&A)) +} diff --git a/third_party/cargo/vendor/log-0.4.14/build.rs b/third_party/cargo/vendor/log-0.4.14/build.rs new file mode 100644 index 0000000..22cfa78 --- /dev/null +++ b/third_party/cargo/vendor/log-0.4.14/build.rs @@ -0,0 +1,43 @@ +//! This build script detects target platforms that lack proper support for +//! atomics and sets `cfg` flags accordingly. + +use std::env; +use std::str; + +fn main() { + let target = match rustc_target() { + Some(target) => target, + None => return, + }; + + if target_has_atomic_cas(&target) { + println!("cargo:rustc-cfg=atomic_cas"); + } + + if target_has_atomics(&target) { + println!("cargo:rustc-cfg=has_atomics"); + } + + println!("cargo:rerun-if-changed=build.rs"); +} + +fn target_has_atomic_cas(target: &str) -> bool { + match &target[..] { + "thumbv6m-none-eabi" + | "msp430-none-elf" + | "riscv32i-unknown-none-elf" + | "riscv32imc-unknown-none-elf" => false, + _ => true, + } +} + +fn target_has_atomics(target: &str) -> bool { + match &target[..] { + "msp430-none-elf" | "riscv32i-unknown-none-elf" | "riscv32imc-unknown-none-elf" => false, + _ => true, + } +} + +fn rustc_target() -> Option { + env::var("TARGET").ok() +} diff --git a/third_party/cargo/vendor/log-0.4.11/src/kv/error.rs b/third_party/cargo/vendor/log-0.4.14/src/kv/error.rs similarity index 100% rename from third_party/cargo/vendor/log-0.4.11/src/kv/error.rs rename to third_party/cargo/vendor/log-0.4.14/src/kv/error.rs diff --git a/third_party/cargo/vendor/log-0.4.11/src/kv/key.rs b/third_party/cargo/vendor/log-0.4.14/src/kv/key.rs similarity index 75% rename from third_party/cargo/vendor/log-0.4.11/src/kv/key.rs rename to third_party/cargo/vendor/log-0.4.14/src/kv/key.rs index 367f6ed..0e688c1 100644 --- a/third_party/cargo/vendor/log-0.4.11/src/kv/key.rs +++ b/third_party/cargo/vendor/log-0.4.14/src/kv/key.rs @@ -128,6 +128,39 @@ mod std_support { } } +#[cfg(feature = "kv_unstable_sval")] +mod sval_support { + use super::*; + + extern crate sval; + + use self::sval::value::{self, Value}; + + impl<'a> Value for Key<'a> { + fn stream(&self, stream: &mut value::Stream) -> value::Result { + self.key.stream(stream) + } + } +} + +#[cfg(feature = "kv_unstable_serde")] +mod serde_support { + use super::*; + + extern crate serde; + + use self::serde::{Serialize, Serializer}; + + impl<'a> Serialize for Key<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + self.key.serialize(serializer) + } + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/third_party/cargo/vendor/log-0.4.11/src/kv/mod.rs b/third_party/cargo/vendor/log-0.4.14/src/kv/mod.rs similarity index 93% rename from third_party/cargo/vendor/log-0.4.11/src/kv/mod.rs rename to third_party/cargo/vendor/log-0.4.14/src/kv/mod.rs index f4c0866..f96b821 100644 --- a/third_party/cargo/vendor/log-0.4.11/src/kv/mod.rs +++ b/third_party/cargo/vendor/log-0.4.14/src/kv/mod.rs @@ -14,7 +14,7 @@ mod error; mod key; -mod source; +pub mod source; pub mod value; diff --git a/third_party/cargo/vendor/log-0.4.14/src/kv/source.rs b/third_party/cargo/vendor/log-0.4.14/src/kv/source.rs new file mode 100644 index 0000000..e3ecde9 --- /dev/null +++ b/third_party/cargo/vendor/log-0.4.14/src/kv/source.rs @@ -0,0 +1,754 @@ +//! Sources for key-value pairs. + +#[cfg(feature = "kv_unstable_sval")] +extern crate sval; + +#[cfg(feature = "kv_unstable_serde")] +extern crate serde; + +use kv::{Error, Key, ToKey, ToValue, Value}; +use std::fmt; + +/// A source of key-value pairs. +/// +/// The source may be a single pair, a set of pairs, or a filter over a set of pairs. +/// Use the [`Visitor`](trait.Visitor.html) trait to inspect the structured data +/// in a source. +pub trait Source { + /// Visit key-value pairs. + /// + /// A source doesn't have to guarantee any ordering or uniqueness of key-value pairs. + /// If the given visitor returns an error then the source may early-return with it, + /// even if there are more key-value pairs. + /// + /// # Implementation notes + /// + /// A source should yield the same key-value pairs to a subsequent visitor unless + /// that visitor itself fails. + fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error>; + + /// Get the value for a given key. + /// + /// If the key appears multiple times in the source then which key is returned + /// is implementation specific. + /// + /// # Implementation notes + /// + /// A source that can provide a more efficient implementation of this method + /// should override it. + #[cfg(not(test))] + fn get<'v>(&'v self, key: Key) -> Option> { + get_default(self, key) + } + + #[cfg(test)] + fn get<'v>(&'v self, key: Key) -> Option>; + + /// Count the number of key-value pairs that can be visited. + /// + /// # Implementation notes + /// + /// A source that knows the number of key-value pairs upfront may provide a more + /// efficient implementation. + /// + /// A subsequent call to `visit` should yield the same number of key-value pairs + /// to the visitor, unless that visitor fails part way through. + #[cfg(not(test))] + fn count(&self) -> usize { + count_default(self) + } + + #[cfg(test)] + fn count(&self) -> usize; +} + +/// The default implemention of `Source::get` +pub(crate) fn get_default<'v>(source: &'v (impl Source + ?Sized), key: Key) -> Option> { + struct Get<'k, 'v> { + key: Key<'k>, + found: Option>, + } + + impl<'k, 'kvs> Visitor<'kvs> for Get<'k, 'kvs> { + fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { + if self.key == key { + self.found = Some(value); + } + + Ok(()) + } + } + + let mut get = Get { key, found: None }; + + let _ = source.visit(&mut get); + get.found +} + +/// The default implementation of `Source::count`. +pub(crate) fn count_default(source: impl Source) -> usize { + struct Count(usize); + + impl<'kvs> Visitor<'kvs> for Count { + fn visit_pair(&mut self, _: Key<'kvs>, _: Value<'kvs>) -> Result<(), Error> { + self.0 += 1; + + Ok(()) + } + } + + let mut count = Count(0); + let _ = source.visit(&mut count); + count.0 +} + +impl<'a, T> Source for &'a T +where + T: Source + ?Sized, +{ + fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { + Source::visit(&**self, visitor) + } + + fn get<'v>(&'v self, key: Key) -> Option> { + Source::get(&**self, key) + } + + fn count(&self) -> usize { + Source::count(&**self) + } +} + +impl Source for (K, V) +where + K: ToKey, + V: ToValue, +{ + fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { + visitor.visit_pair(self.0.to_key(), self.1.to_value()) + } + + fn get<'v>(&'v self, key: Key) -> Option> { + if self.0.to_key() == key { + Some(self.1.to_value()) + } else { + None + } + } + + fn count(&self) -> usize { + 1 + } +} + +impl Source for [S] +where + S: Source, +{ + fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { + for source in self { + source.visit(visitor)?; + } + + Ok(()) + } + + fn get<'v>(&'v self, key: Key) -> Option> { + for source in self { + if let Some(found) = source.get(key.clone()) { + return Some(found); + } + } + + None + } + + fn count(&self) -> usize { + self.len() + } +} + +impl Source for Option +where + S: Source, +{ + fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { + if let Some(ref source) = *self { + source.visit(visitor)?; + } + + Ok(()) + } + + fn get<'v>(&'v self, key: Key) -> Option> { + self.as_ref().and_then(|s| s.get(key)) + } + + fn count(&self) -> usize { + self.as_ref().map(Source::count).unwrap_or(0) + } +} + +/// A visitor for the key-value pairs in a [`Source`](trait.Source.html). +pub trait Visitor<'kvs> { + /// Visit a key-value pair. + fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error>; +} + +impl<'a, 'kvs, T> Visitor<'kvs> for &'a mut T +where + T: Visitor<'kvs> + ?Sized, +{ + fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { + (**self).visit_pair(key, value) + } +} + +impl<'a, 'b: 'a, 'kvs> Visitor<'kvs> for fmt::DebugMap<'a, 'b> { + fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { + self.entry(&key, &value); + Ok(()) + } +} + +impl<'a, 'b: 'a, 'kvs> Visitor<'kvs> for fmt::DebugList<'a, 'b> { + fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { + self.entry(&(key, value)); + Ok(()) + } +} + +impl<'a, 'b: 'a, 'kvs> Visitor<'kvs> for fmt::DebugSet<'a, 'b> { + fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { + self.entry(&(key, value)); + Ok(()) + } +} + +impl<'a, 'b: 'a, 'kvs> Visitor<'kvs> for fmt::DebugTuple<'a, 'b> { + fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { + self.field(&key); + self.field(&value); + Ok(()) + } +} + +#[cfg(feature = "std")] +mod std_support { + use super::*; + use std::borrow::Borrow; + use std::collections::{BTreeMap, HashMap}; + use std::hash::{BuildHasher, Hash}; + + impl Source for Box + where + S: Source + ?Sized, + { + fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { + Source::visit(&**self, visitor) + } + + fn get<'v>(&'v self, key: Key) -> Option> { + Source::get(&**self, key) + } + + fn count(&self) -> usize { + Source::count(&**self) + } + } + + impl Source for Vec + where + S: Source, + { + fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { + Source::visit(&**self, visitor) + } + + fn get<'v>(&'v self, key: Key) -> Option> { + Source::get(&**self, key) + } + + fn count(&self) -> usize { + Source::count(&**self) + } + } + + impl<'kvs, V> Visitor<'kvs> for Box + where + V: Visitor<'kvs> + ?Sized, + { + fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { + (**self).visit_pair(key, value) + } + } + + impl Source for HashMap + where + K: ToKey + Borrow + Eq + Hash, + V: ToValue, + S: BuildHasher, + { + fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { + for (key, value) in self { + visitor.visit_pair(key.to_key(), value.to_value())?; + } + Ok(()) + } + + fn get<'v>(&'v self, key: Key) -> Option> { + HashMap::get(self, key.as_str()).map(|v| v.to_value()) + } + + fn count(&self) -> usize { + self.len() + } + } + + impl Source for BTreeMap + where + K: ToKey + Borrow + Ord, + V: ToValue, + { + fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { + for (key, value) in self { + visitor.visit_pair(key.to_key(), value.to_value())?; + } + Ok(()) + } + + fn get<'v>(&'v self, key: Key) -> Option> { + BTreeMap::get(self, key.as_str()).map(|v| v.to_value()) + } + + fn count(&self) -> usize { + self.len() + } + } + + #[cfg(test)] + mod tests { + use super::*; + use kv::value::tests::Token; + use std::collections::{BTreeMap, HashMap}; + + #[test] + fn count() { + assert_eq!(1, Source::count(&Box::new(("a", 1)))); + assert_eq!(2, Source::count(&vec![("a", 1), ("b", 2)])); + } + + #[test] + fn get() { + let source = vec![("a", 1), ("b", 2), ("a", 1)]; + assert_eq!( + Token::I64(1), + Source::get(&source, Key::from_str("a")).unwrap().to_token() + ); + + let source = Box::new(Option::None::<(&str, i32)>); + assert!(Source::get(&source, Key::from_str("a")).is_none()); + } + + #[test] + fn hash_map() { + let mut map = HashMap::new(); + map.insert("a", 1); + map.insert("b", 2); + + assert_eq!(2, Source::count(&map)); + assert_eq!( + Token::I64(1), + Source::get(&map, Key::from_str("a")).unwrap().to_token() + ); + } + + #[test] + fn btree_map() { + let mut map = BTreeMap::new(); + map.insert("a", 1); + map.insert("b", 2); + + assert_eq!(2, Source::count(&map)); + assert_eq!( + Token::I64(1), + Source::get(&map, Key::from_str("a")).unwrap().to_token() + ); + } + } +} + +/// The result of calling `Source::as_map`. +pub struct AsMap(S); + +/// Visit this source as a map. +pub fn as_map(source: S) -> AsMap +where + S: Source, +{ + AsMap(source) +} + +impl Source for AsMap +where + S: Source, +{ + fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { + self.0.visit(visitor) + } + + fn get<'v>(&'v self, key: Key) -> Option> { + self.0.get(key) + } + + fn count(&self) -> usize { + self.0.count() + } +} + +impl fmt::Debug for AsMap +where + S: Source, +{ + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let mut f = f.debug_map(); + self.0.visit(&mut f).map_err(|_| fmt::Error)?; + f.finish() + } +} + +/// The result of calling `Source::as_list` +pub struct AsList(S); + +/// Visit this source as a list. +pub fn as_list(source: S) -> AsList +where + S: Source, +{ + AsList(source) +} + +impl Source for AsList +where + S: Source, +{ + fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { + self.0.visit(visitor) + } + + fn get<'v>(&'v self, key: Key) -> Option> { + self.0.get(key) + } + + fn count(&self) -> usize { + self.0.count() + } +} + +impl fmt::Debug for AsList +where + S: Source, +{ + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let mut f = f.debug_list(); + self.0.visit(&mut f).map_err(|_| fmt::Error)?; + f.finish() + } +} + +#[cfg(feature = "kv_unstable_sval")] +mod sval_support { + use super::*; + + use self::sval::value; + + impl value::Value for AsMap + where + S: Source, + { + fn stream(&self, stream: &mut value::Stream) -> value::Result { + struct StreamVisitor<'a, 'b>(&'a mut value::Stream<'b>); + + impl<'a, 'b, 'kvs> Visitor<'kvs> for StreamVisitor<'a, 'b> { + fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { + self.0 + .map_key(key) + .map_err(|_| Error::msg("failed to stream map key"))?; + self.0 + .map_value(value) + .map_err(|_| Error::msg("failed to stream map value"))?; + Ok(()) + } + } + + stream + .map_begin(Some(self.count())) + .map_err(|_| self::sval::Error::msg("failed to begin map"))?; + + self.visit(&mut StreamVisitor(stream)) + .map_err(|_| self::sval::Error::msg("failed to visit key-values"))?; + + stream + .map_end() + .map_err(|_| self::sval::Error::msg("failed to end map")) + } + } + + impl value::Value for AsList + where + S: Source, + { + fn stream(&self, stream: &mut value::Stream) -> value::Result { + struct StreamVisitor<'a, 'b>(&'a mut value::Stream<'b>); + + impl<'a, 'b, 'kvs> Visitor<'kvs> for StreamVisitor<'a, 'b> { + fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { + self.0 + .seq_elem((key, value)) + .map_err(|_| Error::msg("failed to stream seq entry"))?; + Ok(()) + } + } + + stream + .seq_begin(Some(self.count())) + .map_err(|_| self::sval::Error::msg("failed to begin seq"))?; + + self.visit(&mut StreamVisitor(stream)) + .map_err(|_| self::sval::Error::msg("failed to visit key-values"))?; + + stream + .seq_end() + .map_err(|_| self::sval::Error::msg("failed to end seq")) + } + } + + #[cfg(test)] + mod tests { + use super::*; + + use self::sval::Value; + + use crate::kv::source; + + #[test] + fn derive_stream() { + #[derive(Value)] + pub struct MyRecordAsMap<'a> { + msg: &'a str, + kvs: source::AsMap<&'a dyn Source>, + } + + #[derive(Value)] + pub struct MyRecordAsList<'a> { + msg: &'a str, + kvs: source::AsList<&'a dyn Source>, + } + } + } +} + +#[cfg(feature = "kv_unstable_serde")] +pub mod as_map { + //! `serde` adapters for serializing a `Source` as a map. + + use super::*; + + use self::serde::{Serialize, Serializer}; + + /// Serialize a `Source` as a map. + pub fn serialize(source: &T, serializer: S) -> Result + where + T: Source, + S: Serializer, + { + as_map(source).serialize(serializer) + } +} + +#[cfg(feature = "kv_unstable_serde")] +pub mod as_list { + //! `serde` adapters for serializing a `Source` as a list. + + use super::*; + + use self::serde::{Serialize, Serializer}; + + /// Serialize a `Source` as a list. + pub fn serialize(source: &T, serializer: S) -> Result + where + T: Source, + S: Serializer, + { + as_list(source).serialize(serializer) + } +} + +#[cfg(feature = "kv_unstable_serde")] +mod serde_support { + use super::*; + + use self::serde::ser::{Error as SerError, Serialize, SerializeMap, SerializeSeq, Serializer}; + + impl Serialize for AsMap + where + T: Source, + { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + struct SerializerVisitor<'a, S>(&'a mut S); + + impl<'a, 'kvs, S> Visitor<'kvs> for SerializerVisitor<'a, S> + where + S: SerializeMap, + { + fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { + self.0 + .serialize_entry(&key, &value) + .map_err(|_| Error::msg("failed to serialize map entry"))?; + Ok(()) + } + } + + let mut map = serializer.serialize_map(Some(self.count()))?; + + self.visit(&mut SerializerVisitor(&mut map)) + .map_err(|_| S::Error::custom("failed to visit key-values"))?; + + map.end() + } + } + + impl Serialize for AsList + where + T: Source, + { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + struct SerializerVisitor<'a, S>(&'a mut S); + + impl<'a, 'kvs, S> Visitor<'kvs> for SerializerVisitor<'a, S> + where + S: SerializeSeq, + { + fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { + self.0 + .serialize_element(&(key, value)) + .map_err(|_| Error::msg("failed to serialize seq entry"))?; + Ok(()) + } + } + + let mut seq = serializer.serialize_seq(Some(self.count()))?; + + self.visit(&mut SerializerVisitor(&mut seq)) + .map_err(|_| S::Error::custom("failed to visit seq"))?; + + seq.end() + } + } + + #[cfg(test)] + mod tests { + use super::*; + + use self::serde::Serialize; + + use crate::kv::source; + + #[test] + fn derive_serialize() { + #[derive(Serialize)] + pub struct MyRecordAsMap<'a> { + msg: &'a str, + #[serde(flatten)] + #[serde(with = "source::as_map")] + kvs: &'a dyn Source, + } + + #[derive(Serialize)] + pub struct MyRecordAsList<'a> { + msg: &'a str, + #[serde(flatten)] + #[serde(with = "source::as_list")] + kvs: &'a dyn Source, + } + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use kv::value::tests::Token; + + #[test] + fn source_is_object_safe() { + fn _check(_: &dyn Source) {} + } + + #[test] + fn visitor_is_object_safe() { + fn _check(_: &dyn Visitor) {} + } + + #[test] + fn count() { + struct OnePair { + key: &'static str, + value: i32, + } + + impl Source for OnePair { + fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error> { + visitor.visit_pair(self.key.to_key(), self.value.to_value()) + } + + fn get<'v>(&'v self, key: Key) -> Option> { + get_default(self, key) + } + + fn count(&self) -> usize { + count_default(self) + } + } + + assert_eq!(1, Source::count(&("a", 1))); + assert_eq!(2, Source::count(&[("a", 1), ("b", 2)] as &[_])); + assert_eq!(0, Source::count(&Option::None::<(&str, i32)>)); + assert_eq!(1, Source::count(&OnePair { key: "a", value: 1 })); + } + + #[test] + fn get() { + let source = &[("a", 1), ("b", 2), ("a", 1)] as &[_]; + assert_eq!( + Token::I64(1), + Source::get(source, Key::from_str("a")).unwrap().to_token() + ); + assert_eq!( + Token::I64(2), + Source::get(source, Key::from_str("b")).unwrap().to_token() + ); + assert!(Source::get(&source, Key::from_str("c")).is_none()); + + let source = Option::None::<(&str, i32)>; + assert!(Source::get(&source, Key::from_str("a")).is_none()); + } + + #[test] + fn as_map() { + let _ = crate::kv::source::as_map(("a", 1)); + let _ = crate::kv::source::as_map(&("a", 1) as &dyn Source); + } + + #[test] + fn as_list() { + let _ = crate::kv::source::as_list(("a", 1)); + let _ = crate::kv::source::as_list(&("a", 1) as &dyn Source); + } +} diff --git a/third_party/cargo/vendor/log-0.4.14/src/kv/value.rs b/third_party/cargo/vendor/log-0.4.14/src/kv/value.rs new file mode 100644 index 0000000..942d59e --- /dev/null +++ b/third_party/cargo/vendor/log-0.4.14/src/kv/value.rs @@ -0,0 +1,655 @@ +//! Structured values. + +use std::fmt; + +extern crate value_bag; + +#[cfg(feature = "kv_unstable_sval")] +extern crate sval; + +#[cfg(feature = "kv_unstable_serde")] +extern crate serde; + +use self::value_bag::ValueBag; + +pub use kv::Error; + +/// A type that can be converted into a [`Value`](struct.Value.html). +pub trait ToValue { + /// Perform the conversion. + fn to_value(&self) -> Value; +} + +impl<'a, T> ToValue for &'a T +where + T: ToValue + ?Sized, +{ + fn to_value(&self) -> Value { + (**self).to_value() + } +} + +impl<'v> ToValue for Value<'v> { + fn to_value(&self) -> Value { + Value { + inner: self.inner.clone(), + } + } +} + +/// A value in a structured key-value pair. +/// +/// # Capturing values +/// +/// There are a few ways to capture a value: +/// +/// - Using the `Value::capture_*` methods. +/// - Using the `Value::from_*` methods. +/// - Using the `ToValue` trait. +/// - Using the standard `From` trait. +/// +/// ## Using the `Value::capture_*` methods +/// +/// `Value` offers a few constructor methods that capture values of different kinds. +/// These methods require a `T: 'static` to support downcasting. +/// +/// ``` +/// use log::kv::Value; +/// +/// let value = Value::capture_debug(&42i32); +/// +/// assert_eq!(Some(42), value.to_i64()); +/// ``` +/// +/// ## Using the `Value::from_*` methods +/// +/// `Value` offers a few constructor methods that capture values of different kinds. +/// These methods don't require `T: 'static`, but can't support downcasting. +/// +/// ``` +/// use log::kv::Value; +/// +/// let value = Value::from_debug(&42i32); +/// +/// assert_eq!(None, value.to_i64()); +/// ``` +/// +/// ## Using the `ToValue` trait +/// +/// The `ToValue` trait can be used to capture values generically. +/// It's the bound used by `Source`. +/// +/// ``` +/// # use log::kv::ToValue; +/// let value = 42i32.to_value(); +/// +/// assert_eq!(Some(42), value.to_i64()); +/// ``` +/// +/// ``` +/// # use std::fmt::Debug; +/// use log::kv::ToValue; +/// +/// let value = (&42i32 as &dyn Debug).to_value(); +/// +/// assert_eq!(None, value.to_i64()); +/// ``` +/// +/// ## Using the standard `From` trait +/// +/// Standard types that implement `ToValue` also implement `From`. +/// +/// ``` +/// use log::kv::Value; +/// +/// let value = Value::from(42i32); +/// +/// assert_eq!(Some(42), value.to_i64()); +/// ``` +pub struct Value<'v> { + inner: ValueBag<'v>, +} + +impl<'v> Value<'v> { + /// Get a value from a type implementing `ToValue`. + pub fn from_any(value: &'v T) -> Self + where + T: ToValue, + { + value.to_value() + } + + /// Get a value from a type implementing `std::fmt::Debug`. + pub fn capture_debug(value: &'v T) -> Self + where + T: fmt::Debug + 'static, + { + Value { + inner: ValueBag::capture_debug(value), + } + } + + /// Get a value from a type implementing `std::fmt::Display`. + pub fn capture_display(value: &'v T) -> Self + where + T: fmt::Display + 'static, + { + Value { + inner: ValueBag::capture_display(value), + } + } + + /// Get a value from an error. + #[cfg(feature = "kv_unstable_std")] + pub fn capture_error(err: &'v T) -> Self + where + T: std::error::Error + 'static, + { + Value { + inner: ValueBag::capture_error(err), + } + } + + #[cfg(feature = "kv_unstable_serde")] + /// Get a value from a type implementing `serde::Serialize`. + pub fn capture_serde(value: &'v T) -> Self + where + T: self::serde::Serialize + 'static, + { + Value { + inner: ValueBag::capture_serde1(value), + } + } + + /// Get a value from a type implementing `sval::value::Value`. + #[cfg(feature = "kv_unstable_sval")] + pub fn capture_sval(value: &'v T) -> Self + where + T: self::sval::value::Value + 'static, + { + Value { + inner: ValueBag::capture_sval1(value), + } + } + + /// Get a value from a type implementing `std::fmt::Debug`. + pub fn from_debug(value: &'v T) -> Self + where + T: fmt::Debug, + { + Value { + inner: ValueBag::from_debug(value), + } + } + + /// Get a value from a type implementing `std::fmt::Display`. + pub fn from_display(value: &'v T) -> Self + where + T: fmt::Display, + { + Value { + inner: ValueBag::from_display(value), + } + } + + /// Get a value from a type implementing `serde::Serialize`. + #[cfg(feature = "kv_unstable_serde")] + pub fn from_serde(value: &'v T) -> Self + where + T: self::serde::Serialize, + { + Value { + inner: ValueBag::from_serde1(value), + } + } + + /// Get a value from a type implementing `sval::value::Value`. + #[cfg(feature = "kv_unstable_sval")] + pub fn from_sval(value: &'v T) -> Self + where + T: self::sval::value::Value, + { + Value { + inner: ValueBag::from_sval1(value), + } + } + + /// Get a value from a dynamic `std::fmt::Debug`. + pub fn from_dyn_debug(value: &'v dyn fmt::Debug) -> Self { + Value { + inner: ValueBag::from_dyn_debug(value), + } + } + + /// Get a value from a dynamic `std::fmt::Display`. + pub fn from_dyn_display(value: &'v dyn fmt::Display) -> Self { + Value { + inner: ValueBag::from_dyn_display(value), + } + } + + /// Get a value from a dynamic error. + #[cfg(feature = "kv_unstable_std")] + pub fn from_dyn_error(err: &'v (dyn std::error::Error + 'static)) -> Self { + Value { + inner: ValueBag::from_dyn_error(err), + } + } + + /// Get a value from a type implementing `sval::value::Value`. + #[cfg(feature = "kv_unstable_sval")] + pub fn from_dyn_sval(value: &'v dyn self::sval::value::Value) -> Self { + Value { + inner: ValueBag::from_dyn_sval1(value), + } + } + + /// Get a value from an internal primitive. + fn from_value_bag(value: T) -> Self + where + T: Into>, + { + Value { + inner: value.into(), + } + } + + /// Check whether this value can be downcast to `T`. + pub fn is(&self) -> bool { + self.inner.is::() + } + + /// Try downcast this value to `T`. + pub fn downcast_ref(&self) -> Option<&T> { + self.inner.downcast_ref::() + } +} + +impl<'v> fmt::Debug for Value<'v> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Debug::fmt(&self.inner, f) + } +} + +impl<'v> fmt::Display for Value<'v> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(&self.inner, f) + } +} + +impl ToValue for dyn fmt::Debug { + fn to_value(&self) -> Value { + Value::from_dyn_debug(self) + } +} + +impl ToValue for dyn fmt::Display { + fn to_value(&self) -> Value { + Value::from_dyn_display(self) + } +} + +#[cfg(feature = "kv_unstable_std")] +impl ToValue for dyn std::error::Error + 'static { + fn to_value(&self) -> Value { + Value::from_dyn_error(self) + } +} + +#[cfg(feature = "kv_unstable_serde")] +impl<'v> self::serde::Serialize for Value<'v> { + fn serialize(&self, s: S) -> Result + where + S: self::serde::Serializer, + { + self.inner.serialize(s) + } +} + +#[cfg(feature = "kv_unstable_sval")] +impl<'v> self::sval::value::Value for Value<'v> { + fn stream(&self, stream: &mut self::sval::value::Stream) -> self::sval::value::Result { + self::sval::value::Value::stream(&self.inner, stream) + } +} + +#[cfg(feature = "kv_unstable_sval")] +impl ToValue for dyn self::sval::value::Value { + fn to_value(&self) -> Value { + Value::from_dyn_sval(self) + } +} + +impl ToValue for str { + fn to_value(&self) -> Value { + Value::from(self) + } +} + +impl<'v> From<&'v str> for Value<'v> { + fn from(value: &'v str) -> Self { + Value::from_value_bag(value) + } +} + +impl ToValue for () { + fn to_value(&self) -> Value { + Value::from_value_bag(()) + } +} + +impl ToValue for Option +where + T: ToValue, +{ + fn to_value(&self) -> Value { + match *self { + Some(ref value) => value.to_value(), + None => Value::from_value_bag(()), + } + } +} + +macro_rules! impl_to_value_primitive { + ($($into_ty:ty,)*) => { + $( + impl ToValue for $into_ty { + fn to_value(&self) -> Value { + Value::from(*self) + } + } + + impl<'v> From<$into_ty> for Value<'v> { + fn from(value: $into_ty) -> Self { + Value::from_value_bag(value) + } + } + )* + }; +} + +macro_rules! impl_value_to_primitive { + ($(#[doc = $doc:tt] $into_name:ident -> $into_ty:ty,)*) => { + impl<'v> Value<'v> { + $( + #[doc = $doc] + pub fn $into_name(&self) -> Option<$into_ty> { + self.inner.$into_name() + } + )* + } + } +} + +impl_to_value_primitive![ + usize, u8, u16, u32, u64, u128, isize, i8, i16, i32, i64, i128, f32, f64, char, bool, +]; + +impl_value_to_primitive![ + #[doc = "Try convert this value into a `u64`."] + to_u64 -> u64, + #[doc = "Try convert this value into a `i64`."] + to_i64 -> i64, + #[doc = "Try convert this value into a `u128`."] + to_u128 -> u128, + #[doc = "Try convert this value into a `i128`."] + to_i128 -> i128, + #[doc = "Try convert this value into a `f64`."] + to_f64 -> f64, + #[doc = "Try convert this value into a `char`."] + to_char -> char, + #[doc = "Try convert this value into a `bool`."] + to_bool -> bool, +]; + +impl<'v> Value<'v> { + /// Try convert this value into an error. + #[cfg(feature = "kv_unstable_std")] + pub fn to_borrowed_error(&self) -> Option<&(dyn std::error::Error + 'static)> { + self.inner.to_borrowed_error() + } + + /// Try convert this value into a borrowed string. + pub fn to_borrowed_str(&self) -> Option<&str> { + self.inner.to_borrowed_str() + } +} + +#[cfg(feature = "kv_unstable_std")] +mod std_support { + use super::*; + + use std::borrow::Cow; + + impl ToValue for Box + where + T: ToValue + ?Sized, + { + fn to_value(&self) -> Value { + (**self).to_value() + } + } + + impl ToValue for String { + fn to_value(&self) -> Value { + Value::from(&**self) + } + } + + impl<'v> ToValue for Cow<'v, str> { + fn to_value(&self) -> Value { + Value::from(&**self) + } + } + + impl<'v> Value<'v> { + /// Try convert this value into a string. + pub fn to_str(&self) -> Option> { + self.inner.to_str() + } + } +} + +#[cfg(test)] +pub(crate) mod tests { + use super::*; + + pub(crate) use super::value_bag::test::Token; + + impl<'v> Value<'v> { + pub(crate) fn to_token(&self) -> Token { + self.inner.to_token() + } + } + + fn unsigned() -> impl Iterator> { + vec![ + Value::from(8u8), + Value::from(16u16), + Value::from(32u32), + Value::from(64u64), + Value::from(1usize), + ] + .into_iter() + } + + fn signed() -> impl Iterator> { + vec![ + Value::from(-8i8), + Value::from(-16i16), + Value::from(-32i32), + Value::from(-64i64), + Value::from(-1isize), + ] + .into_iter() + } + + fn float() -> impl Iterator> { + vec![Value::from(32.32f32), Value::from(64.64f64)].into_iter() + } + + fn bool() -> impl Iterator> { + vec![Value::from(true), Value::from(false)].into_iter() + } + + fn str() -> impl Iterator> { + vec![Value::from("a string"), Value::from("a loong string")].into_iter() + } + + fn char() -> impl Iterator> { + vec![Value::from('a'), Value::from('⛰')].into_iter() + } + + #[test] + fn test_capture_fmt() { + assert_eq!(Some(42u64), Value::capture_display(&42).to_u64()); + assert_eq!(Some(42u64), Value::capture_debug(&42).to_u64()); + + assert!(Value::from_display(&42).to_u64().is_none()); + assert!(Value::from_debug(&42).to_u64().is_none()); + } + + #[cfg(feature = "kv_unstable_std")] + #[test] + fn test_capture_error() { + let err = std::io::Error::from(std::io::ErrorKind::Other); + + assert!(Value::capture_error(&err).to_borrowed_error().is_some()); + assert!(Value::from_dyn_error(&err).to_borrowed_error().is_some()); + } + + #[cfg(feature = "kv_unstable_serde")] + #[test] + fn test_capture_serde() { + assert_eq!(Some(42u64), Value::capture_serde(&42).to_u64()); + + assert_eq!(Some(42u64), Value::from_serde(&42).to_u64()); + } + + #[cfg(feature = "kv_unstable_sval")] + #[test] + fn test_capture_sval() { + assert_eq!(Some(42u64), Value::capture_sval(&42).to_u64()); + + assert_eq!(Some(42u64), Value::from_sval(&42).to_u64()); + } + + #[test] + fn test_to_value_display() { + assert_eq!(42u64.to_value().to_string(), "42"); + assert_eq!(42i64.to_value().to_string(), "42"); + assert_eq!(42.01f64.to_value().to_string(), "42.01"); + assert_eq!(true.to_value().to_string(), "true"); + assert_eq!('a'.to_value().to_string(), "a"); + assert_eq!("a loong string".to_value().to_string(), "a loong string"); + assert_eq!(Some(true).to_value().to_string(), "true"); + assert_eq!(().to_value().to_string(), "None"); + assert_eq!(Option::None::.to_value().to_string(), "None"); + } + + #[test] + fn test_to_value_structured() { + assert_eq!(42u64.to_value().to_token(), Token::U64(42)); + assert_eq!(42i64.to_value().to_token(), Token::I64(42)); + assert_eq!(42.01f64.to_value().to_token(), Token::F64(42.01)); + assert_eq!(true.to_value().to_token(), Token::Bool(true)); + assert_eq!('a'.to_value().to_token(), Token::Char('a')); + assert_eq!( + "a loong string".to_value().to_token(), + Token::Str("a loong string".into()) + ); + assert_eq!(Some(true).to_value().to_token(), Token::Bool(true)); + assert_eq!(().to_value().to_token(), Token::None); + assert_eq!(Option::None::.to_value().to_token(), Token::None); + } + + #[test] + fn test_to_number() { + for v in unsigned() { + assert!(v.to_u64().is_some()); + assert!(v.to_i64().is_some()); + } + + for v in signed() { + assert!(v.to_i64().is_some()); + } + + for v in unsigned().chain(signed()).chain(float()) { + assert!(v.to_f64().is_some()); + } + + for v in bool().chain(str()).chain(char()) { + assert!(v.to_u64().is_none()); + assert!(v.to_i64().is_none()); + assert!(v.to_f64().is_none()); + } + } + + #[test] + fn test_to_str() { + for v in str() { + assert!(v.to_borrowed_str().is_some()); + + #[cfg(feature = "kv_unstable_std")] + assert!(v.to_str().is_some()); + } + + let short_lived = String::from("short lived"); + let v = Value::from(&*short_lived); + + assert!(v.to_borrowed_str().is_some()); + + #[cfg(feature = "kv_unstable_std")] + assert!(v.to_str().is_some()); + + for v in unsigned().chain(signed()).chain(float()).chain(bool()) { + assert!(v.to_borrowed_str().is_none()); + + #[cfg(feature = "kv_unstable_std")] + assert!(v.to_str().is_none()); + } + } + + #[test] + fn test_to_bool() { + for v in bool() { + assert!(v.to_bool().is_some()); + } + + for v in unsigned() + .chain(signed()) + .chain(float()) + .chain(str()) + .chain(char()) + { + assert!(v.to_bool().is_none()); + } + } + + #[test] + fn test_to_char() { + for v in char() { + assert!(v.to_char().is_some()); + } + + for v in unsigned() + .chain(signed()) + .chain(float()) + .chain(str()) + .chain(bool()) + { + assert!(v.to_char().is_none()); + } + } + + #[test] + fn test_downcast_ref() { + #[derive(Debug)] + struct Foo(u64); + + let v = Value::capture_debug(&Foo(42)); + + assert!(v.is::()); + assert_eq!(42u64, v.downcast_ref::().expect("invalid downcast").0); + } +} diff --git a/third_party/cargo/vendor/log-0.4.11/src/lib.rs b/third_party/cargo/vendor/log-0.4.14/src/lib.rs similarity index 91% rename from third_party/cargo/vendor/log-0.4.11/src/lib.rs rename to third_party/cargo/vendor/log-0.4.14/src/lib.rs index 83b78d0..e754268 100644 --- a/third_party/cargo/vendor/log-0.4.11/src/lib.rs +++ b/third_party/cargo/vendor/log-0.4.14/src/lib.rs @@ -266,7 +266,7 @@ #![doc( html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://www.rust-lang.org/favicon.ico", - html_root_url = "https://docs.rs/log/0.4.11" + html_root_url = "https://docs.rs/log/0.4.14" )] #![warn(missing_docs)] #![deny(missing_debug_implementations)] @@ -288,7 +288,6 @@ use std::error; use std::fmt; use std::mem; use std::str::FromStr; -use std::sync::atomic::{AtomicUsize, Ordering}; #[macro_use] mod macros; @@ -297,6 +296,54 @@ mod serde; #[cfg(feature = "kv_unstable")] pub mod kv; +#[cfg(has_atomics)] +use std::sync::atomic::{AtomicUsize, Ordering}; + +#[cfg(not(has_atomics))] +use std::cell::Cell; +#[cfg(not(has_atomics))] +use std::sync::atomic::Ordering; + +#[cfg(not(has_atomics))] +struct AtomicUsize { + v: Cell, +} + +#[cfg(not(has_atomics))] +impl AtomicUsize { + const fn new(v: usize) -> AtomicUsize { + AtomicUsize { v: Cell::new(v) } + } + + fn load(&self, _order: Ordering) -> usize { + self.v.get() + } + + fn store(&self, val: usize, _order: Ordering) { + self.v.set(val) + } + + #[cfg(atomic_cas)] + fn compare_exchange( + &self, + current: usize, + new: usize, + _success: Ordering, + _failure: Ordering, + ) -> Result { + let prev = self.v.get(); + if current == prev { + self.v.set(new); + } + Ok(prev) + } +} + +// Any platform without atomics is unlikely to have multiple cores, so +// writing via Cell will not be a race condition. +#[cfg(not(has_atomics))] +unsafe impl Sync for AtomicUsize {} + // The LOGGER static holds a pointer to the global logger. It is protected by // the STATE static which determines whether LOGGER has been initialized yet. static mut LOGGER: &dyn Log = &NopLogger; @@ -479,7 +526,7 @@ impl FromStr for Level { impl fmt::Display for Level { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - fmt.pad(LOG_LEVEL_NAMES[*self as usize]) + fmt.pad(self.as_str()) } } @@ -506,6 +553,13 @@ impl Level { pub fn to_level_filter(&self) -> LevelFilter { LevelFilter::from_usize(*self as usize).unwrap() } + + /// Returns the string representation of the `Level`. + /// + /// This returns the same string as the `fmt::Display` implementation. + pub fn as_str(&self) -> &'static str { + LOG_LEVEL_NAMES[*self as usize] + } } /// An enum representing the available verbosity level filters of the logger. @@ -632,7 +686,7 @@ impl FromStr for LevelFilter { impl fmt::Display for LevelFilter { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - fmt.pad(LOG_LEVEL_NAMES[*self as usize]) + fmt.pad(self.as_str()) } } @@ -661,6 +715,13 @@ impl LevelFilter { pub fn to_level(&self) -> Option { Level::from_usize(*self as usize) } + + /// Returns the string representation of the `LevelFilter`. + /// + /// This returns the same string as the `fmt::Display` implementation. + pub fn as_str(&self) -> &'static str { + LOG_LEVEL_NAMES[*self as usize] + } } #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] @@ -1153,6 +1214,23 @@ impl Log for NopLogger { fn flush(&self) {} } +#[cfg(feature = "std")] +impl Log for std::boxed::Box +where + T: ?Sized + Log, +{ + fn enabled(&self, metadata: &Metadata) -> bool { + self.as_ref().enabled(metadata) + } + + fn log(&self, record: &Record) { + self.as_ref().log(record) + } + fn flush(&self) { + self.as_ref().flush() + } +} + /// Sets the global maximum log level. /// /// Generally, this should only be called by the active logging implementation. @@ -1266,7 +1344,15 @@ fn set_logger_inner(make_logger: F) -> Result<(), SetLoggerError> where F: FnOnce() -> &'static dyn Log, { - match STATE.compare_and_swap(UNINITIALIZED, INITIALIZING, Ordering::SeqCst) { + let old_state = match STATE.compare_exchange( + UNINITIALIZED, + INITIALIZING, + Ordering::SeqCst, + Ordering::SeqCst, + ) { + Ok(s) | Err(s) => s, + }; + match old_state { UNINITIALIZED => { unsafe { LOGGER = make_logger(); @@ -1383,25 +1469,6 @@ pub fn __private_api_log( ); } -// WARNING: this is not part of the crate's public API and is subject to change at any time -#[doc(hidden)] -pub fn __private_api_log_lit( - message: &str, - level: Level, - &(target, module_path, file, line): &(&str, &'static str, &'static str, u32), -) { - logger().log( - &Record::builder() - .args(format_args!("{}", message)) - .level(level) - .target(target) - .module_path_static(Some(module_path)) - .file_static(Some(file)) - .line(Some(line)) - .build(), - ); -} - // WARNING: this is not part of the crate's public API and is subject to change at any time #[doc(hidden)] pub fn __private_api_enabled(level: Level, target: &str) -> bool { @@ -1496,6 +1563,20 @@ mod tests { } } + #[test] + fn test_level_as_str() { + let tests = &[ + (Level::Error, "ERROR"), + (Level::Warn, "WARN"), + (Level::Info, "INFO"), + (Level::Debug, "DEBUG"), + (Level::Trace, "TRACE"), + ]; + for (input, expected) in tests { + assert_eq!(*expected, input.as_str()); + } + } + #[test] fn test_level_show() { assert_eq!("INFO", Level::Info.to_string()); @@ -1535,6 +1616,21 @@ mod tests { assert_eq!(LevelFilter::Trace, Level::Trace.to_level_filter()); } + #[test] + fn test_level_filter_as_str() { + let tests = &[ + (LevelFilter::Off, "OFF"), + (LevelFilter::Error, "ERROR"), + (LevelFilter::Warn, "WARN"), + (LevelFilter::Info, "INFO"), + (LevelFilter::Debug, "DEBUG"), + (LevelFilter::Trace, "TRACE"), + ]; + for (input, expected) in tests { + assert_eq!(*expected, input.as_str()); + } + } + #[test] #[cfg(feature = "std")] fn test_error_trait() { diff --git a/third_party/cargo/vendor/log-0.4.11/src/macros.rs b/third_party/cargo/vendor/log-0.4.14/src/macros.rs similarity index 83% rename from third_party/cargo/vendor/log-0.4.11/src/macros.rs rename to third_party/cargo/vendor/log-0.4.14/src/macros.rs index 48de437..a234e04 100644 --- a/third_party/cargo/vendor/log-0.4.11/src/macros.rs +++ b/third_party/cargo/vendor/log-0.4.14/src/macros.rs @@ -29,18 +29,6 @@ /// ``` #[macro_export(local_inner_macros)] macro_rules! log { - (target: $target:expr, $lvl:expr, $message:expr) => ({ - let lvl = $lvl; - if lvl <= $crate::STATIC_MAX_LEVEL && lvl <= $crate::max_level() { - // ensure that $message is a valid format string literal - let _ = __log_format_args!($message); - $crate::__private_api_log_lit( - $message, - lvl, - &($target, __log_module_path!(), __log_file!(), __log_line!()), - ); - } - }); (target: $target:expr, $lvl:expr, $($arg:tt)+) => ({ let lvl = $lvl; if lvl <= $crate::STATIC_MAX_LEVEL && lvl <= $crate::max_level() { @@ -71,10 +59,10 @@ macro_rules! log { #[macro_export(local_inner_macros)] macro_rules! error { (target: $target:expr, $($arg:tt)+) => ( - log!(target: $target, $crate::Level::Error, $($arg)+); + log!(target: $target, $crate::Level::Error, $($arg)+) ); ($($arg:tt)+) => ( - log!($crate::Level::Error, $($arg)+); + log!($crate::Level::Error, $($arg)+) ) } @@ -95,10 +83,10 @@ macro_rules! error { #[macro_export(local_inner_macros)] macro_rules! warn { (target: $target:expr, $($arg:tt)+) => ( - log!(target: $target, $crate::Level::Warn, $($arg)+); + log!(target: $target, $crate::Level::Warn, $($arg)+) ); ($($arg:tt)+) => ( - log!($crate::Level::Warn, $($arg)+); + log!($crate::Level::Warn, $($arg)+) ) } @@ -121,10 +109,10 @@ macro_rules! warn { #[macro_export(local_inner_macros)] macro_rules! info { (target: $target:expr, $($arg:tt)+) => ( - log!(target: $target, $crate::Level::Info, $($arg)+); + log!(target: $target, $crate::Level::Info, $($arg)+) ); ($($arg:tt)+) => ( - log!($crate::Level::Info, $($arg)+); + log!($crate::Level::Info, $($arg)+) ) } @@ -146,10 +134,10 @@ macro_rules! info { #[macro_export(local_inner_macros)] macro_rules! debug { (target: $target:expr, $($arg:tt)+) => ( - log!(target: $target, $crate::Level::Debug, $($arg)+); + log!(target: $target, $crate::Level::Debug, $($arg)+) ); ($($arg:tt)+) => ( - log!($crate::Level::Debug, $($arg)+); + log!($crate::Level::Debug, $($arg)+) ) } @@ -173,10 +161,10 @@ macro_rules! debug { #[macro_export(local_inner_macros)] macro_rules! trace { (target: $target:expr, $($arg:tt)+) => ( - log!(target: $target, $crate::Level::Trace, $($arg)+); + log!(target: $target, $crate::Level::Trace, $($arg)+) ); ($($arg:tt)+) => ( - log!($crate::Level::Trace, $($arg)+); + log!($crate::Level::Trace, $($arg)+) ) } diff --git a/third_party/cargo/vendor/log-0.4.11/src/serde.rs b/third_party/cargo/vendor/log-0.4.14/src/serde.rs similarity index 80% rename from third_party/cargo/vendor/log-0.4.11/src/serde.rs rename to third_party/cargo/vendor/log-0.4.14/src/serde.rs index 8320ce1..e691321 100644 --- a/third_party/cargo/vendor/log-0.4.11/src/serde.rs +++ b/third_party/cargo/vendor/log-0.4.14/src/serde.rs @@ -60,6 +60,17 @@ impl<'de> Deserialize<'de> for Level { self.visit_str(variant) } + + fn visit_u64(self, v: u64) -> Result + where + E: Error, + { + let variant = LOG_LEVEL_NAMES[1..] + .get(v as usize) + .ok_or_else(|| Error::invalid_value(Unexpected::Unsigned(v), &self))?; + + self.visit_str(variant) + } } impl<'de> DeserializeSeed<'de> for LevelIdentifier { @@ -144,6 +155,17 @@ impl<'de> Deserialize<'de> for LevelFilter { self.visit_str(variant) } + + fn visit_u64(self, v: u64) -> Result + where + E: Error, + { + let variant = LOG_LEVEL_NAMES + .get(v as usize) + .ok_or_else(|| Error::invalid_value(Unexpected::Unsigned(v), &self))?; + + self.visit_str(variant) + } } impl<'de> DeserializeSeed<'de> for LevelFilterIdentifier { @@ -203,6 +225,14 @@ mod tests { ] } + fn level_variant_tokens(variant: u32) -> [Token; 3] { + [ + Token::Enum { name: "Level" }, + Token::U32(variant), + Token::Unit, + ] + } + fn level_filter_token(variant: &'static str) -> Token { Token::UnitVariant { name: "LevelFilter", @@ -220,6 +250,16 @@ mod tests { ] } + fn level_filter_variant_tokens(variant: u32) -> [Token; 3] { + [ + Token::Enum { + name: "LevelFilter", + }, + Token::U32(variant), + Token::Unit, + ] + } + #[test] fn test_level_ser_de() { let cases = [ @@ -265,6 +305,21 @@ mod tests { } } + #[test] + fn test_level_de_variant_index() { + let cases = [ + (Level::Error, level_variant_tokens(0)), + (Level::Warn, level_variant_tokens(1)), + (Level::Info, level_variant_tokens(2)), + (Level::Debug, level_variant_tokens(3)), + (Level::Trace, level_variant_tokens(4)), + ]; + + for &(value, tokens) in &cases { + assert_de_tokens(&value, &tokens); + } + } + #[test] fn test_level_de_error() { let msg = "unknown variant `errorx`, expected one of \ @@ -320,6 +375,22 @@ mod tests { } } + #[test] + fn test_level_filter_de_variant_index() { + let cases = [ + (LevelFilter::Off, level_filter_variant_tokens(0)), + (LevelFilter::Error, level_filter_variant_tokens(1)), + (LevelFilter::Warn, level_filter_variant_tokens(2)), + (LevelFilter::Info, level_filter_variant_tokens(3)), + (LevelFilter::Debug, level_filter_variant_tokens(4)), + (LevelFilter::Trace, level_filter_variant_tokens(5)), + ]; + + for &(value, tokens) in &cases { + assert_de_tokens(&value, &tokens); + } + } + #[test] fn test_level_filter_de_error() { let msg = "unknown variant `errorx`, expected one of \ diff --git a/third_party/cargo/vendor/log-0.4.11/triagebot.toml b/third_party/cargo/vendor/log-0.4.14/triagebot.toml similarity index 100% rename from third_party/cargo/vendor/log-0.4.11/triagebot.toml rename to third_party/cargo/vendor/log-0.4.14/triagebot.toml diff --git a/third_party/cargo/vendor/malloc_buf-0.0.6/BUILD.bazel b/third_party/cargo/vendor/malloc_buf-0.0.6/BUILD.bazel index f0585fe..0ca1468 100644 --- a/third_party/cargo/vendor/malloc_buf-0.0.6/BUILD.bazel +++ b/third_party/cargo/vendor/malloc_buf-0.0.6/BUILD.bazel @@ -49,6 +49,6 @@ rust_library( version = "0.0.6", # buildifier: leave-alone deps = [ - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ], ) diff --git a/third_party/cargo/vendor/memmap2-0.1.0/BUILD.bazel b/third_party/cargo/vendor/memmap2-0.1.0/BUILD.bazel index 6528bc2..a1b7e75 100644 --- a/third_party/cargo/vendor/memmap2-0.1.0/BUILD.bazel +++ b/third_party/cargo/vendor/memmap2-0.1.0/BUILD.bazel @@ -58,7 +58,7 @@ rust_library( ( "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", ): [ - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ], "//conditions:default": [], }), diff --git a/third_party/cargo/vendor/memoffset-0.6.1/.cargo-checksum.json b/third_party/cargo/vendor/memoffset-0.6.1/.cargo-checksum.json deleted file mode 100644 index 7c8590a..0000000 --- a/third_party/cargo/vendor/memoffset-0.6.1/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"Cargo.toml":"333c7595740d7640056444df0ecc255393a198098f4a464902e2ec5fc6579086","LICENSE":"3234ac55816264ee7b6c7ee27efd61cf0a1fe775806870e3d9b4c41ea73c5cb1","README.md":"ab1f5d43646dda8a433f5b39e176007d6d3a19348cdb1e6a525e9d3f287223cf","build.rs":"35fa2f5fabdaba3ad8ad311bf4c402530e01b3103b6376c0a7249d9635be3c54","ci/miri.sh":"ad7410b0a5bd6e346f55e9d96ec0719a085a2d1ce266bddfe6fe73333a1eb8ec","src/lib.rs":"0621a03c51702403e46846f871bab0f576c9557f33b94c37431a57ce81c665d1","src/offset_of.rs":"e1836cde12a430c7639630efb1635a43321ec0a4d8cdeb6d0d9080b75e607fb7","src/raw_field.rs":"c19ff6ccbe40f9c1e2fa62e39bb4e4ac1b9a1c020a1ffdbc790c47615b37c010","src/span_of.rs":"2d9216b794327e95f55bad04ba7d8e76ff5313713c187b319348d8e5620aa0a9"},"package":"157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87"} \ No newline at end of file diff --git a/third_party/cargo/vendor/memoffset-0.6.3/.cargo-checksum.json b/third_party/cargo/vendor/memoffset-0.6.3/.cargo-checksum.json new file mode 100644 index 0000000..ac0ad96 --- /dev/null +++ b/third_party/cargo/vendor/memoffset-0.6.3/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"045622efd2d70f644e5a250d9354e7f2e754d4f16c82ea193e8bf41ee20504a8","LICENSE":"3234ac55816264ee7b6c7ee27efd61cf0a1fe775806870e3d9b4c41ea73c5cb1","README.md":"5fa2d8db2b91d1dab87a67545a4e6b5a5f06a42ab1d4f4fdf068641094f4bca4","build.rs":"6d677e33a1c98d588c97ec7985d4d5c3b954683e0a73c3dc53d79db4fbb5e638","ci/miri.sh":"ad7410b0a5bd6e346f55e9d96ec0719a085a2d1ce266bddfe6fe73333a1eb8ec","src/lib.rs":"14b7574dbb690c3c3e3b633b5db6c77b4fd12e092269ec4a9d8702a37207293b","src/offset_of.rs":"c62f87015758a7c85bafe312f77dda0199f120b894527453c2ed82ba67d0f24c","src/raw_field.rs":"295cc971d64e51f3d053e56c692ae6ef3bb58915298f1ec49bb695b767daff46","src/span_of.rs":"e9e8eb985f51de0915351365f451d9b9e45385dc1d374f3d59373fa774939fe5"},"package":"f83fb6581e8ed1f85fd45c116db8405483899489e38406156c25eb743554361d"} \ No newline at end of file diff --git a/third_party/cargo/vendor/memoffset-0.6.1/BUILD.bazel b/third_party/cargo/vendor/memoffset-0.6.3/BUILD.bazel similarity index 97% rename from third_party/cargo/vendor/memoffset-0.6.1/BUILD.bazel rename to third_party/cargo/vendor/memoffset-0.6.3/BUILD.bazel index 69e1d2f..7a3b979 100644 --- a/third_party/cargo/vendor/memoffset-0.6.1/BUILD.bazel +++ b/third_party/cargo/vendor/memoffset-0.6.3/BUILD.bazel @@ -49,7 +49,7 @@ rust_library( "cargo-raze", "manual", ], - version = "0.6.1", + version = "0.6.3", # buildifier: leave-alone deps = [ ], diff --git a/third_party/cargo/vendor/memoffset-0.6.1/Cargo.toml b/third_party/cargo/vendor/memoffset-0.6.3/Cargo.toml similarity index 96% rename from third_party/cargo/vendor/memoffset-0.6.1/Cargo.toml rename to third_party/cargo/vendor/memoffset-0.6.3/Cargo.toml index 9e2874f..e273757 100644 --- a/third_party/cargo/vendor/memoffset-0.6.1/Cargo.toml +++ b/third_party/cargo/vendor/memoffset-0.6.3/Cargo.toml @@ -12,7 +12,7 @@ [package] name = "memoffset" -version = "0.6.1" +version = "0.6.3" authors = ["Gilad Naaman "] description = "offset_of functionality for Rust structs." readme = "README.md" @@ -28,4 +28,3 @@ version = "1" [features] default = [] unstable_const = [] -unstable_raw = [] diff --git a/third_party/cargo/vendor/memoffset-0.6.1/LICENSE b/third_party/cargo/vendor/memoffset-0.6.3/LICENSE similarity index 100% rename from third_party/cargo/vendor/memoffset-0.6.1/LICENSE rename to third_party/cargo/vendor/memoffset-0.6.3/LICENSE diff --git a/third_party/cargo/vendor/memoffset-0.6.1/README.md b/third_party/cargo/vendor/memoffset-0.6.3/README.md similarity index 85% rename from third_party/cargo/vendor/memoffset-0.6.1/README.md rename to third_party/cargo/vendor/memoffset-0.6.3/README.md index 67ce9eb..a60f288 100644 --- a/third_party/cargo/vendor/memoffset-0.6.1/README.md +++ b/third_party/cargo/vendor/memoffset-0.6.3/README.md @@ -73,8 +73,3 @@ Your crate root: (`lib.rs`/`main.rs`) ``` If you intend to use `offset_of!` inside a `const fn`, also add the `const_fn` compiler feature. - -### Raw references ### -Recent nightlies support [a way to create raw pointers](https://github.com/rust-lang/rust/issues/73394) that avoids creating intermediate safe references. -`memoffset` can make use of that feature to avoid what is technically Undefined Behavior. -Use the `unstable_raw` feature to enable this. diff --git a/third_party/cargo/vendor/memoffset-0.6.1/build.rs b/third_party/cargo/vendor/memoffset-0.6.3/build.rs similarity index 83% rename from third_party/cargo/vendor/memoffset-0.6.1/build.rs rename to third_party/cargo/vendor/memoffset-0.6.3/build.rs index c83bff2..0604c19 100644 --- a/third_party/cargo/vendor/memoffset-0.6.1/build.rs +++ b/third_party/cargo/vendor/memoffset-0.6.3/build.rs @@ -16,4 +16,7 @@ fn main() { 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"); + } } diff --git a/third_party/cargo/vendor/memoffset-0.6.1/ci/miri.sh b/third_party/cargo/vendor/memoffset-0.6.3/ci/miri.sh similarity index 100% rename from third_party/cargo/vendor/memoffset-0.6.1/ci/miri.sh rename to third_party/cargo/vendor/memoffset-0.6.3/ci/miri.sh diff --git a/third_party/cargo/vendor/memoffset-0.6.1/src/lib.rs b/third_party/cargo/vendor/memoffset-0.6.3/src/lib.rs similarity index 87% rename from third_party/cargo/vendor/memoffset-0.6.1/src/lib.rs rename to third_party/cargo/vendor/memoffset-0.6.3/src/lib.rs index c85fb01..454759e 100644 --- a/third_party/cargo/vendor/memoffset-0.6.1/src/lib.rs +++ b/third_party/cargo/vendor/memoffset-0.6.3/src/lib.rs @@ -67,7 +67,6 @@ const_raw_ptr_deref, ) )] -#![cfg_attr(feature = "unstable_raw", feature(raw_ref_macros))] #[macro_use] #[cfg(doctests)] @@ -77,12 +76,20 @@ extern crate doc_comment; #[cfg(doctest)] doctest!("../README.md"); -// This `use` statement enables the macros to use `$crate::mem`. -// Doing this enables this crate to function under both std and no-std crates. +/// Hiden module for things the macros need to access. #[doc(hidden)] -pub use core::mem; -#[doc(hidden)] -pub use core::ptr; +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(_ptr: *const T) -> usize { + mem::size_of::() + } +} #[macro_use] mod raw_field; diff --git a/third_party/cargo/vendor/memoffset-0.6.1/src/offset_of.rs b/third_party/cargo/vendor/memoffset-0.6.3/src/offset_of.rs similarity index 92% rename from third_party/cargo/vendor/memoffset-0.6.1/src/offset_of.rs rename to third_party/cargo/vendor/memoffset-0.6.3/src/offset_of.rs index 2ffb79c..a363d30 100644 --- a/third_party/cargo/vendor/memoffset-0.6.1/src/offset_of.rs +++ b/third_party/cargo/vendor/memoffset-0.6.3/src/offset_of.rs @@ -30,7 +30,7 @@ macro_rules! _memoffset__let_base_ptr { // 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::mem::MaybeUninit::<$type>::uninit(); + let uninit = $crate::__priv::mem::MaybeUninit::<$type>::uninit(); let $name: *const $type = uninit.as_ptr(); }; } @@ -41,7 +41,7 @@ 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::mem::align_of::<$type>() as *const $type; + let $name = $crate::__priv::mem::align_of::<$type>() as *const $type; }; } @@ -49,17 +49,19 @@ macro_rules! _memoffset__let_base_ptr { #[cfg(feature = "unstable_const")] #[macro_export] #[doc(hidden)] -macro_rules! _memoffset_offset_from { - ($field:expr, $base:expr) => { +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 } - }; + unsafe { (field as *const u8).offset_from(base as *const u8) as usize } + }}; } #[cfg(not(feature = "unstable_const"))] #[macro_export] #[doc(hidden)] -macro_rules! _memoffset_offset_from { +macro_rules! _memoffset_offset_from_unsafe { ($field:expr, $base:expr) => { // Compute offset. ($field as usize) - ($base as usize) @@ -93,7 +95,7 @@ macro_rules! offset_of { // Get field pointer. let field_ptr = raw_field!(base_ptr, $parent, $field); // Compute offset. - _memoffset_offset_from!(field_ptr, base_ptr) + _memoffset_offset_from_unsafe!(field_ptr, base_ptr) }}; } @@ -117,7 +119,7 @@ macro_rules! offset_of_tuple { // Get field pointer. let field_ptr = raw_field_tuple!(base_ptr, $parent, $field); // Compute offset. - _memoffset_offset_from!(field_ptr, base_ptr) + _memoffset_offset_from_unsafe!(field_ptr, base_ptr) }}; } diff --git a/third_party/cargo/vendor/memoffset-0.6.1/src/raw_field.rs b/third_party/cargo/vendor/memoffset-0.6.3/src/raw_field.rs similarity index 86% rename from third_party/cargo/vendor/memoffset-0.6.1/src/raw_field.rs rename to third_party/cargo/vendor/memoffset-0.6.3/src/raw_field.rs index 16d01bb..a8dd2b3 100644 --- a/third_party/cargo/vendor/memoffset-0.6.1/src/raw_field.rs +++ b/third_party/cargo/vendor/memoffset-0.6.3/src/raw_field.rs @@ -18,22 +18,22 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -/// `raw_const!`, or just ref-then-cast when that is not available. -#[cfg(feature = "unstable_raw")] +/// `addr_of!`, or just ref-then-cast when that is not available. +#[cfg(raw_ref_macros)] #[macro_export] #[doc(hidden)] -macro_rules! _memoffset__raw_const { +macro_rules! _memoffset__addr_of { ($path:expr) => {{ - $crate::ptr::raw_const!($path) + $crate::__priv::ptr::addr_of!($path) }}; } -#[cfg(not(feature = "unstable_raw"))] +#[cfg(not(raw_ref_macros))] #[macro_export] #[doc(hidden)] -macro_rules! _memoffset__raw_const { +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 `raw_const!` though. + // Nothing we can do about that without `addr_of!` though. &$path as *const _ }}; } @@ -82,13 +82,14 @@ macro_rules! _memoffset__field_check_tuple { 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__raw_const!((*($base as *const $parent)).$field) + _memoffset__addr_of!((*(base as *const $parent)).$field) } }}; } @@ -103,13 +104,14 @@ macro_rules! raw_field { 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__raw_const!((*($base as *const $parent)).$field) + _memoffset__addr_of!((*(base as *const $parent)).$field) } }}; } diff --git a/third_party/cargo/vendor/memoffset-0.6.1/src/span_of.rs b/third_party/cargo/vendor/memoffset-0.6.3/src/span_of.rs similarity index 83% rename from third_party/cargo/vendor/memoffset-0.6.1/src/span_of.rs rename to third_party/cargo/vendor/memoffset-0.6.3/src/span_of.rs index 0592dbd..fe69e1e 100644 --- a/third_party/cargo/vendor/memoffset-0.6.1/src/span_of.rs +++ b/third_party/cargo/vendor/memoffset-0.6.3/src/span_of.rs @@ -95,23 +95,21 @@ macro_rules! span_of { }; // No explicit begin for range. (@helper $root:ident, $parent:path, [] ..) => {{ - // UB due to taking references to uninitialized fields for `size_of_val`. ($root as usize, - $root as usize + $crate::mem::size_of_val(&(*$root))) + $root as usize + $crate::__priv::size_of_pointee($root)) }}; - (@helper $root:ident, $parent:path, [] ..= $field:tt) => {{ - // UB due to taking references to uninitialized fields for `size_of_val`. - ($root as usize, - raw_field!($root, $parent, $field) as usize + $crate::mem::size_of_val(&(*$root).$field)) + (@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, [] .. $field:tt) => {{ - ($root as usize, raw_field!($root, $parent, $field) as usize) + (@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) => {{ - // UB due to taking references to uninitialized fields for `size_of_val`. - (raw_field!($root, $parent, $begin) as usize, - raw_field!($root, $parent, $end) as usize + $crate::mem::size_of_val(&(*$root).$end)) + 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, @@ -119,19 +117,17 @@ macro_rules! span_of { }}; // No explicit end for range. (@helper $root:ident, $parent:path, # $begin:tt [] ..) => {{ - // UB due to taking references to uninitialized fields for `size_of_val`. (raw_field!($root, $parent, $begin) as usize, - $root as usize + $crate::mem::size_of_val(&*$root)) + $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, # $begin:tt []) => {{ - // UB due to taking references to uninitialized fields for `size_of_val`. - (raw_field!($root, $parent, $begin) as usize, - raw_field!($root, $parent, $begin) as usize + $crate::mem::size_of_val(&(*$root).$begin)) + (@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)*) => {{ @@ -143,13 +139,11 @@ macro_rules! span_of { // Entry point. ($sty:path, $($exp:tt)+) => ({ - unsafe { - // 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 - } + // 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 }); } diff --git a/third_party/cargo/vendor/metal-0.18.0/BUILD.bazel b/third_party/cargo/vendor/metal-0.18.0/BUILD.bazel index 3ebc385..c62ab2a 100644 --- a/third_party/cargo/vendor/metal-0.18.0/BUILD.bazel +++ b/third_party/cargo/vendor/metal-0.18.0/BUILD.bazel @@ -73,7 +73,7 @@ rust_library( "//third_party/cargo/vendor/cocoa-0.20.2:cocoa", "//third_party/cargo/vendor/core-graphics-0.19.2:core_graphics", "//third_party/cargo/vendor/foreign-types-0.3.2:foreign_types", - "//third_party/cargo/vendor/log-0.4.11:log", + "//third_party/cargo/vendor/log-0.4.14:log", "//third_party/cargo/vendor/objc-0.2.7:objc", ], ) diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/.cargo-checksum.json b/third_party/cargo/vendor/miniz_oxide-0.4.4/.cargo-checksum.json similarity index 53% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/.cargo-checksum.json rename to third_party/cargo/vendor/miniz_oxide-0.4.4/.cargo-checksum.json index 99e4036..be3f443 100644 --- a/third_party/cargo/vendor/miniz_oxide-0.4.3/.cargo-checksum.json +++ b/third_party/cargo/vendor/miniz_oxide-0.4.4/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"3f120d38e87608d6cefbe0ba08225f8205a1419d512afb840233d56c86725ced","LICENSE":"e190940e8ad3cdd4fca962a6508ed6865d589d314b1cb055f86000e124b88d8d","LICENSE-APACHE.md":"0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594","LICENSE-MIT.md":"e190940e8ad3cdd4fca962a6508ed6865d589d314b1cb055f86000e124b88d8d","LICENSE-ZLIB.md":"c89bcc058da12a0fb24402b8ea4542a21515dd1da2e8c67bba4ed9bd269f1c96","Readme.md":"fca5f9500a8caf5a334dc53925fa3dda063a8a4de88fe107251998300b432c0d","build.rs":"028882f1da195677e4729e5a07d3593a333297bb8c0f92789fadb3669cb3ed62","src/deflate/buffer.rs":"2953214307677f33f901f8e52256b6e7a296f4234238179613168ddad106645c","src/deflate/core.rs":"db40c9a95f5a9ad72c17eef934e163d90768b2a0f8fa53cf37d71e550cdf84f9","src/deflate/mod.rs":"d17cd7a576be570cf948d2fbf0ce535be35cc4ef94cbfbfaefc17c6641bd412a","src/deflate/stream.rs":"49120444fb12b58191c2bb0dda598cd3614cbc329eb3720a50ce8f5017c04838","src/inflate/core.rs":"a4d8c3cf20ec3b89b12f7ac1df37b521d29e910f854cb1ccb2b8c7bb23244b25","src/inflate/mod.rs":"9252ddf7edf6b8205ff5820dcc22eaeb244130e135f5bbb416c9701ca6118e23","src/inflate/output_buffer.rs":"3948c26897a8d30a356fc8e9ce1df7513c21d186838220ad63a69b6b1d985eab","src/inflate/stream.rs":"c77a867022f9d79749d610e64762aa9203accb975d498ece0f34974cd07cd5e2","src/lib.rs":"08b54d4c675f3c2901d493ce85895952b639781faa40bf0b620da6dff0a1fb91","src/shared.rs":"889b9d9d3b4bc0693f94c850806e9cf68ed9079e0ada2b2f51bfffe388e02c6a"},"package":"0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d"} \ No newline at end of file +{"files":{"Cargo.toml":"ce39c1ad4f1b3dfca82915366f8095fbe5f6025867c7829df16758bbb826a9cd","LICENSE":"e190940e8ad3cdd4fca962a6508ed6865d589d314b1cb055f86000e124b88d8d","LICENSE-APACHE.md":"0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594","LICENSE-MIT.md":"e190940e8ad3cdd4fca962a6508ed6865d589d314b1cb055f86000e124b88d8d","LICENSE-ZLIB.md":"c89bcc058da12a0fb24402b8ea4542a21515dd1da2e8c67bba4ed9bd269f1c96","Readme.md":"fca5f9500a8caf5a334dc53925fa3dda063a8a4de88fe107251998300b432c0d","build.rs":"028882f1da195677e4729e5a07d3593a333297bb8c0f92789fadb3669cb3ed62","src/deflate/buffer.rs":"2953214307677f33f901f8e52256b6e7a296f4234238179613168ddad106645c","src/deflate/core.rs":"68139f9839717877fee1f17bb5a6bef2c3e79e19268c7369bbbbb0c15647cd79","src/deflate/mod.rs":"d17cd7a576be570cf948d2fbf0ce535be35cc4ef94cbfbfaefc17c6641bd412a","src/deflate/stream.rs":"49120444fb12b58191c2bb0dda598cd3614cbc329eb3720a50ce8f5017c04838","src/inflate/core.rs":"2dce0b86e821a0587fab466220815bb90b3d5336a97580a7b890c53947bd0d53","src/inflate/mod.rs":"9252ddf7edf6b8205ff5820dcc22eaeb244130e135f5bbb416c9701ca6118e23","src/inflate/output_buffer.rs":"0081b3fde84d8d0045e281fb143793eca8e9043733314e5cf6f37f51ac97021c","src/inflate/stream.rs":"7c91db58a7076e95117d533c151881f1339536525121f58c4b59d17a634e17ba","src/lib.rs":"08b54d4c675f3c2901d493ce85895952b639781faa40bf0b620da6dff0a1fb91","src/shared.rs":"889b9d9d3b4bc0693f94c850806e9cf68ed9079e0ada2b2f51bfffe388e02c6a"},"package":"a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b"} \ No newline at end of file diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/BUILD.bazel b/third_party/cargo/vendor/miniz_oxide-0.4.4/BUILD.bazel similarity index 93% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/BUILD.bazel rename to third_party/cargo/vendor/miniz_oxide-0.4.4/BUILD.bazel index 575ba18..1534925 100644 --- a/third_party/cargo/vendor/miniz_oxide-0.4.3/BUILD.bazel +++ b/third_party/cargo/vendor/miniz_oxide-0.4.4/BUILD.bazel @@ -49,9 +49,9 @@ rust_library( "cargo-raze", "manual", ], - version = "0.4.3", + version = "0.4.4", # buildifier: leave-alone deps = [ - "//third_party/cargo/vendor/adler-0.2.3:adler", + "//third_party/cargo/vendor/adler-1.0.2:adler", ], ) diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/Cargo.toml b/third_party/cargo/vendor/miniz_oxide-0.4.4/Cargo.toml similarity index 97% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/Cargo.toml rename to third_party/cargo/vendor/miniz_oxide-0.4.4/Cargo.toml index 451db16..ce6ac31 100644 --- a/third_party/cargo/vendor/miniz_oxide-0.4.3/Cargo.toml +++ b/third_party/cargo/vendor/miniz_oxide-0.4.4/Cargo.toml @@ -13,7 +13,7 @@ [package] edition = "2018" name = "miniz_oxide" -version = "0.4.3" +version = "0.4.4" authors = ["Frommi ", "oyvindln "] build = "build.rs" exclude = ["benches/*", "tests/*"] @@ -29,7 +29,7 @@ repository = "https://github.com/Frommi/miniz_oxide/tree/master/miniz_oxide" [lib] name = "miniz_oxide" [dependencies.adler] -version = "0.2.3" +version = "1.0" default-features = false [dependencies.alloc] diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/LICENSE b/third_party/cargo/vendor/miniz_oxide-0.4.4/LICENSE similarity index 100% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/LICENSE rename to third_party/cargo/vendor/miniz_oxide-0.4.4/LICENSE diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/LICENSE-APACHE.md b/third_party/cargo/vendor/miniz_oxide-0.4.4/LICENSE-APACHE.md similarity index 100% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/LICENSE-APACHE.md rename to third_party/cargo/vendor/miniz_oxide-0.4.4/LICENSE-APACHE.md diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/LICENSE-MIT.md b/third_party/cargo/vendor/miniz_oxide-0.4.4/LICENSE-MIT.md similarity index 100% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/LICENSE-MIT.md rename to third_party/cargo/vendor/miniz_oxide-0.4.4/LICENSE-MIT.md diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/LICENSE-ZLIB.md b/third_party/cargo/vendor/miniz_oxide-0.4.4/LICENSE-ZLIB.md similarity index 100% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/LICENSE-ZLIB.md rename to third_party/cargo/vendor/miniz_oxide-0.4.4/LICENSE-ZLIB.md diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/Readme.md b/third_party/cargo/vendor/miniz_oxide-0.4.4/Readme.md similarity index 100% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/Readme.md rename to third_party/cargo/vendor/miniz_oxide-0.4.4/Readme.md diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/build.rs b/third_party/cargo/vendor/miniz_oxide-0.4.4/build.rs similarity index 100% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/build.rs rename to third_party/cargo/vendor/miniz_oxide-0.4.4/build.rs diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/src/deflate/buffer.rs b/third_party/cargo/vendor/miniz_oxide-0.4.4/src/deflate/buffer.rs similarity index 100% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/src/deflate/buffer.rs rename to third_party/cargo/vendor/miniz_oxide-0.4.4/src/deflate/buffer.rs diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/src/deflate/core.rs b/third_party/cargo/vendor/miniz_oxide-0.4.4/src/deflate/core.rs similarity index 99% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/src/deflate/core.rs rename to third_party/cargo/vendor/miniz_oxide-0.4.4/src/deflate/core.rs index d25ea52..c02bcc9 100644 --- a/third_party/cargo/vendor/miniz_oxide-0.4.3/src/deflate/core.rs +++ b/third_party/cargo/vendor/miniz_oxide-0.4.4/src/deflate/core.rs @@ -385,7 +385,7 @@ fn write_u16_le(val: u16, slice: &mut [u8], pos: usize) { // Read the two bytes starting at pos and interpret them as an u16. #[inline] -fn read_u16_le(slice: &[u8], pos: usize) -> u16 { +const fn read_u16_le(slice: &[u8], pos: usize) -> u16 { // The compiler is smart enough to optimize this into an unaligned load. slice[pos] as u16 | ((slice[pos + 1] as u16) << 8) } @@ -675,7 +675,7 @@ impl<'a> OutputBufferOxide<'a> { } } - fn save(&self) -> SavedOutputBufferOxide { + const fn save(&self) -> SavedOutputBufferOxide { SavedOutputBufferOxide { pos: self.inner_pos, bit_buffer: self.bit_buffer, @@ -1184,7 +1184,7 @@ struct DictOxide { pub size: usize, } -fn probes_from_flags(flags: u32) -> [u32; 2] { +const fn probes_from_flags(flags: u32) -> [u32; 2] { [ 1 + ((flags & 0xFFF) + 2) / 3, 1 + (((flags & 0xFFF) >> 2) + 2) / 3, @@ -1446,7 +1446,7 @@ struct LZOxide { } impl LZOxide { - fn new() -> Self { + const fn new() -> Self { LZOxide { codes: [0; LZ_CODE_BUF_SIZE], code_position: 1, diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/src/deflate/mod.rs b/third_party/cargo/vendor/miniz_oxide-0.4.4/src/deflate/mod.rs similarity index 100% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/src/deflate/mod.rs rename to third_party/cargo/vendor/miniz_oxide-0.4.4/src/deflate/mod.rs diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/src/deflate/stream.rs b/third_party/cargo/vendor/miniz_oxide-0.4.4/src/deflate/stream.rs similarity index 100% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/src/deflate/stream.rs rename to third_party/cargo/vendor/miniz_oxide-0.4.4/src/deflate/stream.rs diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/src/inflate/core.rs b/third_party/cargo/vendor/miniz_oxide-0.4.4/src/inflate/core.rs similarity index 99% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/src/inflate/core.rs rename to third_party/cargo/vendor/miniz_oxide-0.4.4/src/inflate/core.rs index 56df026..b18dbdd 100644 --- a/third_party/cargo/vendor/miniz_oxide-0.4.3/src/inflate/core.rs +++ b/third_party/cargo/vendor/miniz_oxide-0.4.4/src/inflate/core.rs @@ -26,7 +26,7 @@ struct HuffmanTable { } impl HuffmanTable { - fn new() -> HuffmanTable { + const fn new() -> HuffmanTable { HuffmanTable { code_size: [0; MAX_HUFF_SYMBOLS_0], look_up: [0; FAST_LOOKUP_SIZE as usize], diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/src/inflate/mod.rs b/third_party/cargo/vendor/miniz_oxide-0.4.4/src/inflate/mod.rs similarity index 100% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/src/inflate/mod.rs rename to third_party/cargo/vendor/miniz_oxide-0.4.4/src/inflate/mod.rs diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/src/inflate/output_buffer.rs b/third_party/cargo/vendor/miniz_oxide-0.4.4/src/inflate/output_buffer.rs similarity index 94% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/src/inflate/output_buffer.rs rename to third_party/cargo/vendor/miniz_oxide-0.4.4/src/inflate/output_buffer.rs index 0e9487f..89e6213 100644 --- a/third_party/cargo/vendor/miniz_oxide-0.4.3/src/inflate/output_buffer.rs +++ b/third_party/cargo/vendor/miniz_oxide-0.4.4/src/inflate/output_buffer.rs @@ -15,7 +15,7 @@ impl<'a> OutputBuffer<'a> { } #[inline] - pub fn position(&self) -> usize { + pub const fn position(&self) -> usize { self.position } @@ -49,7 +49,7 @@ impl<'a> OutputBuffer<'a> { } #[inline] - pub fn get_ref(&self) -> &[u8] { + pub const fn get_ref(&self) -> &[u8] { self.slice } diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/src/inflate/stream.rs b/third_party/cargo/vendor/miniz_oxide-0.4.4/src/inflate/stream.rs similarity index 99% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/src/inflate/stream.rs rename to third_party/cargo/vendor/miniz_oxide-0.4.4/src/inflate/stream.rs index 148d132..4e0c2ac 100644 --- a/third_party/cargo/vendor/miniz_oxide-0.4.3/src/inflate/stream.rs +++ b/third_party/cargo/vendor/miniz_oxide-0.4.4/src/inflate/stream.rs @@ -126,7 +126,7 @@ impl InflateState { } /// Return the status of the last call to `inflate` with this `InflateState`. - pub fn last_status(&self) -> TINFLStatus { + pub const fn last_status(&self) -> TINFLStatus { self.last_status } diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/src/lib.rs b/third_party/cargo/vendor/miniz_oxide-0.4.4/src/lib.rs similarity index 100% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/src/lib.rs rename to third_party/cargo/vendor/miniz_oxide-0.4.4/src/lib.rs diff --git a/third_party/cargo/vendor/miniz_oxide-0.4.3/src/shared.rs b/third_party/cargo/vendor/miniz_oxide-0.4.4/src/shared.rs similarity index 100% rename from third_party/cargo/vendor/miniz_oxide-0.4.3/src/shared.rs rename to third_party/cargo/vendor/miniz_oxide-0.4.4/src/shared.rs diff --git a/third_party/cargo/vendor/mio-0.6.23/BUILD.bazel b/third_party/cargo/vendor/mio-0.6.23/BUILD.bazel index 0ba87b5..fbf7d3f 100644 --- a/third_party/cargo/vendor/mio-0.6.23/BUILD.bazel +++ b/third_party/cargo/vendor/mio-0.6.23/BUILD.bazel @@ -55,7 +55,7 @@ rust_library( deps = [ "//third_party/cargo/vendor/cfg-if-0.1.10:cfg_if", "//third_party/cargo/vendor/iovec-0.1.4:iovec", - "//third_party/cargo/vendor/log-0.4.11:log", + "//third_party/cargo/vendor/log-0.4.14:log", "//third_party/cargo/vendor/net2-0.2.37:net2", "//third_party/cargo/vendor/slab-0.4.2:slab", ] + selects.with_or({ @@ -63,7 +63,7 @@ rust_library( ( "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", ): [ - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ], "//conditions:default": [], }) + selects.with_or({ diff --git a/third_party/cargo/vendor/mio-extras-2.0.6/BUILD.bazel b/third_party/cargo/vendor/mio-extras-2.0.6/BUILD.bazel index 5053303..1941613 100644 --- a/third_party/cargo/vendor/mio-extras-2.0.6/BUILD.bazel +++ b/third_party/cargo/vendor/mio-extras-2.0.6/BUILD.bazel @@ -50,7 +50,7 @@ rust_library( # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/lazycell-1.3.0:lazycell", - "//third_party/cargo/vendor/log-0.4.11:log", + "//third_party/cargo/vendor/log-0.4.14:log", "//third_party/cargo/vendor/mio-0.6.23:mio", "//third_party/cargo/vendor/slab-0.4.2:slab", ], diff --git a/third_party/cargo/vendor/ndk-0.2.1/BUILD.bazel b/third_party/cargo/vendor/ndk-0.2.1/BUILD.bazel index b57f832..8920c42 100644 --- a/third_party/cargo/vendor/ndk-0.2.1/BUILD.bazel +++ b/third_party/cargo/vendor/ndk-0.2.1/BUILD.bazel @@ -55,6 +55,6 @@ rust_library( "//third_party/cargo/vendor/jni-sys-0.3.0:jni_sys", "//third_party/cargo/vendor/ndk-sys-0.2.1:ndk_sys", "//third_party/cargo/vendor/num_enum-0.4.3:num_enum", - "//third_party/cargo/vendor/thiserror-1.0.23:thiserror", + "//third_party/cargo/vendor/thiserror-1.0.24:thiserror", ], ) diff --git a/third_party/cargo/vendor/ndk-glue-0.2.1/BUILD.bazel b/third_party/cargo/vendor/ndk-glue-0.2.1/BUILD.bazel index 02cfe33..8cf5918 100644 --- a/third_party/cargo/vendor/ndk-glue-0.2.1/BUILD.bazel +++ b/third_party/cargo/vendor/ndk-glue-0.2.1/BUILD.bazel @@ -54,8 +54,8 @@ rust_library( # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/lazy_static-1.4.0:lazy_static", - "//third_party/cargo/vendor/libc-0.2.82:libc", - "//third_party/cargo/vendor/log-0.4.11:log", + "//third_party/cargo/vendor/libc-0.2.92:libc", + "//third_party/cargo/vendor/log-0.4.14:log", "//third_party/cargo/vendor/ndk-0.2.1:ndk", "//third_party/cargo/vendor/ndk-sys-0.2.1:ndk_sys", ], diff --git a/third_party/cargo/vendor/ndk-macro-0.2.0/BUILD.bazel b/third_party/cargo/vendor/ndk-macro-0.2.0/BUILD.bazel index 8b75931..ccb3842 100644 --- a/third_party/cargo/vendor/ndk-macro-0.2.0/BUILD.bazel +++ b/third_party/cargo/vendor/ndk-macro-0.2.0/BUILD.bazel @@ -52,8 +52,8 @@ rust_library( deps = [ "//third_party/cargo/vendor/darling-0.10.2:darling", "//third_party/cargo/vendor/proc-macro-crate-0.1.5:proc_macro_crate", - "//third_party/cargo/vendor/proc-macro2-1.0.24:proc_macro2", - "//third_party/cargo/vendor/quote-1.0.8:quote", - "//third_party/cargo/vendor/syn-1.0.58:syn", + "//third_party/cargo/vendor/proc-macro2-1.0.26:proc_macro2", + "//third_party/cargo/vendor/quote-1.0.9:quote", + "//third_party/cargo/vendor/syn-1.0.68:syn", ], ) diff --git a/third_party/cargo/vendor/net2-0.2.37/BUILD.bazel b/third_party/cargo/vendor/net2-0.2.37/BUILD.bazel index e8d3016..0f3237c 100644 --- a/third_party/cargo/vendor/net2-0.2.37/BUILD.bazel +++ b/third_party/cargo/vendor/net2-0.2.37/BUILD.bazel @@ -59,7 +59,7 @@ rust_library( ( "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", ): [ - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ], "//conditions:default": [], }) + selects.with_or({ diff --git a/third_party/cargo/vendor/nix-0.18.0/BUILD.bazel b/third_party/cargo/vendor/nix-0.18.0/BUILD.bazel index 476b6be..f3b6a1d 100644 --- a/third_party/cargo/vendor/nix-0.18.0/BUILD.bazel +++ b/third_party/cargo/vendor/nix-0.18.0/BUILD.bazel @@ -55,7 +55,7 @@ rust_library( deps = [ "//third_party/cargo/vendor/bitflags-1.2.1:bitflags", "//third_party/cargo/vendor/cfg-if-0.1.10:cfg_if", - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ] + selects.with_or({ # cfg(any(target_os = "android", target_os = "linux")) ( diff --git a/third_party/cargo/vendor/nix-0.19.1/.cargo-checksum.json b/third_party/cargo/vendor/nix-0.19.1/.cargo-checksum.json deleted file mode 100644 index 317efa0..0000000 --- a/third_party/cargo/vendor/nix-0.19.1/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"CHANGELOG.md":"94bf3c3ba886ba510a94507541b1510465a37f4d902cc0935b0fdc468873f187","CONTRIBUTING.md":"a9101e3d1487170d691d5f062ff49a433c167582ac8984dd41a744be92652f74","CONVENTIONS.md":"df0d4fe9fe65af0bfa4723dc7b641d5130087259799e6b404ad63884f79031cb","Cargo.toml":"31f14618eb0bfe50dfc382c8d26c21ca9818a3ca741bef13dbc54f6c0f94ab11","LICENSE":"66e3ee1fa7f909ad3c612d556f2a0cdabcd809ad6e66f3b0605015ac64841b70","README.md":"62bb31d1fef6738d5f23ea6fc1a4af40bcc496062e42830b9bb1326f15d3d7c2","src/dir.rs":"1b242901595b01edb7793fb526e38f4528bcb00229eb6923cb3390704a293e64","src/env.rs":"bc52e80d3fa6c5388e3e23767d214a72f88d2927c5604246016c4cf978bbbeb7","src/errno.rs":"148806ab1722a82fb5e1e24d0ec47a7f2cf26276798a9736bb463edb5bdd5fc3","src/fcntl.rs":"cf0c10a7834d55ece5e51d83eb199624ac75091526d499895f8d0f0734d4e352","src/features.rs":"670bb92a591e8cf67458b9a7c0ad79cbba974f14e82a5a27aab93f92a562da3e","src/ifaddrs.rs":"4f19ed3b15f5059c2859958c6aa313d6fa75703e68f8608359ef8e0089508ed3","src/kmod.rs":"873bec7f32e30a552a4fd86d5f884c2b3a0cd73012121dfe1587b508475beb0a","src/lib.rs":"d589fb0e078608aaf56be0b652b3133b843a12098d5ab5ad6b3c6dabb4bca15a","src/macros.rs":"a80227a253bd876fd4069f70ae6e995e6b1a7f9ebe284b68233f86bf289216e1","src/mount.rs":"cde7c59b79a8e535c4d8c57c53d7825384b110be244803b1f895d5a3b97bc72f","src/mqueue.rs":"324c142095a0c85550d171f3aa19b2591e109be48fc8c021acb5d6793122371b","src/net/if_.rs":"928066a6ec473ce565e2323858ff64e179e4b81b80768d830dd29008f2fafb7f","src/net/mod.rs":"577f70170e53d4a6de1abb70bf8f1031ec3e65c0e63ef5fcf05c907125e7ac17","src/poll.rs":"ba635fbed688a165279a9851269310220befd211c8fcf5761d1a62dab39ba52b","src/pty.rs":"f039f7a21e3456349c2cd2f5b1a9beb38273504b82bbfc782701b6ee7b0cd223","src/sched.rs":"2bdb5ce449bc093a8eecdd8964e5d05feee3e7b804e4271e40d674178295df79","src/sys/aio.rs":"bbcc1d8639a9c89c66c00357353dde94d0f48b516b4354ab3d3dcfc16a2e0b56","src/sys/epoll.rs":"a3ace2282e77989e9b927dcdca8ad2070d4fb7710398af0763ea6eb26d431968","src/sys/event.rs":"075e84e5a5d1fd922fbcac8c01c8e7cd7f1a1c1f8f60ede8f7ebc5fe6d5e76ac","src/sys/eventfd.rs":"b5301029e95f77f280cc169bb8aa247352efbb600c749f26e2fffa0474c872bb","src/sys/inotify.rs":"114be3860c9daaee1c781df90b63abb87cd82d677c4470b359bbf0787a25d302","src/sys/ioctl/bsd.rs":"853b50c3539dc4a1284c847f2689fde3dbed5dca7a8599db36193048e030296a","src/sys/ioctl/linux.rs":"642b25d3997518815dea454fa976e9067ad5fe4ed75622e7540e3f0d0c7d320a","src/sys/ioctl/mod.rs":"dd3435e44c42f55a600e40599038bebc7417934dade00113ef0f3b6318bf54de","src/sys/memfd.rs":"35dba6c3eeb4f74edbf86530ba1696d9251495b82b814a36b76e6d2b26490e3c","src/sys/mman.rs":"5d94c9ebc9266d1531f2198fca942892cc2ce7657f3d48fb24265a47201b592d","src/sys/mod.rs":"992f986b394f576d3949ad1c1bbbd9b3d8db88eb344c0621bc2d753bb5319a9a","src/sys/pthread.rs":"cfa9ccd6f3b86c0c3fe012773c9c82a7813b298c2f20f8ab629781db627ce56b","src/sys/ptrace/bsd.rs":"feced79575c5dbeaf0a0877ba888761675310b277f477acee820c785e132dbe9","src/sys/ptrace/linux.rs":"34524ad4911d2ef7ec0e21a49e479d6fd91d4ef5c660e0b7e2afa4878b27367a","src/sys/ptrace/mod.rs":"671a6ccac955e75d5998f7e53ffc45ed4c7b6522a0f24a0937d60141f692dd39","src/sys/quota.rs":"4ceb895896bbd0bb67ce98e91dec3bd40c9a7d5936abbe13b74691c6afa07f9f","src/sys/reboot.rs":"1fd26955bc095bd4f8804c850183f527560803cbceaf345c3760c8f32fe1224f","src/sys/select.rs":"02226a733d160701f07d27384f87bf21032f3cc4d5a6214dc61e398dd1606b60","src/sys/sendfile.rs":"110955788e3f5f36a7e563c334c6fe400edfb93d6cb2fdce6b8a79d2e892f8ce","src/sys/signal.rs":"1124db47c3e84fc4b539147809ebed8d13ca349213a184abe4e0976f04873228","src/sys/signalfd.rs":"19ed3cc2ca0003efd90aba1590add0608fb5767828bdb851730325107adea097","src/sys/socket/addr.rs":"b78103e53376fe15696a31182e3cfc8d8a33495f154ea38d281881b620e6444d","src/sys/socket/mod.rs":"3e9718e6a27de8cf96d29e73b6caf8cd3b46425e77d013dedd8e1bbe6e5d9476","src/sys/socket/sockopt.rs":"42b335e7a2e2b8cf160506524490bb685bd2488ebff65921aa10f60363ffda7b","src/sys/stat.rs":"a969ae88221a50c89d54f97987d108d3c017339d7eedd66ac7218463d2bb07db","src/sys/statfs.rs":"7a3ea8d95c45abfdc6d6ac1530973abe3d5f2d79efd7da96ad9d0e90cbd0d7b6","src/sys/statvfs.rs":"09a7268f3f6f321961e4f25943236fe103fe8c7661ea841f4e71014fda0d8952","src/sys/sysinfo.rs":"c73b8baa51c6966f994c1cb45755b15e5fec8265021ea57f0fcdd28273388af3","src/sys/termios.rs":"1d4ae103e4edf7af1a43cbbea1c48a6ba423ac8ed27bd869071c751063e8f483","src/sys/time.rs":"e8c8452cf4c6d8d5285967aa39da3cbd431475822c82e65dcd78639ca3ef92da","src/sys/timerfd.rs":"3faac865fb6baaf27579ae04fd8a5ff7d4125679f90049e65942f5054b623050","src/sys/uio.rs":"a25dd7a84135ea50a671a7a06a8989dc9d53d3e755d36cef9f37cdc79a123d9d","src/sys/utsname.rs":"9509a092c837d1700f9f4ac30e4568e5b9b63ad8925a56cd8ad7add05d0ac452","src/sys/wait.rs":"29d805805756cb6fc50c9d24b528164f22ac4cb208935273c81dd60165f4aa62","src/time.rs":"00303521772c1f780db536faaf23523d47018b2c2de94cfc7959b5d4bbbd4758","src/ucontext.rs":"10fdfebcecafa8d1c6cf573a5768adc07b87e9ff52a0bdc2527e77f73608f264","src/unistd.rs":"705127ff5a6b65f1b476f366fb79d4208c4e8374c1064473109cd54ff8d03c00","test/sys/mod.rs":"e346b9d584b668cf0c5e5c3a941051d91da865c20f3eb976df5c1e689f498873","test/sys/test_aio.rs":"2e51cb9444fdabf1d3655464b988779f5d0f71ccb56114a1ff733f79755ecb2f","test/sys/test_aio_drop.rs":"b05b58b3fc5253f389e1869ee6fc3833701572fb68ed57bf79237080dac3125d","test/sys/test_epoll.rs":"35093d0cb1096a934dfc4f6efc737eadc4bdc2e2134d2a879061374a51b10c97","test/sys/test_inotify.rs":"a4f804bcf414b6635d9863c8534769a609009c451c3476cc839cdc30c439b3b1","test/sys/test_ioctl.rs":"39ddd52b27d942ab1b4018d213a378fb221598febc8fc7759ae5e6f746364396","test/sys/test_lio_listio_resubmit.rs":"29718e5fd04ef041125db4963f518f6f518b50436ea2df91e44c9c6b9418b704","test/sys/test_pthread.rs":"891726053083bf488655eca1518630b08fa7c5937433fb5e446a9eed181ff7c5","test/sys/test_ptrace.rs":"6c87f477cda8e883984a154d181cb52191a27d80a1e0430f18bcfb0599a79abd","test/sys/test_select.rs":"7ece285a78cb66852ba8e89cac82c2d4fcff7d17a5f35e282cc52a09f5820daf","test/sys/test_signal.rs":"82f829a16b4090e9c12bb39ec73bd2405dd7a6c2516b050f195763dea29195d3","test/sys/test_signalfd.rs":"2068a028c88395ff51c09e43b18c03d16e2d851f1d26ca1d121cdb5cb050f5c5","test/sys/test_socket.rs":"55fd0f33ad98c82220287e82795834ba7637559305507f65bb545f33b853e2b7","test/sys/test_sockopt.rs":"35cc57f660212adb58168d77ae71e6a24f55f574ec8d27b1f2b05d49db4b9091","test/sys/test_sysinfo.rs":"1e1bea9130fe38ccb07cd0ad7334c7be1e45efc33f7656a5973f8cad7126f225","test/sys/test_termios.rs":"93cd5cc181f1d8cef5c69aa23ddfabbf0480369cffab523e677c81e208998328","test/sys/test_timerfd.rs":"fcada956abd981e4d846da58e5640c5705b16026d47bccd1d603fae765ad10db","test/sys/test_uio.rs":"2d120e218fdfe30b1dc41dfbf4714b3d7f73b21040493bb3db122448782adb93","test/sys/test_wait.rs":"7b1b86e9af09f7695789f93e7821b93105d874bb3d6d9dad3ad453570bbc8be8","test/test.rs":"235de39d71d49c40c18d2a157a136c81af85bab17aad2b7e26bbe0fa51f7fdbe","test/test_clearenv.rs":"45ca548035b3c20ec87314715feaba2be973709a635d85b8cde46fd1d9f1ecd4","test/test_dir.rs":"6d3674ea890d7a3d966c7628029afd914313b2f95b8f8b5d0cb3455c3aa4d592","test/test_fcntl.rs":"b9ad7375113f1b2b8acbaa304befdc2ca0b447a0ae2c3b0287403933bb3f7cfd","test/test_kmod/hello_mod/Makefile":"0219f7bce0603f97d997fb377ca071966c90333ecc665e78a54dfeb97a9c811b","test/test_kmod/hello_mod/hello.c":"bcac6b19c5bd807e1f3878c15e426acc85785a8ade9840c3bb4d068635c9188c","test/test_kmod/mod.rs":"98baadbffeaa9a596699aee809e1c89655f45e37c89e757c546d0adb784f29a1","test/test_mount.rs":"6ec13eb7862d1f48febd6e6543d21e1ddab3e4b8b1c1a2c6d0e36b95a64d4560","test/test_mq.rs":"ee653fade4d769576702fa54440660d353ed7ab1284aa5a321f73fa1f6fedf93","test/test_net.rs":"ec6d580b87292519d514b0236bdd5abdd576fcf4835cfe49ed1ddb47c5f1aea3","test/test_nix_path.rs":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","test/test_poll.rs":"9787e4e3699a9b4a9bc40558383509157723456ee15341b94eb249ae4d0368aa","test/test_pty.rs":"56198cb9537ec3409717acecb133a49eb48bfc180c135ff0296974ec466d1171","test/test_ptymaster_drop.rs":"1b31e72c3d56145e27ca6530b87d24b758bb4e5e2c97cec8e821d1fb735a9a33","test/test_sched.rs":"f8ad92eb554164b0f92428f716db99040186d741cc6e1976f7930f099652f70c","test/test_sendfile.rs":"e0cbabbd34052ccaa03d6555d5631686aa076728f6378ee90f7ecec68f891144","test/test_stat.rs":"9668fc1f894b7f8a60dfddbdaef4bc833463e4e0cf04c1cff7f8c0569a226ad2","test/test_time.rs":"199b1c89d373e9398cca97f83ecd6459c6bd5ba7adca28013d9109d5cbad03f3","test/test_unistd.rs":"3fa72a4cde45bf3ad1a9971948f2b13037a1defd6eabcc8ffe09fd10fba8594b"},"package":"b2ccba0cfe4fdf15982d1674c69b1fd80bad427d293849982668dfe454bd61f2"} \ No newline at end of file diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test.rs b/third_party/cargo/vendor/nix-0.19.1/test/test.rs deleted file mode 100644 index 8ad09b6..0000000 --- a/third_party/cargo/vendor/nix-0.19.1/test/test.rs +++ /dev/null @@ -1,203 +0,0 @@ -#[macro_use] -extern crate cfg_if; -#[cfg_attr(not(target_os = "redox"), macro_use)] -extern crate nix; -#[macro_use] -extern crate lazy_static; - -macro_rules! skip { - ($($reason: expr),+) => { - use ::std::io::{self, Write}; - - let stderr = io::stderr(); - let mut handle = stderr.lock(); - writeln!(handle, $($reason),+).unwrap(); - return; - } -} - -cfg_if! { - if #[cfg(any(target_os = "android", target_os = "linux"))] { - macro_rules! require_capability { - ($capname:ident) => { - use ::caps::{Capability, CapSet, has_cap}; - - if !has_cap(None, CapSet::Effective, Capability::$capname) - .unwrap() - { - skip!("Insufficient capabilities. Skipping test."); - } - } - } - } else if #[cfg(not(target_os = "redox"))] { - macro_rules! require_capability { - ($capname:ident) => {} - } - } -} - -#[cfg(target_os = "freebsd")] -macro_rules! skip_if_jailed { - ($name:expr) => { - use ::sysctl::CtlValue; - - if let CtlValue::Int(1) = ::sysctl::value("security.jail.jailed") - .unwrap() - { - skip!("{} cannot run in a jail. Skipping test.", $name); - } - } -} - -#[cfg(not(target_os = "redox"))] -macro_rules! skip_if_not_root { - ($name:expr) => { - use nix::unistd::Uid; - - if !Uid::current().is_root() { - skip!("{} requires root privileges. Skipping test.", $name); - } - }; -} - -cfg_if! { - if #[cfg(any(target_os = "android", target_os = "linux"))] { - macro_rules! skip_if_seccomp { - ($name:expr) => { - if let Ok(s) = std::fs::read_to_string("/proc/self/status") { - for l in s.lines() { - let mut fields = l.split_whitespace(); - if fields.next() == Some("Seccomp:") && - fields.next() != Some("0") - { - skip!("{} cannot be run in Seccomp mode. Skipping test.", - stringify!($name)); - } - } - } - } - } - } else if #[cfg(not(target_os = "redox"))] { - macro_rules! skip_if_seccomp { - ($name:expr) => {} - } - } -} - -cfg_if! { - if #[cfg(target_os = "linux")] { - macro_rules! require_kernel_version { - ($name:expr, $version_requirement:expr) => { - use semver::{Version, VersionReq}; - - let version_requirement = VersionReq::parse($version_requirement) - .expect("Bad match_version provided"); - - let uname = nix::sys::utsname::uname(); - - let mut version = Version::parse(uname.release()).unwrap(); - - //Keep only numeric parts - version.pre.clear(); - version.build.clear(); - - if !version_requirement.matches(&version) { - skip!("Skip {} because kernel version `{}` doesn't match the requirement `{}`", - stringify!($name), version, version_requirement); - } - } - } - } -} - -mod sys; -#[cfg(not(target_os = "redox"))] -mod test_dir; -mod test_fcntl; -#[cfg(any(target_os = "android", - target_os = "linux"))] -mod test_kmod; -#[cfg(any(target_os = "dragonfly", - target_os = "freebsd", - target_os = "fushsia", - target_os = "linux", - target_os = "netbsd"))] -mod test_mq; -#[cfg(not(target_os = "redox"))] -mod test_net; -mod test_nix_path; -mod test_poll; -#[cfg(not(target_os = "redox"))] -mod test_pty; -#[cfg(any(target_os = "android", - target_os = "linux"))] -mod test_sched; -#[cfg(any(target_os = "android", - target_os = "freebsd", - target_os = "ios", - target_os = "linux", - target_os = "macos"))] -mod test_sendfile; -mod test_stat; -mod test_time; -mod test_unistd; - -use std::os::unix::io::RawFd; -use std::path::PathBuf; -use std::sync::{Mutex, RwLock, RwLockWriteGuard}; -use nix::unistd::{chdir, getcwd, read}; - -/// Helper function analogous to `std::io::Read::read_exact`, but for `RawFD`s -fn read_exact(f: RawFd, buf: &mut [u8]) { - let mut len = 0; - while len < buf.len() { - // get_mut would be better than split_at_mut, but it requires nightly - let (_, remaining) = buf.split_at_mut(len); - len += read(f, remaining).unwrap(); - } -} - -lazy_static! { - /// Any test that changes the process's current working directory must grab - /// the RwLock exclusively. Any process that cares about the current - /// working directory must grab it shared. - pub static ref CWD_LOCK: RwLock<()> = RwLock::new(()); - /// Any test that creates child processes must grab this mutex, regardless - /// of what it does with those children. - pub static ref FORK_MTX: Mutex<()> = Mutex::new(()); - /// Any test that changes the process's supplementary groups must grab this - /// mutex - pub static ref GROUPS_MTX: Mutex<()> = Mutex::new(()); - /// Any tests that loads or unloads kernel modules must grab this mutex - pub static ref KMOD_MTX: Mutex<()> = Mutex::new(()); - /// Any test that calls ptsname(3) must grab this mutex. - pub static ref PTSNAME_MTX: Mutex<()> = Mutex::new(()); - /// Any test that alters signal handling must grab this mutex. - pub static ref SIGNAL_MTX: Mutex<()> = Mutex::new(()); -} - -/// RAII object that restores a test's original directory on drop -struct DirRestore<'a> { - d: PathBuf, - _g: RwLockWriteGuard<'a, ()> -} - -impl<'a> DirRestore<'a> { - fn new() -> Self { - let guard = crate::CWD_LOCK.write() - .expect("Lock got poisoned by another test"); - DirRestore{ - _g: guard, - d: getcwd().unwrap(), - } - } -} - -impl<'a> Drop for DirRestore<'a> { - fn drop(&mut self) { - let r = chdir(&self.d); - if std::thread::panicking() { - r.unwrap(); - } - } -} diff --git a/third_party/cargo/vendor/nix-0.20.0/.cargo-checksum.json b/third_party/cargo/vendor/nix-0.20.0/.cargo-checksum.json new file mode 100644 index 0000000..72eb4d1 --- /dev/null +++ b/third_party/cargo/vendor/nix-0.20.0/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"3e0a33a313c3d40823d692ce5c08956b4fd3fafa8c3c76427e85619a56e105e2","CONTRIBUTING.md":"7da4f8c2ff8e06850bdd9ebc0a3552419fd21d2c6bb0c6f0719566e263b0a1b9","CONVENTIONS.md":"df0d4fe9fe65af0bfa4723dc7b641d5130087259799e6b404ad63884f79031cb","Cargo.toml":"b675bc0871541506d722a54a6b8ef21de901a142b2221f4da84cbdac84f81a16","LICENSE":"66e3ee1fa7f909ad3c612d556f2a0cdabcd809ad6e66f3b0605015ac64841b70","README.md":"0332325aa2edf9e1cf79e21cbe27d3fdad0996eddccbebf22419bcc5344e94bd","src/dir.rs":"52170e8bfc8c4bc1996db2f5cd5a2aace71beac59e4a0e7c1817fdecbf8bd6a7","src/env.rs":"bc52e80d3fa6c5388e3e23767d214a72f88d2927c5604246016c4cf978bbbeb7","src/errno.rs":"1aab33e5dcab9c6f83e48e452f361840645ce6a434bc13bd8ab9abb0e0ef25c3","src/fcntl.rs":"7f3f95baad70ceb1231b8a647988a8e54292d84176820eb6a9f89d40f309c3a6","src/features.rs":"2cb080da3f26eca2d2e18282a41afec921426423a6354a50b840cf20f3f153f6","src/ifaddrs.rs":"4f19ed3b15f5059c2859958c6aa313d6fa75703e68f8608359ef8e0089508ed3","src/kmod.rs":"873bec7f32e30a552a4fd86d5f884c2b3a0cd73012121dfe1587b508475beb0a","src/lib.rs":"ae1a16e142c47afc3f52a07a2afb2fc013cfd427df955aa42e4bd372c77c49d5","src/macros.rs":"a80227a253bd876fd4069f70ae6e995e6b1a7f9ebe284b68233f86bf289216e1","src/mount.rs":"cde7c59b79a8e535c4d8c57c53d7825384b110be244803b1f895d5a3b97bc72f","src/mqueue.rs":"3520495f6a881a7239fba19e90234f7fc9df6729b6bc150bd2e6664b7c98d6a1","src/net/if_.rs":"928066a6ec473ce565e2323858ff64e179e4b81b80768d830dd29008f2fafb7f","src/net/mod.rs":"577f70170e53d4a6de1abb70bf8f1031ec3e65c0e63ef5fcf05c907125e7ac17","src/poll.rs":"ba635fbed688a165279a9851269310220befd211c8fcf5761d1a62dab39ba52b","src/pty.rs":"7a73ba21b2ec8910f7932e456d2fb097a0553c5fe07717238c58455e3de7b275","src/sched.rs":"2bdb5ce449bc093a8eecdd8964e5d05feee3e7b804e4271e40d674178295df79","src/sys/aio.rs":"bbcc1d8639a9c89c66c00357353dde94d0f48b516b4354ab3d3dcfc16a2e0b56","src/sys/epoll.rs":"a3ace2282e77989e9b927dcdca8ad2070d4fb7710398af0763ea6eb26d431968","src/sys/event.rs":"075e84e5a5d1fd922fbcac8c01c8e7cd7f1a1c1f8f60ede8f7ebc5fe6d5e76ac","src/sys/eventfd.rs":"b5301029e95f77f280cc169bb8aa247352efbb600c749f26e2fffa0474c872bb","src/sys/inotify.rs":"114be3860c9daaee1c781df90b63abb87cd82d677c4470b359bbf0787a25d302","src/sys/ioctl/bsd.rs":"853b50c3539dc4a1284c847f2689fde3dbed5dca7a8599db36193048e030296a","src/sys/ioctl/linux.rs":"642b25d3997518815dea454fa976e9067ad5fe4ed75622e7540e3f0d0c7d320a","src/sys/ioctl/mod.rs":"dd3435e44c42f55a600e40599038bebc7417934dade00113ef0f3b6318bf54de","src/sys/memfd.rs":"35dba6c3eeb4f74edbf86530ba1696d9251495b82b814a36b76e6d2b26490e3c","src/sys/mman.rs":"bdca4a151dc31d27c7435e30a5030ad2edef9dd3ac69a33363454cada8466ca3","src/sys/mod.rs":"b8d7d9e3cb331f1d972699cfbaa54fff34a9f26eaba38b8ee49e84bfeee22bd3","src/sys/personality.rs":"2019e58aa69c5ad68ae060e1b9a399138a2e4742f37a868e2681588963ca8acf","src/sys/pthread.rs":"cfa9ccd6f3b86c0c3fe012773c9c82a7813b298c2f20f8ab629781db627ce56b","src/sys/ptrace/bsd.rs":"feced79575c5dbeaf0a0877ba888761675310b277f477acee820c785e132dbe9","src/sys/ptrace/linux.rs":"34524ad4911d2ef7ec0e21a49e479d6fd91d4ef5c660e0b7e2afa4878b27367a","src/sys/ptrace/mod.rs":"671a6ccac955e75d5998f7e53ffc45ed4c7b6522a0f24a0937d60141f692dd39","src/sys/quota.rs":"4ceb895896bbd0bb67ce98e91dec3bd40c9a7d5936abbe13b74691c6afa07f9f","src/sys/reboot.rs":"1fd26955bc095bd4f8804c850183f527560803cbceaf345c3760c8f32fe1224f","src/sys/select.rs":"02226a733d160701f07d27384f87bf21032f3cc4d5a6214dc61e398dd1606b60","src/sys/sendfile.rs":"110955788e3f5f36a7e563c334c6fe400edfb93d6cb2fdce6b8a79d2e892f8ce","src/sys/signal.rs":"53232ef1165272d109173fbba769cde77f3446050dbdaf36e56c4c0fde084348","src/sys/signalfd.rs":"37704804eb75571d03bbc1c99bd90846ae50ce361cc9998777744f8265d51074","src/sys/socket/addr.rs":"1b5c04140abacf08b56e78fe1fa9a3db784ff49be2a6b5709b38c4497e9e1378","src/sys/socket/mod.rs":"738b7a4d5ac22dbec08fd336f796894f03827ba997aaf94a266fa1fb24d716f6","src/sys/socket/sockopt.rs":"42b335e7a2e2b8cf160506524490bb685bd2488ebff65921aa10f60363ffda7b","src/sys/stat.rs":"a969ae88221a50c89d54f97987d108d3c017339d7eedd66ac7218463d2bb07db","src/sys/statfs.rs":"6bd23f941107dc79ec34dc50516ff5eb18d9fad108ad976796669505692c1582","src/sys/statvfs.rs":"09a7268f3f6f321961e4f25943236fe103fe8c7661ea841f4e71014fda0d8952","src/sys/sysinfo.rs":"1aa6f402bc10689c5dd7ad454ecb60834e2b065dddbd3d87d1daecf88cb2b3ee","src/sys/termios.rs":"1d4ae103e4edf7af1a43cbbea1c48a6ba423ac8ed27bd869071c751063e8f483","src/sys/time.rs":"cc955b6b6647ca1db33ac076780ca6c984200e3cc47df5d836b1528489cdef70","src/sys/timerfd.rs":"51443f37b1dd4b03f16e1b569945f0ae715db4028f69e3ddd6c311db00e67ab3","src/sys/uio.rs":"a25dd7a84135ea50a671a7a06a8989dc9d53d3e755d36cef9f37cdc79a123d9d","src/sys/utsname.rs":"9509a092c837d1700f9f4ac30e4568e5b9b63ad8925a56cd8ad7add05d0ac452","src/sys/wait.rs":"ab18e66acaf161750394d802409ee8c95707dbd68d2fb59c88f7d4ed8936a1be","src/time.rs":"957845f8c689aec3c5dcf1af8bbc274a28ed5a214e4ee31ec8a89ed5eea0d3f1","src/ucontext.rs":"10fdfebcecafa8d1c6cf573a5768adc07b87e9ff52a0bdc2527e77f73608f264","src/unistd.rs":"4d8fecd258448fbfb1f99cc064e9522d299ac92853cbdc4dc4b8b7745771c1b6","test/common/mod.rs":"a26ecf30fc06008bab21d96eabf711bb0c41e8b50fe4c1f35cb2797ef405296c","test/sys/mod.rs":"c6f6a376fca73025bd76043a1739f54d24e856d4d0af9c58cc2b9d730ab87144","test/sys/test_aio.rs":"f21c157a07a29d60b0d68baa78ce24b352a19a35eaced0a792f62fa16d38617f","test/sys/test_aio_drop.rs":"eb086fcebd53ec82359ed7323f039b16ef7abced66b111f4876486fb058476e5","test/sys/test_epoll.rs":"35093d0cb1096a934dfc4f6efc737eadc4bdc2e2134d2a879061374a51b10c97","test/sys/test_inotify.rs":"a4f804bcf414b6635d9863c8534769a609009c451c3476cc839cdc30c439b3b1","test/sys/test_ioctl.rs":"39ddd52b27d942ab1b4018d213a378fb221598febc8fc7759ae5e6f746364396","test/sys/test_lio_listio_resubmit.rs":"29718e5fd04ef041125db4963f518f6f518b50436ea2df91e44c9c6b9418b704","test/sys/test_mman.rs":"b129b1d40d7a6e23cfc10956f9aa689d578a745f82fa267d24c40475063b592c","test/sys/test_pthread.rs":"891726053083bf488655eca1518630b08fa7c5937433fb5e446a9eed181ff7c5","test/sys/test_ptrace.rs":"46e51267cc93e45894a1e5a194563af5fb65a170dca95ad7cf9110520d764703","test/sys/test_select.rs":"7ece285a78cb66852ba8e89cac82c2d4fcff7d17a5f35e282cc52a09f5820daf","test/sys/test_signal.rs":"753f2ccbfcf2c5353a75b1e48d746a07c1949defba515c0ceee589ad1ed0aff6","test/sys/test_signalfd.rs":"2068a028c88395ff51c09e43b18c03d16e2d851f1d26ca1d121cdb5cb050f5c5","test/sys/test_socket.rs":"d70f1d8d5712b9f03110dc24f31607d8d7d95d69a9fa0847d1dc7ab5a2564511","test/sys/test_sockopt.rs":"3334e12322e8b4e7c095ddc4a40a2d0e73a0d3a6e1820a6e0970eb8e1136c6de","test/sys/test_sysinfo.rs":"1e1bea9130fe38ccb07cd0ad7334c7be1e45efc33f7656a5973f8cad7126f225","test/sys/test_termios.rs":"93cd5cc181f1d8cef5c69aa23ddfabbf0480369cffab523e677c81e208998328","test/sys/test_timerfd.rs":"fcada956abd981e4d846da58e5640c5705b16026d47bccd1d603fae765ad10db","test/sys/test_uio.rs":"ae915c03e4f64ce370ae46f5dbe37834dae2849bb9fa7961872cec50f45de1f4","test/sys/test_wait.rs":"1fefed60ea3f9c5d8d4518e1d7a122d50aad44c2bd87873ac9ddc31ecdcc5a39","test/test.rs":"be9c29b8a8c9669b6674746ac8065c828a5d1d40ba41226846fe964310a18188","test/test_clearenv.rs":"45ca548035b3c20ec87314715feaba2be973709a635d85b8cde46fd1d9f1ecd4","test/test_dir.rs":"e0dc7c317871eda3873a5d9df801c2ebb34cd958210c42a15f8dff623f05cae0","test/test_fcntl.rs":"e60c1dde6d0a6fde7a52cf98332e5b96fef5749868f0313cb7082bda7a66adb9","test/test_kmod/hello_mod/Makefile":"0219f7bce0603f97d997fb377ca071966c90333ecc665e78a54dfeb97a9c811b","test/test_kmod/hello_mod/hello.c":"bcac6b19c5bd807e1f3878c15e426acc85785a8ade9840c3bb4d068635c9188c","test/test_kmod/mod.rs":"07f5445812593c994d1c25d5c8669aa3c4b1750f3b8ed2c1ddb1c661809983dc","test/test_mount.rs":"55503e8b28f77b45d755d549375cab34fa3a3cc9b94cbb23cfbd4426c5d9cb9c","test/test_mq.rs":"1020a4eb2f88cc29c59c44ad965d0573fba2beeb4c8986060aac56de99eea63c","test/test_net.rs":"ec6d580b87292519d514b0236bdd5abdd576fcf4835cfe49ed1ddb47c5f1aea3","test/test_nix_path.rs":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","test/test_poll.rs":"6942da37678835c0cc89da3da566ac7ef414983d05d1b05b8ff558249c7113c1","test/test_pty.rs":"56198cb9537ec3409717acecb133a49eb48bfc180c135ff0296974ec466d1171","test/test_ptymaster_drop.rs":"d162510cc96b8b7389d8bc34e097db1c80b84b5070c1d16f15b053ffd20cfa17","test/test_sched.rs":"f8ad92eb554164b0f92428f716db99040186d741cc6e1976f7930f099652f70c","test/test_sendfile.rs":"e0cbabbd34052ccaa03d6555d5631686aa076728f6378ee90f7ecec68f891144","test/test_stat.rs":"9668fc1f894b7f8a60dfddbdaef4bc833463e4e0cf04c1cff7f8c0569a226ad2","test/test_time.rs":"199b1c89d373e9398cca97f83ecd6459c6bd5ba7adca28013d9109d5cbad03f3","test/test_unistd.rs":"9bf047d877fd7c0826a2241737574923c3fd102a6b143b6d9710f52af5655588"},"package":"fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a"} \ No newline at end of file diff --git a/third_party/cargo/vendor/nix-0.19.1/BUILD.bazel b/third_party/cargo/vendor/nix-0.20.0/BUILD.bazel similarity index 95% rename from third_party/cargo/vendor/nix-0.19.1/BUILD.bazel rename to third_party/cargo/vendor/nix-0.20.0/BUILD.bazel index c344364..90098d3 100644 --- a/third_party/cargo/vendor/nix-0.19.1/BUILD.bazel +++ b/third_party/cargo/vendor/nix-0.20.0/BUILD.bazel @@ -48,12 +48,12 @@ rust_library( "cargo-raze", "manual", ], - version = "0.19.1", + version = "0.20.0", # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/bitflags-1.2.1:bitflags", "//third_party/cargo/vendor/cfg-if-1.0.0:cfg_if", - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ] + selects.with_or({ # cfg(any(target_os = "android", target_os = "linux")) ( diff --git a/third_party/cargo/vendor/nix-0.19.1/CHANGELOG.md b/third_party/cargo/vendor/nix-0.20.0/CHANGELOG.md similarity index 96% rename from third_party/cargo/vendor/nix-0.19.1/CHANGELOG.md rename to third_party/cargo/vendor/nix-0.20.0/CHANGELOG.md index 77f38c3..1297ba7 100644 --- a/third_party/cargo/vendor/nix-0.19.1/CHANGELOG.md +++ b/third_party/cargo/vendor/nix-0.20.0/CHANGELOG.md @@ -3,15 +3,46 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). -## [Unreleased] - ReleaseDate +## [0.20.0] - 20 February 2021 ### Added + +- Added a `passwd` field to `Group` (#[1338](https://github.com/nix-rust/nix/pull/1338)) +- Added `mremap` (#[1306](https://github.com/nix-rust/nix/pull/1306)) +- Added `personality` (#[1331](https://github.com/nix-rust/nix/pull/1331)) +- Added limited Fuchsia support (#[1285](https://github.com/nix-rust/nix/pull/1285)) +- Added `getpeereid` (#[1342](https://github.com/nix-rust/nix/pull/1342)) +- Implemented `IntoIterator` for `Dir` + (#[1333](https://github.com/nix-rust/nix/pull/1333)). + ### Changed + +- Minimum supported Rust version is now 1.40.0. + ([#1356](https://github.com/nix-rust/nix/pull/1356)) +- i686-apple-darwin has been demoted to Tier 2 support, because it's deprecated + by Xcode. + (#[1350](https://github.com/nix-rust/nix/pull/1350)) +- Fixed calling `recvfrom` on an `AddrFamily::Packet` socket + (#[1344](https://github.com/nix-rust/nix/pull/1344)) + ### Fixed +- `TimerFd` now closes the underlying fd on drop. + ([#1381](https://github.com/nix-rust/nix/pull/1381)) +- Define `*_MAGIC` filesystem constants on Linux s390x + (#[1372](https://github.com/nix-rust/nix/pull/1372)) +- mqueue, sysinfo, timespec, statfs, test_ptrace_syscall() on x32 + (#[1366](https://github.com/nix-rust/nix/pull/1366)) + ### Removed +- `Dir`, `SignalFd`, and `PtyMaster` are no longer `Clone`. + (#[1382](https://github.com/nix-rust/nix/pull/1382)) +- Removed `SockLevel`, which hasn't been used for a few years + (#[1362](https://github.com/nix-rust/nix/pull/1362)) +- Removed both `Copy` and `Clone` from `TimerFd`. + ([#1381](https://github.com/nix-rust/nix/pull/1381)) + ## [0.19.1] - 28 November 2020 ### Fixed - - Fixed bugs in `recvmmsg`. (#[1341](https://github.com/nix-rust/nix/pull/1341)) @@ -58,7 +89,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Derived `Ord`, `PartialOrd` for `unistd::Pid` (#[1189](https://github.com/nix-rust/nix/pull/1189)) - Added `select::FdSet::fds` method to iterate over file descriptors in a set. ([#1207](https://github.com/nix-rust/nix/pull/1207)) -- Added support for UDP generic segmentation offload (GSO) and generic +- Added support for UDP generic segmentation offload (GSO) and generic receive offload (GRO) ([#1209](https://github.com/nix-rust/nix/pull/1209)) - Added support for `sendmmsg` and `recvmmsg` calls (#[1208](https://github.com/nix-rust/nix/pull/1208)) diff --git a/third_party/cargo/vendor/nix-0.19.1/CONTRIBUTING.md b/third_party/cargo/vendor/nix-0.20.0/CONTRIBUTING.md similarity index 92% rename from third_party/cargo/vendor/nix-0.19.1/CONTRIBUTING.md rename to third_party/cargo/vendor/nix-0.20.0/CONTRIBUTING.md index 03a1f63..55990c4 100644 --- a/third_party/cargo/vendor/nix-0.19.1/CONTRIBUTING.md +++ b/third_party/cargo/vendor/nix-0.20.0/CONTRIBUTING.md @@ -76,21 +76,21 @@ add a test that would have failed without the fix. After you've made your change, make sure the tests pass in your development environment. We also have [continuous integration set up on -Travis-CI][travis-ci], which might find some issues on other platforms. The CI +Cirrus-CI][cirrus-ci], which might find some issues on other platforms. The CI will run once you open a pull request. There is also infrastructure for running tests for other targets locally. More information is available in the [CI Readme][ci-readme]. -[travis-ci]: https://travis-ci.org/nix-rust/nix +[cirrus-ci]: https://cirrus-ci.com/github/nix-rust/nix [ci-readme]: ci/README.md ### Disabling a test in the CI environment Sometimes there are features that cannot be tested in the CI environment. -To stop a test from running under CI, add `#[cfg_attr(travis, ignore)]` -to it. Please include a comment describing the reason it shouldn't run -under CI, and a link to an upstream issue if possible! +To stop a test from running under CI, add `skip_if_cirrus!()` to it. Please +describe the reason it shouldn't run under CI, and a link to an issue if +possible! ## bors, the bot who merges all the PRs diff --git a/third_party/cargo/vendor/nix-0.19.1/CONVENTIONS.md b/third_party/cargo/vendor/nix-0.20.0/CONVENTIONS.md similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/CONVENTIONS.md rename to third_party/cargo/vendor/nix-0.20.0/CONVENTIONS.md diff --git a/third_party/cargo/vendor/nix-0.19.1/Cargo.toml b/third_party/cargo/vendor/nix-0.20.0/Cargo.toml similarity index 91% rename from third_party/cargo/vendor/nix-0.19.1/Cargo.toml rename to third_party/cargo/vendor/nix-0.20.0/Cargo.toml index 23cdca7..0562246 100644 --- a/third_party/cargo/vendor/nix-0.19.1/Cargo.toml +++ b/third_party/cargo/vendor/nix-0.20.0/Cargo.toml @@ -13,15 +13,15 @@ [package] edition = "2018" name = "nix" -version = "0.19.1" +version = "0.20.0" authors = ["The nix-rust Project Developers"] -exclude = ["/.gitignore", "/.travis.yml", "/ci/*", "/Cross.toml", "/RELEASE_PROCEDURE.md", "/bors.toml"] +exclude = ["/.gitignore", "/.cirrus.yml", "/ci/*", "/Cross.toml", "/RELEASE_PROCEDURE.md", "/bors.toml"] description = "Rust friendly bindings to *nix APIs" categories = ["os::unix-apis"] license = "MIT" repository = "https://github.com/nix-rust/nix" [package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu", "aarch64-linux-android", "x86_64-apple-darwin", "aarch64-apple-ios", "x86_64-unknown-freebsd", "x86_64-unknown-openbsd", "x86_64-unknown-netbsd", "x86_64-unknown-dragonfly", "x86_64-unknown-redox"] +targets = ["x86_64-unknown-linux-gnu", "aarch64-linux-android", "x86_64-apple-darwin", "aarch64-apple-ios", "x86_64-unknown-freebsd", "x86_64-unknown-openbsd", "x86_64-unknown-netbsd", "x86_64-unknown-dragonfly", "x86_64-fuchsia", "x86_64-unknown-redox"] [[test]] name = "test" @@ -54,7 +54,7 @@ version = "1.1" version = "1.0" [dependencies.libc] -version = "0.2.78" +version = "0.2.82" features = ["extra_traits"] [dev-dependencies.bytes] version = "0.4.8" @@ -71,7 +71,7 @@ version = "0.9.0" [dev-dependencies.tempfile] version = "3.0.5" [target."cfg(any(target_os = \"android\", target_os = \"linux\"))".dev-dependencies.caps] -version = "0.3.1" +version = "0.5.1" [target."cfg(target_os = \"dragonfly\")".build-dependencies.cc] version = "1" [target."cfg(target_os = \"freebsd\")".dev-dependencies.sysctl] diff --git a/third_party/cargo/vendor/nix-0.19.1/LICENSE b/third_party/cargo/vendor/nix-0.20.0/LICENSE similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/LICENSE rename to third_party/cargo/vendor/nix-0.20.0/LICENSE diff --git a/third_party/cargo/vendor/nix-0.19.1/README.md b/third_party/cargo/vendor/nix-0.20.0/README.md similarity index 93% rename from third_party/cargo/vendor/nix-0.19.1/README.md rename to third_party/cargo/vendor/nix-0.20.0/README.md index 8059a5c..167d192 100644 --- a/third_party/cargo/vendor/nix-0.19.1/README.md +++ b/third_party/cargo/vendor/nix-0.20.0/README.md @@ -1,6 +1,6 @@ # Rust bindings to *nix APIs -[![Build Status](https://travis-ci.org/nix-rust/nix.svg?branch=master)](https://travis-ci.org/nix-rust/nix) +[![Cirrus Build Status](https://api.cirrus-ci.com/github/nix-rust/nix.svg)](https://cirrus-ci.com/github/nix-rust/nix) [![crates.io](http://meritbadge.herokuapp.com/nix)](https://crates.io/crates/nix) [Documentation (Releases)](https://docs.rs/nix/) @@ -50,7 +50,6 @@ Tier 1: * aarch64-unknown-linux-gnu * arm-unknown-linux-gnueabi * armv7-unknown-linux-gnueabihf - * i686-apple-darwin * i686-unknown-freebsd * i686-unknown-linux-gnu * i686-unknown-linux-musl @@ -73,6 +72,7 @@ Tier 2: * armv7-linux-androideabi * armv7s-apple-ios * i386-apple-ios + * i686-apple-darwin * i686-linux-android * powerpc-unknown-linux-gnu * s390x-unknown-linux-gnu @@ -81,17 +81,19 @@ Tier 2: * x86_64-unknown-netbsd Tier 3: + * x86_64-fuchsia * x86_64-unknown-redox + * x86_64-unknown-linux-gnux32 ## Usage -`nix` requires Rust 1.36.0 or newer. +`nix` requires Rust 1.40.0 or newer. To use `nix`, add this to your `Cargo.toml`: ```toml [dependencies] -nix = "0.19.1" +nix = "0.20.0" ``` ## Contributing diff --git a/third_party/cargo/vendor/nix-0.19.1/src/dir.rs b/third_party/cargo/vendor/nix-0.20.0/src/dir.rs similarity index 72% rename from third_party/cargo/vendor/nix-0.19.1/src/dir.rs rename to third_party/cargo/vendor/nix-0.20.0/src/dir.rs index 1d48f18..7d4ab82 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/dir.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/dir.rs @@ -25,7 +25,7 @@ use libc::{dirent, readdir_r}; /// * returns entries for `.` (current directory) and `..` (parent directory). /// * returns entries' names as a `CStr` (no allocation or conversion beyond whatever libc /// does). -#[derive(Clone, Debug, Eq, Hash, PartialEq)] +#[derive(Debug, Eq, Hash, PartialEq)] pub struct Dir( ptr::NonNull ); @@ -85,7 +85,32 @@ impl AsRawFd for Dir { impl Drop for Dir { fn drop(&mut self) { - unsafe { libc::closedir(self.0.as_ptr()) }; + let e = Errno::result(unsafe { libc::closedir(self.0.as_ptr()) }); + if !std::thread::panicking() && e == Err(Error::Sys(Errno::EBADF)) { + panic!("Closing an invalid file descriptor!"); + }; + } +} + +fn next(dir: &mut Dir) -> Option> { + unsafe { + // Note: POSIX specifies that portable applications should dynamically allocate a + // buffer with room for a `d_name` field of size `pathconf(..., _PC_NAME_MAX)` plus 1 + // for the NUL byte. It doesn't look like the std library does this; it just uses + // fixed-sized buffers (and libc's dirent seems to be sized so this is appropriate). + // Probably fine here too then. + let mut ent = std::mem::MaybeUninit::::uninit(); + let mut result = ptr::null_mut(); + if let Err(e) = Errno::result( + readdir_r(dir.0.as_ptr(), ent.as_mut_ptr(), &mut result)) + { + return Some(Err(e)); + } + if result.is_null() { + return None; + } + assert_eq!(result, ent.as_mut_ptr()); + Some(Ok(Entry(ent.assume_init()))) } } @@ -96,25 +121,7 @@ impl<'d> Iterator for Iter<'d> { type Item = Result; fn next(&mut self) -> Option { - unsafe { - // Note: POSIX specifies that portable applications should dynamically allocate a - // buffer with room for a `d_name` field of size `pathconf(..., _PC_NAME_MAX)` plus 1 - // for the NUL byte. It doesn't look like the std library does this; it just uses - // fixed-sized buffers (and libc's dirent seems to be sized so this is appropriate). - // Probably fine here too then. - let mut ent = std::mem::MaybeUninit::::uninit(); - let mut result = ptr::null_mut(); - if let Err(e) = Errno::result( - readdir_r((self.0).0.as_ptr(), ent.as_mut_ptr(), &mut result)) - { - return Some(Err(e)); - } - if result.is_null() { - return None; - } - assert_eq!(result, ent.as_mut_ptr()); - Some(Ok(Entry(ent.assume_init()))) - } + next(self.0) } } @@ -124,6 +131,43 @@ impl<'d> Drop for Iter<'d> { } } +/// The return type of [Dir::into_iter] +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct OwningIter(Dir); + +impl Iterator for OwningIter { + type Item = Result; + + fn next(&mut self) -> Option { + next(&mut self.0) + } +} + +impl IntoIterator for Dir { + type Item = Result; + type IntoIter = OwningIter; + + /// Creates a owning iterator, that is, one that takes ownership of the + /// `Dir`. The `Dir` cannot be used after calling this. This can be useful + /// when you have a function that both creates a `Dir` instance and returns + /// an `Iterator`. + /// + /// Example: + /// + /// ``` + /// use nix::{dir::Dir, fcntl::OFlag, sys::stat::Mode}; + /// use std::{iter::Iterator, string::String}; + /// + /// fn ls_upper(dirname: &str) -> impl Iterator { + /// let d = Dir::open(dirname, OFlag::O_DIRECTORY, Mode::S_IXUSR).unwrap(); + /// d.into_iter().map(|x| x.unwrap().file_name().as_ref().to_string_lossy().to_ascii_uppercase()) + /// } + /// ``` + fn into_iter(self) -> Self::IntoIter { + OwningIter(self) + } +} + /// A directory entry, similar to `std::fs::DirEntry`. /// /// Note that unlike the std version, this may represent the `.` or `..` entries. diff --git a/third_party/cargo/vendor/nix-0.19.1/src/env.rs b/third_party/cargo/vendor/nix-0.20.0/src/env.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/env.rs rename to third_party/cargo/vendor/nix-0.20.0/src/env.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/errno.rs b/third_party/cargo/vendor/nix-0.20.0/src/errno.rs similarity index 92% rename from third_party/cargo/vendor/nix-0.19.1/src/errno.rs rename to third_party/cargo/vendor/nix-0.20.0/src/errno.rs index 03a7f0e..e5c7092 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/errno.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/errno.rs @@ -20,7 +20,8 @@ cfg_if! { } } else if #[cfg(any(target_os = "linux", target_os = "redox", - target_os = "dragonfly"))] { + target_os = "dragonfly", + target_os = "fuchsia"))] { unsafe fn errno_location() -> *mut c_int { libc::__errno_location() } @@ -188,192 +189,254 @@ fn desc(errno: Errno) -> &'static str { EHOSTDOWN => "Host is down", EHOSTUNREACH => "No route to host", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ECHRNG => "Channel number out of range", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EL2NSYNC => "Level 2 not synchronized", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EL3HLT => "Level 3 halted", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EL3RST => "Level 3 reset", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ELNRNG => "Link number out of range", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EUNATCH => "Protocol driver not attached", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ENOCSI => "No CSI structure available", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EL2HLT => "Level 2 halted", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EBADE => "Invalid exchange", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EBADR => "Invalid request descriptor", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EXFULL => "Exchange full", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ENOANO => "No anode", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EBADRQC => "Invalid request code", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EBADSLT => "Invalid slot", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EBFONT => "Bad font file format", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ENOSTR => "Device not a stream", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ENODATA => "No data available", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ETIME => "Timer expired", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ENOSR => "Out of streams resources", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ENONET => "Machine is not on the network", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ENOPKG => "Package not installed", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EREMOTE => "Object is remote", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ENOLINK => "Link has been severed", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EADV => "Advertise error", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ESRMNT => "Srmount error", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ECOMM => "Communication error on send", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EPROTO => "Protocol error", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EMULTIHOP => "Multihop attempted", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EDOTDOT => "RFS specific error", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EBADMSG => "Not a data message", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EOVERFLOW => "Value too large for defined data type", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ENOTUNIQ => "Name not unique on network", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EBADFD => "File descriptor in bad state", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EREMCHG => "Remote address changed", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ELIBACC => "Can not access a needed shared library", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ELIBBAD => "Accessing a corrupted shared library", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ELIBSCN => ".lib section in a.out corrupted", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ELIBMAX => "Attempting to link in too many shared libraries", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ELIBEXEC => "Cannot exec a shared library directly", - #[cfg(any(target_os = "linux", target_os = "android", target_os = "openbsd"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia", target_os = "openbsd"))] EILSEQ => "Illegal byte sequence", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ERESTART => "Interrupted system call should be restarted", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ESTRPIPE => "Streams pipe error", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EUSERS => "Too many users", #[cfg(any(target_os = "linux", target_os = "android", - target_os = "netbsd", target_os = "redox"))] + target_os = "fuchsia", target_os = "netbsd", + target_os = "redox"))] EOPNOTSUPP => "Operation not supported on transport endpoint", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ESTALE => "Stale file handle", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EUCLEAN => "Structure needs cleaning", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ENOTNAM => "Not a XENIX named type file", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ENAVAIL => "No XENIX semaphores available", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EISNAM => "Is a named type file", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EREMOTEIO => "Remote I/O error", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EDQUOT => "Quota exceeded", #[cfg(any(target_os = "linux", target_os = "android", - target_os = "openbsd", target_os = "dragonfly"))] + target_os = "fuchsia", target_os = "openbsd", + target_os = "dragonfly"))] ENOMEDIUM => "No medium found", - #[cfg(any(target_os = "linux", target_os = "android", target_os = "openbsd"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia", target_os = "openbsd"))] EMEDIUMTYPE => "Wrong medium type", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ECANCELED => "Operation canceled", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ENOKEY => "Required key not available", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EKEYEXPIRED => "Key has expired", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EKEYREVOKED => "Key has been revoked", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EKEYREJECTED => "Key was rejected by service", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] EOWNERDEAD => "Owner died", - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ENOTRECOVERABLE => "State not recoverable", - #[cfg(all(target_os = "linux", not(target_arch="mips")))] + #[cfg(any(all(target_os = "linux", not(target_arch="mips")), + target_os = "fuchsia"))] ERFKILL => "Operation not possible due to RF-kill", - #[cfg(all(target_os = "linux", not(target_arch="mips")))] + #[cfg(any(all(target_os = "linux", not(target_arch="mips")), + target_os = "fuchsia"))] EHWPOISON => "Memory page has hardware error", #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] @@ -567,7 +630,8 @@ fn desc(errno: Errno) -> &'static str { } } -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] mod consts { #[derive(Clone, Copy, Debug, Eq, PartialEq)] #[repr(i32)] diff --git a/third_party/cargo/vendor/nix-0.19.1/src/fcntl.rs b/third_party/cargo/vendor/nix-0.20.0/src/fcntl.rs similarity index 99% rename from third_party/cargo/vendor/nix-0.19.1/src/fcntl.rs rename to third_party/cargo/vendor/nix-0.20.0/src/fcntl.rs index 1581d3a..d2242da 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/fcntl.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/fcntl.rs @@ -20,7 +20,7 @@ use crate::sys::uio::IoVec; // For vmsplice target_os = "fuchsia", any(target_os = "wasi", target_env = "wasi"), target_env = "uclibc", - target_env = "freebsd" + target_os = "freebsd" ))] pub use self::posix_fadvise::*; @@ -587,7 +587,7 @@ pub fn fallocate( target_os = "fuchsia", any(target_os = "wasi", target_env = "wasi"), target_env = "uclibc", - target_env = "freebsd" + target_os = "freebsd" ))] mod posix_fadvise { use crate::errno::Errno; diff --git a/third_party/cargo/vendor/nix-0.19.1/src/features.rs b/third_party/cargo/vendor/nix-0.20.0/src/features.rs similarity index 97% rename from third_party/cargo/vendor/nix-0.19.1/src/features.rs rename to third_party/cargo/vendor/nix-0.20.0/src/features.rs index c3a53fb..6b1cff5 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/features.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/features.rs @@ -97,7 +97,7 @@ mod os { #[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "dragonfly", target_os = "ios", target_os = "openbsd", target_os = "netbsd", - target_os = "redox"))] + target_os = "redox", target_os = "fuchsia"))] mod os { /// Check if the OS supports atomic close-on-exec for sockets pub fn socket_atomic_cloexec() -> bool { diff --git a/third_party/cargo/vendor/nix-0.19.1/src/ifaddrs.rs b/third_party/cargo/vendor/nix-0.20.0/src/ifaddrs.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/ifaddrs.rs rename to third_party/cargo/vendor/nix-0.20.0/src/ifaddrs.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/kmod.rs b/third_party/cargo/vendor/nix-0.20.0/src/kmod.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/kmod.rs rename to third_party/cargo/vendor/nix-0.20.0/src/kmod.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/lib.rs b/third_party/cargo/vendor/nix-0.20.0/src/lib.rs similarity index 99% rename from third_party/cargo/vendor/nix-0.19.1/src/lib.rs rename to third_party/cargo/vendor/nix-0.20.0/src/lib.rs index da517b5..e62c158 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/lib.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/lib.rs @@ -57,7 +57,7 @@ pub mod net; #[deny(missing_docs)] pub mod poll; #[deny(missing_docs)] -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] pub mod pty; pub mod sched; pub mod sys; diff --git a/third_party/cargo/vendor/nix-0.19.1/src/macros.rs b/third_party/cargo/vendor/nix-0.20.0/src/macros.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/macros.rs rename to third_party/cargo/vendor/nix-0.20.0/src/macros.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/mount.rs b/third_party/cargo/vendor/nix-0.20.0/src/mount.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/mount.rs rename to third_party/cargo/vendor/nix-0.20.0/src/mount.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/mqueue.rs b/third_party/cargo/vendor/nix-0.20.0/src/mqueue.rs similarity index 89% rename from third_party/cargo/vendor/nix-0.19.1/src/mqueue.rs rename to third_party/cargo/vendor/nix-0.20.0/src/mqueue.rs index 122705a..0215de5 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/mqueue.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/mqueue.rs @@ -5,7 +5,7 @@ use crate::Result; use crate::errno::Errno; -use libc::{self, c_char, c_long, mqd_t, size_t}; +use libc::{self, c_char, mqd_t, size_t}; use std::ffi::CString; use crate::sys::stat::Mode; use std::mem; @@ -34,11 +34,18 @@ pub struct MqAttr { mq_attr: libc::mq_attr, } +// x32 compatibility +// See https://sourceware.org/bugzilla/show_bug.cgi?id=21279 +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +pub type mq_attr_member_t = i64; +#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] +pub type mq_attr_member_t = libc::c_long; + impl MqAttr { - pub fn new(mq_flags: c_long, - mq_maxmsg: c_long, - mq_msgsize: c_long, - mq_curmsgs: c_long) + pub fn new(mq_flags: mq_attr_member_t, + mq_maxmsg: mq_attr_member_t, + mq_msgsize: mq_attr_member_t, + mq_curmsgs: mq_attr_member_t) -> MqAttr { let mut attr = mem::MaybeUninit::::uninit(); @@ -52,7 +59,7 @@ impl MqAttr { } } - pub fn flags(&self) -> c_long { + pub fn flags(&self) -> mq_attr_member_t { self.mq_attr.mq_flags } } @@ -150,7 +157,7 @@ pub fn mq_setattr(mqd: mqd_t, newattr: &MqAttr) -> Result { /// Returns the old attributes pub fn mq_set_nonblock(mqd: mqd_t) -> Result { let oldattr = mq_getattr(mqd)?; - let newattr = MqAttr::new(c_long::from(MQ_OFlag::O_NONBLOCK.bits()), + let newattr = MqAttr::new(mq_attr_member_t::from(MQ_OFlag::O_NONBLOCK.bits()), oldattr.mq_attr.mq_maxmsg, oldattr.mq_attr.mq_msgsize, oldattr.mq_attr.mq_curmsgs); diff --git a/third_party/cargo/vendor/nix-0.19.1/src/net/if_.rs b/third_party/cargo/vendor/nix-0.20.0/src/net/if_.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/net/if_.rs rename to third_party/cargo/vendor/nix-0.20.0/src/net/if_.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/net/mod.rs b/third_party/cargo/vendor/nix-0.20.0/src/net/mod.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/net/mod.rs rename to third_party/cargo/vendor/nix-0.20.0/src/net/mod.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/poll.rs b/third_party/cargo/vendor/nix-0.20.0/src/poll.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/poll.rs rename to third_party/cargo/vendor/nix-0.20.0/src/poll.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/pty.rs b/third_party/cargo/vendor/nix-0.20.0/src/pty.rs similarity index 99% rename from third_party/cargo/vendor/nix-0.19.1/src/pty.rs rename to third_party/cargo/vendor/nix-0.20.0/src/pty.rs index 3a6a923..d67518f 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/pty.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/pty.rs @@ -43,7 +43,7 @@ pub struct ForkptyResult { /// While this datatype is a thin wrapper around `RawFd`, it enforces that the available PTY /// functions are given the correct file descriptor. Additionally this type implements `Drop`, /// so that when it's consumed or goes out of scope, it's automatically cleaned-up. -#[derive(Clone, Debug, Eq, Hash, PartialEq)] +#[derive(Debug, Eq, Hash, PartialEq)] pub struct PtyMaster(RawFd); impl AsRawFd for PtyMaster { diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sched.rs b/third_party/cargo/vendor/nix-0.20.0/src/sched.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sched.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sched.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/aio.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/aio.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/aio.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/aio.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/epoll.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/epoll.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/epoll.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/epoll.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/event.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/event.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/event.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/event.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/eventfd.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/eventfd.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/eventfd.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/eventfd.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/inotify.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/inotify.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/inotify.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/inotify.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/ioctl/bsd.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/ioctl/bsd.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/ioctl/bsd.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/ioctl/bsd.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/ioctl/linux.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/ioctl/linux.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/ioctl/linux.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/ioctl/linux.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/ioctl/mod.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/ioctl/mod.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/ioctl/mod.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/ioctl/mod.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/memfd.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/memfd.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/memfd.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/memfd.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/mman.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/mman.rs similarity index 93% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/mman.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/mman.rs index b2bed6e..63a0779 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/sys/mman.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/sys/mman.rs @@ -139,6 +139,17 @@ libc_bitflags!{ } } +#[cfg(target_os = "linux")] +libc_bitflags!{ + /// Options for `mremap()`. + pub struct MRemapFlags: c_int { + /// Permit the kernel to relocate the mapping to a new virtual address, if necessary. + MREMAP_MAYMOVE; + /// Place the mapping at exactly the address specified in `new_address`. + MREMAP_FIXED; + } +} + libc_enum!{ /// Usage information for a range of memory to allow for performance optimizations by the kernel. /// @@ -315,6 +326,30 @@ pub unsafe fn mmap(addr: *mut c_void, length: size_t, prot: ProtFlags, flags: Ma } } +/// Expands (or shrinks) an existing memory mapping, potentially moving it at +/// the same time. +/// +/// # Safety +/// +/// See the `mremap(2)` [man page](https://man7.org/linux/man-pages/man2/mremap.2.html) for +/// detailed requirements. +#[cfg(target_os = "linux")] +pub unsafe fn mremap( + addr: *mut c_void, + old_size: size_t, + new_size: size_t, + flags: MRemapFlags, + new_address: Option<* mut c_void>, +) -> Result<*mut c_void> { + let ret = libc::mremap(addr, old_size, new_size, flags.bits(), new_address.unwrap_or(std::ptr::null_mut())); + + if ret == libc::MAP_FAILED { + Err(Error::Sys(Errno::last())) + } else { + Ok(ret) + } +} + /// remove a mapping /// /// # Safety diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/mod.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/mod.rs similarity index 97% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/mod.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/mod.rs index bf7f541..438fb4f 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/sys/mod.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/sys/mod.rs @@ -38,6 +38,9 @@ pub mod memfd; #[cfg(not(target_os = "redox"))] pub mod mman; +#[cfg(target_os = "linux")] +pub mod personality; + pub mod pthread; #[cfg(any(target_os = "android", diff --git a/third_party/cargo/vendor/nix-0.20.0/src/sys/personality.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/personality.rs new file mode 100644 index 0000000..6548b65 --- /dev/null +++ b/third_party/cargo/vendor/nix-0.20.0/src/sys/personality.rs @@ -0,0 +1,70 @@ +use crate::Result; +use crate::errno::Errno; + +use libc::{self, c_int, c_ulong}; + +libc_bitflags! { + /// Flags used and returned by [`get()`](fn.get.html) and + /// [`set()`](fn.set.html). + pub struct Persona: c_int { + ADDR_COMPAT_LAYOUT; + ADDR_NO_RANDOMIZE; + ADDR_LIMIT_32BIT; + ADDR_LIMIT_3GB; + #[cfg(not(target_env = "musl"))] + FDPIC_FUNCPTRS; + MMAP_PAGE_ZERO; + READ_IMPLIES_EXEC; + SHORT_INODE; + STICKY_TIMEOUTS; + #[cfg(not(target_env = "musl"))] + UNAME26; + WHOLE_SECONDS; + } +} + +/// Retrieve the current process personality. +/// +/// Returns a Result containing a Persona instance. +/// +/// Example: +/// +/// ``` +/// # use nix::sys::personality::{self, Persona}; +/// let pers = personality::get().unwrap(); +/// assert!(!pers.contains(Persona::WHOLE_SECONDS)); +/// ``` +pub fn get() -> Result { + let res = unsafe { + libc::personality(0xFFFFFFFF) + }; + + Errno::result(res).map(|r| Persona::from_bits_truncate(r)) +} + +/// Set the current process personality. +/// +/// Returns a Result containing the *previous* personality for the +/// process, as a Persona. +/// +/// For more information, see [personality(2)](https://man7.org/linux/man-pages/man2/personality.2.html) +/// +/// **NOTE**: This call **replaces** the current personality entirely. +/// To **update** the personality, first call `get()` and then `set()` +/// with the modified persona. +/// +/// Example: +/// +/// ``` +/// # use nix::sys::personality::{self, Persona}; +/// let mut pers = personality::get().unwrap(); +/// assert!(!pers.contains(Persona::ADDR_NO_RANDOMIZE)); +/// personality::set(pers | Persona::ADDR_NO_RANDOMIZE); +/// ``` +pub fn set(persona: Persona) -> Result { + let res = unsafe { + libc::personality(persona.bits() as c_ulong) + }; + + Errno::result(res).map(|r| Persona::from_bits_truncate(r)) +} diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/pthread.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/pthread.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/pthread.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/pthread.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/ptrace/bsd.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/ptrace/bsd.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/ptrace/bsd.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/ptrace/bsd.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/ptrace/linux.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/ptrace/linux.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/ptrace/linux.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/ptrace/linux.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/ptrace/mod.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/ptrace/mod.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/ptrace/mod.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/ptrace/mod.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/quota.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/quota.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/quota.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/quota.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/reboot.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/reboot.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/reboot.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/reboot.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/select.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/select.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/select.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/select.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/sendfile.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/sendfile.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/sendfile.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/sendfile.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/signal.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/signal.rs similarity index 94% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/signal.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/signal.rs index 710e65f..2f8b5fa 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/sys/signal.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/sys/signal.rs @@ -39,8 +39,10 @@ libc_enum!{ SIGPIPE, SIGALRM, SIGTERM, - #[cfg(all(any(target_os = "android", target_os = "emscripten", target_os = "linux"), - not(any(target_arch = "mips", target_arch = "mips64", target_arch = "sparc64"))))] + #[cfg(all(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"), + not(any(target_arch = "mips", target_arch = "mips64", + target_arch = "sparc64"))))] SIGSTKFLT, SIGCHLD, SIGCONT, @@ -55,14 +57,17 @@ libc_enum!{ SIGPROF, SIGWINCH, SIGIO, - #[cfg(any(target_os = "android", target_os = "emscripten", target_os = "linux"))] + #[cfg(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"))] SIGPWR, SIGSYS, #[cfg(not(any(target_os = "android", target_os = "emscripten", - target_os = "linux", target_os = "redox")))] + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] SIGEMT, #[cfg(not(any(target_os = "android", target_os = "emscripten", - target_os = "linux", target_os = "redox")))] + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] SIGINFO, } } @@ -86,8 +91,10 @@ impl FromStr for Signal { "SIGPIPE" => Signal::SIGPIPE, "SIGALRM" => Signal::SIGALRM, "SIGTERM" => Signal::SIGTERM, - #[cfg(all(any(target_os = "android", target_os = "emscripten", target_os = "linux"), - not(any(target_arch = "mips", target_arch = "mips64", target_arch = "sparc64"))))] + #[cfg(all(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"), + not(any(target_arch = "mips", target_arch = "mips64", + target_arch = "sparc64"))))] "SIGSTKFLT" => Signal::SIGSTKFLT, "SIGCHLD" => Signal::SIGCHLD, "SIGCONT" => Signal::SIGCONT, @@ -102,14 +109,17 @@ impl FromStr for Signal { "SIGPROF" => Signal::SIGPROF, "SIGWINCH" => Signal::SIGWINCH, "SIGIO" => Signal::SIGIO, - #[cfg(any(target_os = "android", target_os = "emscripten", target_os = "linux"))] + #[cfg(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"))] "SIGPWR" => Signal::SIGPWR, "SIGSYS" => Signal::SIGSYS, #[cfg(not(any(target_os = "android", target_os = "emscripten", - target_os = "linux", target_os = "redox")))] + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] "SIGEMT" => Signal::SIGEMT, #[cfg(not(any(target_os = "android", target_os = "emscripten", - target_os = "linux", target_os = "redox")))] + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] "SIGINFO" => Signal::SIGINFO, _ => return Err(Error::invalid_argument()), }) @@ -139,7 +149,8 @@ impl Signal { Signal::SIGPIPE => "SIGPIPE", Signal::SIGALRM => "SIGALRM", Signal::SIGTERM => "SIGTERM", - #[cfg(all(any(target_os = "android", target_os = "emscripten", target_os = "linux"), + #[cfg(all(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"), not(any(target_arch = "mips", target_arch = "mips64", target_arch = "sparc64"))))] Signal::SIGSTKFLT => "SIGSTKFLT", Signal::SIGCHLD => "SIGCHLD", @@ -155,14 +166,17 @@ impl Signal { Signal::SIGPROF => "SIGPROF", Signal::SIGWINCH => "SIGWINCH", Signal::SIGIO => "SIGIO", - #[cfg(any(target_os = "android", target_os = "emscripten", target_os = "linux"))] + #[cfg(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"))] Signal::SIGPWR => "SIGPWR", Signal::SIGSYS => "SIGSYS", #[cfg(not(any(target_os = "android", target_os = "emscripten", - target_os = "linux", target_os = "redox")))] + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] Signal::SIGEMT => "SIGEMT", #[cfg(not(any(target_os = "android", target_os = "emscripten", - target_os = "linux", target_os = "redox")))] + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] Signal::SIGINFO => "SIGINFO", } } @@ -213,7 +227,10 @@ const SIGNALS: [Signal; 29] = [ SIGWINCH, SIGIO, SIGSYS]; -#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), not(any(target_arch = "mips", target_arch = "mips64", target_arch = "sparc64"))))] +#[cfg(all(any(target_os = "linux", target_os = "android", + target_os = "emscripten", target_os = "fuchsia"), + not(any(target_arch = "mips", target_arch = "mips64", + target_arch = "sparc64"))))] const SIGNALS: [Signal; 31] = [ SIGHUP, SIGINT, @@ -246,7 +263,10 @@ const SIGNALS: [Signal; 31] = [ SIGIO, SIGPWR, SIGSYS]; -#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), any(target_arch = "mips", target_arch = "mips64", target_arch = "sparc64")))] +#[cfg(all(any(target_os = "linux", target_os = "android", + target_os = "emscripten", target_os = "fuchsia"), + any(target_arch = "mips", target_arch = "mips64", + target_arch = "sparc64")))] const SIGNALS: [Signal; 30] = [ SIGHUP, SIGINT, @@ -279,7 +299,8 @@ const SIGNALS: [Signal; 30] = [ SIGPWR, SIGSYS]; #[cfg(not(any(target_os = "linux", target_os = "android", - target_os = "emscripten", target_os = "redox")))] + target_os = "fuchsia", target_os = "emscripten", + target_os = "redox")))] const SIGNALS: [Signal; 31] = [ SIGHUP, SIGINT, @@ -749,6 +770,7 @@ pub fn kill>>(pid: Pid, signal: T) -> Result<()> { /// If `pgrp` less then or equal 1, the behavior is platform-specific. /// If `signal` is `None`, `killpg` will only preform error checking and won't /// send any signal. +#[cfg(not(target_os = "fuchsia"))] pub fn killpg>>(pgrp: Pid, signal: T) -> Result<()> { let res = unsafe { libc::killpg(pgrp.into(), match signal.into() { @@ -829,7 +851,10 @@ mod sigevent { /// `SIGEV_SIGNAL`. That field is part of a union that shares space with the /// more genuinely useful `sigev_notify_thread_id` pub fn new(sigev_notify: SigevNotify) -> SigEvent { - let mut sev = unsafe { mem::zeroed::()}; + // NB: This uses MaybeUninit rather than mem::zeroed because libc::sigevent contains a + // function pointer on Fuchsia as of https://github.com/rust-lang/libc/commit/2f59370, + // and function pointers must not be null. + let mut sev = unsafe { mem::MaybeUninit::::zeroed().assume_init() }; sev.sigev_notify = match sigev_notify { SigevNotify::SigevNone => libc::SIGEV_NONE, SigevNotify::SigevSignal{..} => libc::SIGEV_SIGNAL, diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/signalfd.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/signalfd.rs similarity index 96% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/signalfd.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/signalfd.rs index e3ded1f..c43b450 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/sys/signalfd.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/sys/signalfd.rs @@ -79,7 +79,7 @@ pub fn signalfd(fd: RawFd, mask: &SigSet, flags: SfdFlags) -> Result { /// Err(err) => (), // some error happend /// } /// ``` -#[derive(Clone, Debug, Eq, Hash, PartialEq)] +#[derive(Debug, Eq, Hash, PartialEq)] pub struct SignalFd(RawFd); impl SignalFd { @@ -116,7 +116,10 @@ impl SignalFd { impl Drop for SignalFd { fn drop(&mut self) { - let _ = unistd::close(self.0); + let e = unistd::close(self.0); + if !std::thread::panicking() && e == Err(Error::Sys(Errno::EBADF)) { + panic!("Closing an invalid file descriptor!"); + }; } } diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/socket/addr.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/socket/addr.rs similarity index 99% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/socket/addr.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/socket/addr.rs index 8784a37..2299c57 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/sys/socket/addr.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/sys/socket/addr.rs @@ -21,7 +21,8 @@ use crate::sys::socket::addr::sys_control::SysControlAddr; target_os = "linux", target_os = "macos", target_os = "netbsd", - target_os = "openbsd"))] + target_os = "openbsd", + target_os = "fuchsia"))] pub use self::datalink::LinkAddr; #[cfg(any(target_os = "android", target_os = "linux"))] pub use self::vsock::VsockAddr; @@ -41,7 +42,7 @@ pub enum AddressFamily { #[cfg(any(target_os = "android", target_os = "linux"))] Netlink = libc::AF_NETLINK, /// Low level packet interface (see [`packet(7)`](http://man7.org/linux/man-pages/man7/packet.7.html)) - #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(any(target_os = "android", target_os = "linux", target_os = "fuchsia"))] Packet = libc::AF_PACKET, /// KEXT Controls and Notifications #[cfg(any(target_os = "ios", target_os = "macos"))] @@ -718,6 +719,7 @@ impl SockAddr { /// /// unsafe because it takes a raw pointer as argument. The caller must /// ensure that the pointer is valid. + #[cfg(not(target_os = "fuchsia"))] pub(crate) unsafe fn from_libc_sockaddr(addr: *const libc::sockaddr) -> Option { if addr.is_null() { None @@ -1045,7 +1047,7 @@ pub mod sys_control { } -#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg(any(target_os = "android", target_os = "linux", target_os = "fuchsia"))] mod datalink { use super::{fmt, AddressFamily}; diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/socket/mod.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/socket/mod.rs similarity index 99% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/socket/mod.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/socket/mod.rs index a4f599c..11ed329 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/sys/socket/mod.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/sys/socket/mod.rs @@ -1576,24 +1576,6 @@ pub fn send(fd: RawFd, buf: &[u8], flags: MsgFlags) -> Result { * */ -/// The protocol level at which to get / set socket options. Used as an -/// argument to `getsockopt` and `setsockopt`. -/// -/// [Further reading](http://pubs.opengroup.org/onlinepubs/9699919799/functions/setsockopt.html) -#[repr(i32)] -#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] -pub enum SockLevel { - Socket = libc::SOL_SOCKET, - Tcp = libc::IPPROTO_TCP, - Ip = libc::IPPROTO_IP, - Ipv6 = libc::IPPROTO_IPV6, - Udp = libc::IPPROTO_UDP, - #[cfg(any(target_os = "android", target_os = "linux"))] - Netlink = libc::SOL_NETLINK, - #[cfg(any(target_os = "android", target_os = "linux"))] - Alg = libc::SOL_ALG, -} - /// Represents a socket option that can be accessed or set. Used as an argument /// to `getsockopt` pub trait GetSockOpt : Copy { @@ -1720,6 +1702,15 @@ pub fn sockaddr_storage_to_addr( Ok(SockAddr::Unix(UnixAddr(sun, pathlen))) } #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_PACKET => { + use libc::sockaddr_ll; + assert_eq!(len as usize, mem::size_of::()); + let sll = unsafe { + *(addr as *const _ as *const sockaddr_ll) + }; + Ok(SockAddr::Link(LinkAddr(sll))) + } + #[cfg(any(target_os = "android", target_os = "linux"))] libc::AF_NETLINK => { use libc::sockaddr_nl; let snl = unsafe { diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/socket/sockopt.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/socket/sockopt.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/socket/sockopt.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/socket/sockopt.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/stat.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/stat.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/stat.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/stat.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/statfs.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/statfs.rs similarity index 77% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/statfs.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/statfs.rs index 8e90a58..27b7259 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/sys/statfs.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/sys/statfs.rs @@ -16,79 +16,85 @@ pub type fsid_t = libc::fsid_t; pub struct Statfs(libc::statfs); #[cfg(target_os = "freebsd")] -#[derive(Eq, Copy, Clone, PartialEq, Debug)] -pub struct FsType(pub u32); +type fs_type_t = u32; #[cfg(target_os = "android")] -#[derive(Eq, Copy, Clone, PartialEq, Debug)] -pub struct FsType(pub libc::c_ulong); +type fs_type_t = libc::c_ulong; #[cfg(all(target_os = "linux", target_arch = "s390x"))] -#[derive(Eq, Copy, Clone, PartialEq, Debug)] -pub struct FsType(pub u32); +type fs_type_t = libc::c_uint; #[cfg(all(target_os = "linux", target_env = "musl"))] -#[derive(Eq, Copy, Clone, PartialEq, Debug)] -pub struct FsType(pub libc::c_ulong); +type fs_type_t = libc::c_ulong; #[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl"))))] -#[derive(Eq, Copy, Clone, PartialEq, Debug)] -pub struct FsType(pub libc::c_long); +type fs_type_t = libc::__fsword_t; + +#[cfg(any( + target_os = "freebsd", + target_os = "android", + all(target_os = "linux", target_arch = "s390x"), + all(target_os = "linux", target_env = "musl"), + all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl"))), +))] +#[derive(Eq, Copy, Clone, PartialEq, Debug)] +pub struct FsType(pub fs_type_t); + +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const ADFS_SUPER_MAGIC: FsType = FsType(libc::ADFS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const AFFS_SUPER_MAGIC: FsType = FsType(libc::AFFS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const CODA_SUPER_MAGIC: FsType = FsType(libc::CODA_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const CRAMFS_MAGIC: FsType = FsType(libc::CRAMFS_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const EFS_SUPER_MAGIC: FsType = FsType(libc::EFS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const EXT2_SUPER_MAGIC: FsType = FsType(libc::EXT2_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const EXT3_SUPER_MAGIC: FsType = FsType(libc::EXT3_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const EXT4_SUPER_MAGIC: FsType = FsType(libc::EXT4_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const HPFS_SUPER_MAGIC: FsType = FsType(libc::HPFS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const HUGETLBFS_MAGIC: FsType = FsType(libc::HUGETLBFS_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const ISOFS_SUPER_MAGIC: FsType = FsType(libc::ISOFS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const JFFS2_SUPER_MAGIC: FsType = FsType(libc::JFFS2_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const MINIX_SUPER_MAGIC: FsType = FsType(libc::MINIX_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const MINIX_SUPER_MAGIC2: FsType = FsType(libc::MINIX_SUPER_MAGIC2 as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const MINIX2_SUPER_MAGIC: FsType = FsType(libc::MINIX2_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const MINIX2_SUPER_MAGIC2: FsType = FsType(libc::MINIX2_SUPER_MAGIC2 as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const MSDOS_SUPER_MAGIC: FsType = FsType(libc::MSDOS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const NCP_SUPER_MAGIC: FsType = FsType(libc::NCP_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const NFS_SUPER_MAGIC: FsType = FsType(libc::NFS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const OPENPROM_SUPER_MAGIC: FsType = FsType(libc::OPENPROM_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const OVERLAYFS_SUPER_MAGIC: FsType = FsType(libc::OVERLAYFS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const PROC_SUPER_MAGIC: FsType = FsType(libc::PROC_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const QNX4_SUPER_MAGIC: FsType = FsType(libc::QNX4_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const REISERFS_SUPER_MAGIC: FsType = FsType(libc::REISERFS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const SMB_SUPER_MAGIC: FsType = FsType(libc::SMB_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const TMPFS_MAGIC: FsType = FsType(libc::TMPFS_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const USBDEVICE_SUPER_MAGIC: FsType = FsType(libc::USBDEVICE_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const CGROUP_SUPER_MAGIC: FsType = FsType(libc::CGROUP_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +pub const CGROUP2_SUPER_MAGIC: FsType = FsType(libc::CGROUP2_SUPER_MAGIC as fs_type_t); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const ADFS_SUPER_MAGIC: FsType = FsType(libc::ADFS_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const AFFS_SUPER_MAGIC: FsType = FsType(libc::AFFS_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const CODA_SUPER_MAGIC: FsType = FsType(libc::CODA_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const CRAMFS_MAGIC: FsType = FsType(libc::CRAMFS_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const EFS_SUPER_MAGIC: FsType = FsType(libc::EFS_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const EXT2_SUPER_MAGIC: FsType = FsType(libc::EXT2_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const EXT3_SUPER_MAGIC: FsType = FsType(libc::EXT3_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const EXT4_SUPER_MAGIC: FsType = FsType(libc::EXT4_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const HPFS_SUPER_MAGIC: FsType = FsType(libc::HPFS_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const HUGETLBFS_MAGIC: FsType = FsType(libc::HUGETLBFS_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const ISOFS_SUPER_MAGIC: FsType = FsType(libc::ISOFS_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const JFFS2_SUPER_MAGIC: FsType = FsType(libc::JFFS2_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const MINIX_SUPER_MAGIC: FsType = FsType(libc::MINIX_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const MINIX_SUPER_MAGIC2: FsType = FsType(libc::MINIX_SUPER_MAGIC2); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const MINIX2_SUPER_MAGIC: FsType = FsType(libc::MINIX2_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const MINIX2_SUPER_MAGIC2: FsType = FsType(libc::MINIX2_SUPER_MAGIC2); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const MSDOS_SUPER_MAGIC: FsType = FsType(libc::MSDOS_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const NCP_SUPER_MAGIC: FsType = FsType(libc::NCP_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const NFS_SUPER_MAGIC: FsType = FsType(libc::NFS_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const OPENPROM_SUPER_MAGIC: FsType = FsType(libc::OPENPROM_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const OVERLAYFS_SUPER_MAGIC: FsType = FsType(libc::OVERLAYFS_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const PROC_SUPER_MAGIC: FsType = FsType(libc::PROC_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const QNX4_SUPER_MAGIC: FsType = FsType(libc::QNX4_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const REISERFS_SUPER_MAGIC: FsType = FsType(libc::REISERFS_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const SMB_SUPER_MAGIC: FsType = FsType(libc::SMB_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const TMPFS_MAGIC: FsType = FsType(libc::TMPFS_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const USBDEVICE_SUPER_MAGIC: FsType = FsType(libc::USBDEVICE_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const CGROUP_SUPER_MAGIC: FsType = FsType(libc::CGROUP_SUPER_MAGIC); -#[cfg(all(target_os = "linux", not(target_env = "musl"), not(target_arch = "s390x")))] -pub const CGROUP2_SUPER_MAGIC: FsType = FsType(libc::CGROUP2_SUPER_MAGIC); impl Statfs { /// Magic code defining system type @@ -138,7 +144,7 @@ impl Statfs { /// Optimal transfer block size #[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl"))))] - pub fn optimal_transfer_size(&self) -> libc::c_long { + pub fn optimal_transfer_size(&self) -> libc::__fsword_t { self.0.f_bsize } @@ -177,7 +183,7 @@ impl Statfs { /// Size of a block // f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471 #[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl"))))] - pub fn block_size(&self) -> libc::c_long { + pub fn block_size(&self) -> libc::__fsword_t { self.0.f_bsize } @@ -219,7 +225,7 @@ impl Statfs { /// Maximum length of filenames #[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl"))))] - pub fn maximum_name_length(&self) -> libc::c_long { + pub fn maximum_name_length(&self) -> libc::__fsword_t { self.0.f_namelen } @@ -248,7 +254,7 @@ impl Statfs { } /// Total data blocks in filesystem - #[cfg(all(target_os = "linux", target_env = "musl"))] + #[cfg(all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))))] pub fn blocks(&self) -> u64 { self.0.f_blocks } @@ -261,7 +267,7 @@ impl Statfs { target_os = "freebsd", target_os = "openbsd", target_os = "dragonfly", - all(target_os = "linux", target_env = "musl") + all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))) )))] pub fn blocks(&self) -> libc::c_ulong { self.0.f_blocks @@ -286,7 +292,7 @@ impl Statfs { } /// Free blocks in filesystem - #[cfg(all(target_os = "linux", target_env = "musl"))] + #[cfg(all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))))] pub fn blocks_free(&self) -> u64 { self.0.f_bfree } @@ -299,7 +305,7 @@ impl Statfs { target_os = "freebsd", target_os = "openbsd", target_os = "dragonfly", - all(target_os = "linux", target_env = "musl") + all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))) )))] pub fn blocks_free(&self) -> libc::c_ulong { self.0.f_bfree @@ -324,7 +330,7 @@ impl Statfs { } /// Free blocks available to unprivileged user - #[cfg(all(target_os = "linux", target_env = "musl"))] + #[cfg(all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))))] pub fn blocks_available(&self) -> u64 { self.0.f_bavail } @@ -337,7 +343,7 @@ impl Statfs { target_os = "freebsd", target_os = "openbsd", target_os = "dragonfly", - all(target_os = "linux", target_env = "musl") + all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))) )))] pub fn blocks_available(&self) -> libc::c_ulong { self.0.f_bavail @@ -362,8 +368,8 @@ impl Statfs { } /// Total file nodes in filesystem - #[cfg(all(target_os = "linux", target_env = "musl"))] - pub fn files(&self) -> u64 { + #[cfg(all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))))] + pub fn files(&self) -> libc::fsfilcnt_t { self.0.f_files } @@ -375,7 +381,7 @@ impl Statfs { target_os = "freebsd", target_os = "openbsd", target_os = "dragonfly", - all(target_os = "linux", target_env = "musl") + all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))) )))] pub fn files(&self) -> libc::c_ulong { self.0.f_files @@ -385,7 +391,6 @@ impl Statfs { #[cfg(any( target_os = "android", target_os = "ios", - all(target_os = "linux", target_env = "musl"), target_os = "macos", target_os = "openbsd" ))] @@ -405,6 +410,12 @@ impl Statfs { self.0.f_ffree } + /// Free file nodes in filesystem + #[cfg(all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))))] + pub fn files_free(&self) -> libc::fsfilcnt_t { + self.0.f_ffree + } + /// Free file nodes in filesystem #[cfg(not(any( target_os = "ios", @@ -413,7 +424,7 @@ impl Statfs { target_os = "freebsd", target_os = "openbsd", target_os = "dragonfly", - all(target_os = "linux", target_env = "musl") + all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))) )))] pub fn files_free(&self) -> libc::c_ulong { self.0.f_ffree diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/statvfs.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/statvfs.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/statvfs.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/statvfs.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/sysinfo.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/sysinfo.rs similarity index 86% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/sysinfo.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/sysinfo.rs index f4b8279..222a2fc 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/sys/sysinfo.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/sys/sysinfo.rs @@ -10,6 +10,12 @@ use crate::errno::Errno; #[repr(transparent)] pub struct SysInfo(libc::sysinfo); +// The fields are c_ulong on 32-bit linux, u64 on 64-bit linux; x32's ulong is u32 +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +type mem_blocks_t = u64; +#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] +type mem_blocks_t = libc::c_ulong; + impl SysInfo { /// Returns the load average tuple. /// @@ -58,7 +64,7 @@ impl SysInfo { self.scale_mem(self.0.freeram) } - fn scale_mem(&self, units: libc::c_ulong) -> u64 { + fn scale_mem(&self, units: mem_blocks_t) -> u64 { units as u64 * self.0.mem_unit as u64 } } diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/termios.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/termios.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/termios.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/termios.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/time.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/time.rs similarity index 96% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/time.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/time.rs index bdcfe3c..7546d1b 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/sys/time.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/sys/time.rs @@ -1,7 +1,7 @@ use std::{cmp, fmt, ops}; use std::time::Duration; use std::convert::From; -use libc::{c_long, timespec, timeval}; +use libc::{timespec, timeval}; #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 pub use libc::{time_t, suseconds_t}; @@ -62,6 +62,13 @@ const TS_MAX_SECONDS: i64 = ::std::isize::MAX as i64; const TS_MIN_SECONDS: i64 = -TS_MAX_SECONDS; +// x32 compatibility +// See https://sourceware.org/bugzilla/show_bug.cgi?id=16437 +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +type timespec_tv_nsec_t = i64; +#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] +type timespec_tv_nsec_t = libc::c_long; + impl From for TimeSpec { fn from(ts: timespec) -> Self { Self(ts) @@ -73,7 +80,7 @@ impl From for TimeSpec { #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 TimeSpec(timespec { tv_sec: duration.as_secs() as time_t, - tv_nsec: duration.subsec_nanos() as c_long + tv_nsec: duration.subsec_nanos() as timespec_tv_nsec_t }) } } @@ -148,7 +155,7 @@ impl TimeValLike for TimeSpec { "TimeSpec out of bounds"); #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 TimeSpec(timespec {tv_sec: secs as time_t, - tv_nsec: nanos as c_long }) + tv_nsec: nanos as timespec_tv_nsec_t }) } fn num_seconds(&self) -> i64 { @@ -175,9 +182,9 @@ impl TimeValLike for TimeSpec { } impl TimeSpec { - fn nanos_mod_sec(&self) -> c_long { + fn nanos_mod_sec(&self) -> timespec_tv_nsec_t { if self.tv_sec() < 0 && self.tv_nsec() > 0 { - self.tv_nsec() - NANOS_PER_SEC as c_long + self.tv_nsec() - NANOS_PER_SEC as timespec_tv_nsec_t } else { self.tv_nsec() } @@ -188,7 +195,7 @@ impl TimeSpec { self.0.tv_sec } - pub fn tv_nsec(&self) -> c_long { + pub fn tv_nsec(&self) -> timespec_tv_nsec_t { self.0.tv_nsec } } diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/timerfd.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/timerfd.rs similarity index 95% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/timerfd.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/timerfd.rs index 3086309..4a24719 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/sys/timerfd.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/sys/timerfd.rs @@ -37,7 +37,7 @@ use std::os::unix::io::{AsRawFd, FromRawFd, RawFd}; /// A timerfd instance. This is also a file descriptor, you can feed it to /// other interfaces consuming file descriptors, epoll for example. -#[derive(Debug, Clone, Copy)] +#[derive(Debug)] pub struct TimerFd { fd: RawFd, } @@ -166,7 +166,7 @@ pub enum Expiration { impl TimerFd { /// Creates a new timer based on the clock defined by `clockid`. The /// underlying fd can be assigned specific flags with `flags` (CLOEXEC, - /// NONBLOCK). + /// NONBLOCK). The underlying fd will be closed on drop. pub fn new(clockid: ClockId, flags: TimerFlags) -> Result { Errno::result(unsafe { libc::timerfd_create(clockid as i32, flags.bits()) }) .map(|fd| Self { fd }) @@ -270,3 +270,16 @@ impl TimerFd { Ok(()) } } + +impl Drop for TimerFd { + fn drop(&mut self) { + if !std::thread::panicking() { + let result = Errno::result(unsafe { + libc::close(self.fd) + }); + if let Err(Error::Sys(Errno::EBADF)) = result { + panic!("close of TimerFd encountered EBADF"); + } + } + } +} diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/uio.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/uio.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/uio.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/uio.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/utsname.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/utsname.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/utsname.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/utsname.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/sys/wait.rs b/third_party/cargo/vendor/nix-0.20.0/src/sys/wait.rs similarity index 91% rename from third_party/cargo/vendor/nix-0.19.1/src/sys/wait.rs rename to third_party/cargo/vendor/nix-0.20.0/src/sys/wait.rs index 0c04042..faf8543 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/sys/wait.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/sys/wait.rs @@ -1,9 +1,9 @@ +use crate::errno::Errno; +use crate::sys::signal::Signal; +use crate::unistd::Pid; +use crate::Result; use cfg_if::cfg_if; use libc::{self, c_int}; -use crate::Result; -use crate::errno::Errno; -use crate::unistd::Pid; -use crate::sys::signal::Signal; use std::convert::TryFrom; libc_bitflags!( @@ -108,8 +108,7 @@ impl WaitStatus { pub fn pid(&self) -> Option { use self::WaitStatus::*; match *self { - Exited(p, _) | Signaled(p, _, _) | - Stopped(p, _) | Continued(p) => Some(p), + Exited(p, _) | Signaled(p, _, _) | Stopped(p, _) | Continued(p) => Some(p), StillAlive => None, #[cfg(any(target_os = "android", target_os = "linux"))] PtraceEvent(p, _, _) | PtraceSyscall(p) => Some(p), @@ -117,49 +116,41 @@ impl WaitStatus { } } -#[allow(unused_unsafe)] fn exited(status: i32) -> bool { - unsafe { libc::WIFEXITED(status) } + libc::WIFEXITED(status) } -#[allow(unused_unsafe)] fn exit_status(status: i32) -> i32 { - unsafe { libc::WEXITSTATUS(status) } + libc::WEXITSTATUS(status) } -#[allow(unused_unsafe)] fn signaled(status: i32) -> bool { - unsafe { libc::WIFSIGNALED(status) } + libc::WIFSIGNALED(status) } -#[allow(unused_unsafe)] fn term_signal(status: i32) -> Result { - Signal::try_from(unsafe { libc::WTERMSIG(status) }) + Signal::try_from(libc::WTERMSIG(status)) } -#[allow(unused_unsafe)] fn dumped_core(status: i32) -> bool { - unsafe { libc::WCOREDUMP(status) } + libc::WCOREDUMP(status) } -#[allow(unused_unsafe)] fn stopped(status: i32) -> bool { - unsafe { libc::WIFSTOPPED(status) } + libc::WIFSTOPPED(status) } -#[allow(unused_unsafe)] fn stop_signal(status: i32) -> Result { - Signal::try_from(unsafe { libc::WSTOPSIG(status) }) + Signal::try_from(libc::WSTOPSIG(status)) } #[cfg(any(target_os = "android", target_os = "linux"))] -#[allow(unused_unsafe)] fn syscall_stop(status: i32) -> bool { // From ptrace(2), setting PTRACE_O_TRACESYSGOOD has the effect // of delivering SIGTRAP | 0x80 as the signal number for syscall // stops. This allows easily distinguishing syscall stops from // genuine SIGTRAP signals. - unsafe { libc::WSTOPSIG(status) == libc::SIGTRAP | 0x80 } + libc::WSTOPSIG(status) == libc::SIGTRAP | 0x80 } #[cfg(any(target_os = "android", target_os = "linux"))] @@ -167,9 +158,8 @@ fn stop_additional(status: i32) -> c_int { (status >> 16) as c_int } -#[allow(unused_unsafe)] fn continued(status: i32) -> bool { - unsafe { libc::WIFCONTINUED(status) } + libc::WIFCONTINUED(status) } impl WaitStatus { diff --git a/third_party/cargo/vendor/nix-0.19.1/src/time.rs b/third_party/cargo/vendor/nix-0.20.0/src/time.rs similarity index 99% rename from third_party/cargo/vendor/nix-0.19.1/src/time.rs rename to third_party/cargo/vendor/nix-0.20.0/src/time.rs index 54989c2..e6c3f8d 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/time.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/time.rs @@ -37,6 +37,7 @@ impl ClockId { } /// Returns resolution of the clock id + #[cfg(not(target_os = "redox"))] pub fn res(self) -> Result { clock_getres(self) } @@ -204,6 +205,7 @@ impl std::fmt::Display for ClockId { /// Get the resolution of the specified clock, (see /// [clock_getres(2)](https://pubs.opengroup.org/onlinepubs/7908799/xsh/clock_getres.html)). +#[cfg(not(target_os = "redox"))] pub fn clock_getres(clock_id: ClockId) -> Result { let mut c_time: MaybeUninit = MaybeUninit::uninit(); let ret = unsafe { libc::clock_getres(clock_id.as_raw(), c_time.as_mut_ptr()) }; diff --git a/third_party/cargo/vendor/nix-0.19.1/src/ucontext.rs b/third_party/cargo/vendor/nix-0.20.0/src/ucontext.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/src/ucontext.rs rename to third_party/cargo/vendor/nix-0.20.0/src/ucontext.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/src/unistd.rs b/third_party/cargo/vendor/nix-0.20.0/src/unistd.rs similarity index 98% rename from third_party/cargo/vendor/nix-0.19.1/src/unistd.rs rename to third_party/cargo/vendor/nix-0.20.0/src/unistd.rs index 04031e3..7a4517e 100644 --- a/third_party/cargo/vendor/nix-0.19.1/src/unistd.rs +++ b/third_party/cargo/vendor/nix-0.20.0/src/unistd.rs @@ -12,9 +12,9 @@ use libc::{self, c_char, c_void, c_int, c_long, c_uint, size_t, pid_t, off_t, uid_t, gid_t, mode_t, PATH_MAX}; use std::{fmt, mem, ptr}; use std::convert::Infallible; -use std::ffi::{CStr, CString, OsString}; +use std::ffi::{CStr, OsString}; #[cfg(not(target_os = "redox"))] -use std::ffi::{OsStr}; +use std::ffi::{CString, OsStr}; use std::os::unix::ffi::OsStringExt; #[cfg(not(target_os = "redox"))] use std::os::unix::ffi::OsStrExt; @@ -426,6 +426,7 @@ pub fn chdir(path: &P) -> Result<()> { /// This function may fail in a number of different scenarios. See the man /// pages for additional details on possible failure cases. #[inline] +#[cfg(not(target_os = "fuchsia"))] pub fn fchdir(dirfd: RawFd) -> Result<()> { let res = unsafe { libc::fchdir(dirfd) }; @@ -1095,7 +1096,7 @@ pub fn pipe2(flags: OFlag) -> Result<(RawFd, RawFd)> { /// /// See also /// [truncate(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html) -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] pub fn truncate(path: &P, len: off_t) -> Result<()> { let res = path.with_nix_path(|cstr| { unsafe { @@ -1232,6 +1233,7 @@ pub fn unlinkat( #[inline] +#[cfg(not(target_os = "fuchsia"))] pub fn chroot(path: &P) -> Result<()> { let res = path.with_nix_path(|cstr| { unsafe { libc::chroot(cstr.as_ptr()) } @@ -1633,7 +1635,8 @@ pub mod alarm { //! //! Scheduling an alarm and waiting for the signal: //! - //! ``` +#![cfg_attr(target_os = "redox", doc = " ```rust,ignore")] +#![cfg_attr(not(target_os = "redox"), doc = " ```rust")] //! use std::time::{Duration, Instant}; //! //! use nix::unistd::{alarm, pause}; @@ -1642,14 +1645,23 @@ pub mod alarm { //! // We need to setup an empty signal handler to catch the alarm signal, //! // otherwise the program will be terminated once the signal is delivered. //! extern fn signal_handler(_: nix::libc::c_int) { } - //! unsafe { sigaction(Signal::SIGALRM, &SigAction::new(SigHandler::Handler(signal_handler), SaFlags::empty(), SigSet::empty())); } + //! let sa = SigAction::new( + //! SigHandler::Handler(signal_handler), + //! SaFlags::empty(), + //! SigSet::empty() + //! ); + //! unsafe { + //! sigaction(Signal::SIGALRM, &sa); + //! } //! //! // Set an alarm for 1 second from now. //! alarm::set(1); //! //! let start = Instant::now(); //! // Pause the process until the alarm signal is received. - //! pause(); + //! let mut sigset = SigSet::empty(); + //! sigset.add(Signal::SIGALRM); + //! sigset.wait(); //! //! assert!(start.elapsed() >= Duration::from_secs(1)); //! ``` @@ -2536,13 +2548,16 @@ pub struct User { /// Path to shell pub shell: PathBuf, /// Login class - #[cfg(not(any(target_os = "android", target_os = "linux")))] + #[cfg(not(any(target_os = "android", target_os = "fuchsia", + target_os = "linux")))] pub class: CString, /// Last password change - #[cfg(not(any(target_os = "android", target_os = "linux")))] + #[cfg(not(any(target_os = "android", target_os = "fuchsia", + target_os = "linux")))] pub change: libc::time_t, /// Expiration time of account - #[cfg(not(any(target_os = "android", target_os = "linux")))] + #[cfg(not(any(target_os = "android", target_os = "fuchsia", + target_os = "linux")))] pub expire: libc::time_t } @@ -2559,11 +2574,14 @@ impl From<&libc::passwd> for User { shell: PathBuf::from(OsStr::from_bytes(CStr::from_ptr((*pw).pw_shell).to_bytes())), uid: Uid::from_raw((*pw).pw_uid), gid: Gid::from_raw((*pw).pw_gid), - #[cfg(not(any(target_os = "android", target_os = "linux")))] + #[cfg(not(any(target_os = "android", target_os = "fuchsia", + target_os = "linux")))] class: CString::new(CStr::from_ptr((*pw).pw_class).to_bytes()).unwrap(), - #[cfg(not(any(target_os = "android", target_os = "linux")))] + #[cfg(not(any(target_os = "android", target_os = "fuchsia", + target_os = "linux")))] change: (*pw).pw_change, - #[cfg(not(any(target_os = "android", target_os = "linux")))] + #[cfg(not(any(target_os = "android", target_os = "fuchsia", + target_os = "linux")))] expire: (*pw).pw_expire } } @@ -2653,6 +2671,8 @@ impl User { pub struct Group { /// Group name pub name: String, + /// Group password + pub passwd: CString, /// Group ID pub gid: Gid, /// List of Group members @@ -2665,6 +2685,7 @@ impl From<&libc::group> for Group { unsafe { Group { name: CStr::from_ptr((*gr).gr_name).to_string_lossy().into_owned(), + passwd: CString::new(CStr::from_ptr((*gr).gr_passwd).to_bytes()).unwrap(), gid: Gid::from_raw((*gr).gr_gid), mem: Group::members((*gr).gr_mem) } @@ -2771,6 +2792,7 @@ impl Group { /// Get the name of the terminal device that is open on file descriptor fd /// (see [`ttyname(3)`](http://man7.org/linux/man-pages/man3/ttyname.3.html)). +#[cfg(not(target_os = "fuchsia"))] pub fn ttyname(fd: RawFd) -> Result { const PATH_MAX: usize = libc::PATH_MAX as usize; let mut buf = vec![0_u8; PATH_MAX]; @@ -2785,3 +2807,23 @@ pub fn ttyname(fd: RawFd) -> Result { buf.truncate(nul); Ok(OsString::from_vec(buf).into()) } + +/// Get the effective user ID and group ID associated with a Unix domain socket. +/// +/// See also [getpeereid(3)](https://www.freebsd.org/cgi/man.cgi?query=getpeereid) +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "dragonfly", +))] +pub fn getpeereid(fd: RawFd) -> Result<(Uid, Gid)> { + let mut uid = 1; + let mut gid = 1; + + let ret = unsafe { libc::getpeereid(fd, &mut uid, &mut gid) }; + + Errno::result(ret).map(|_| (Uid(uid), Gid(gid))) +} diff --git a/third_party/cargo/vendor/nix-0.20.0/test/common/mod.rs b/third_party/cargo/vendor/nix-0.20.0/test/common/mod.rs new file mode 100644 index 0000000..a871b47 --- /dev/null +++ b/third_party/cargo/vendor/nix-0.20.0/test/common/mod.rs @@ -0,0 +1,127 @@ +use cfg_if::cfg_if; + +#[macro_export] macro_rules! skip { + ($($reason: expr),+) => { + use ::std::io::{self, Write}; + + let stderr = io::stderr(); + let mut handle = stderr.lock(); + writeln!(handle, $($reason),+).unwrap(); + return; + } +} + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + #[macro_export] macro_rules! require_capability { + ($capname:ident) => { + use ::caps::{Capability, CapSet, has_cap}; + + if !has_cap(None, CapSet::Effective, Capability::$capname) + .unwrap() + { + skip!("Insufficient capabilities. Skipping test."); + } + } + } + } else if #[cfg(not(target_os = "redox"))] { + #[macro_export] macro_rules! require_capability { + ($capname:ident) => {} + } + } +} + +#[cfg(any(target_os = "linux", target_os= "android"))] +#[macro_export] macro_rules! skip_if_cirrus { + ($reason:expr) => { + if std::env::var_os("CIRRUS_CI").is_some() { + skip!("{}", $reason); + } + } +} + +#[cfg(target_os = "freebsd")] +#[macro_export] macro_rules! skip_if_jailed { + ($name:expr) => { + use ::sysctl::CtlValue; + + if let CtlValue::Int(1) = ::sysctl::value("security.jail.jailed") + .unwrap() + { + skip!("{} cannot run in a jail. Skipping test.", $name); + } + } +} + +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +#[macro_export] macro_rules! skip_if_not_root { + ($name:expr) => { + use nix::unistd::Uid; + + if !Uid::current().is_root() { + skip!("{} requires root privileges. Skipping test.", $name); + } + }; +} + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + #[macro_export] macro_rules! skip_if_seccomp { + ($name:expr) => { + if let Ok(s) = std::fs::read_to_string("/proc/self/status") { + for l in s.lines() { + let mut fields = l.split_whitespace(); + if fields.next() == Some("Seccomp:") && + fields.next() != Some("0") + { + skip!("{} cannot be run in Seccomp mode. Skipping test.", + stringify!($name)); + } + } + } + } + } + } else if #[cfg(not(target_os = "redox"))] { + #[macro_export] macro_rules! skip_if_seccomp { + ($name:expr) => {} + } + } +} + +cfg_if! { + if #[cfg(target_os = "linux")] { + #[macro_export] macro_rules! require_kernel_version { + ($name:expr, $version_requirement:expr) => { + use semver::{Version, VersionReq}; + + let version_requirement = VersionReq::parse($version_requirement) + .expect("Bad match_version provided"); + + let uname = nix::sys::utsname::uname(); + println!("{}", uname.sysname()); + println!("{}", uname.nodename()); + println!("{}", uname.release()); + println!("{}", uname.version()); + println!("{}", uname.machine()); + + // Fix stuff that the semver parser can't handle + let fixed_release = &uname.release().to_string() + // Fedora 33 reports version as 4.18.el8_2.x86_64 or + // 5.18.200-fc33.x86_64. Remove the underscore. + .replace("_", "-") + // Cirrus-CI reports version as 4.19.112+ . Remove the + + .replace("+", ""); + let mut version = Version::parse(fixed_release).unwrap(); + + //Keep only numeric parts + version.pre.clear(); + version.build.clear(); + + if !version_requirement.matches(&version) { + skip!("Skip {} because kernel version `{}` doesn't match the requirement `{}`", + stringify!($name), version, version_requirement); + } + } + } + } +} diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/mod.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/mod.rs similarity index 91% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/mod.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/mod.rs index c4391c7..14b0378 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/sys/mod.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/sys/mod.rs @@ -21,9 +21,9 @@ mod test_sockopt; mod test_select; #[cfg(any(target_os = "android", target_os = "linux"))] mod test_sysinfo; -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] mod test_termios; -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] mod test_ioctl; mod test_wait; mod test_uio; diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_aio.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_aio.rs similarity index 98% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_aio.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_aio.rs index 6b9bd91..3878da9 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_aio.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_aio.rs @@ -137,6 +137,9 @@ fn test_fsync_error() { // in Travis's version of glibc or Linux. Either way, we must skip the test. // https://github.com/nix-rust/nix/issues/1099 #[cfg_attr(target_os = "linux", ignore)] +// On Cirrus, aio_suspend is failing with EINVAL +// https://github.com/nix-rust/nix/issues/1361 +#[cfg_attr(target_os = "macos", ignore)] fn test_aio_suspend() { const INITIAL: &[u8] = b"abcdef123456"; const WBUF: &[u8] = b"CDEFG"; @@ -164,7 +167,12 @@ fn test_aio_suspend() { loop { { let cbbuf = [&wcb, &rcb]; - assert!(aio_suspend(&cbbuf[..], Some(timeout)).is_ok()); + let r = aio_suspend(&cbbuf[..], Some(timeout)); + match r { + Err(Error::Sys(Errno::EINTR)) => continue, + Err(e) => panic!("aio_suspend returned {:?}", e), + Ok(_) => () + }; } if rcb.error() != Err(Error::from(Errno::EINPROGRESS)) && wcb.error() != Err(Error::from(Errno::EINPROGRESS)) { diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_aio_drop.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_aio_drop.rs similarity index 91% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_aio_drop.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_aio_drop.rs index 71a2183..784ee3e 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_aio_drop.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_aio_drop.rs @@ -9,6 +9,7 @@ target_os = "macos", target_os = "freebsd", target_os = "netbsd")))] +#[cfg_attr(target_env = "gnu", ignore = "Occasionally fails in Travis; glibc bug suspected")] fn test_drop() { use nix::sys::aio::*; use nix::sys::signal::*; diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_epoll.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_epoll.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_epoll.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_epoll.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_inotify.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_inotify.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_inotify.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_inotify.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_ioctl.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_ioctl.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_ioctl.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_ioctl.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_lio_listio_resubmit.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_lio_listio_resubmit.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_lio_listio_resubmit.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_lio_listio_resubmit.rs diff --git a/third_party/cargo/vendor/nix-0.20.0/test/sys/test_mman.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_mman.rs new file mode 100644 index 0000000..152fff6 --- /dev/null +++ b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_mman.rs @@ -0,0 +1,80 @@ +use nix::Error; +use nix::libc::{c_void, size_t}; +use nix::sys::mman::{mmap, MapFlags, ProtFlags}; + +#[cfg(target_os = "linux")] +use nix::sys::mman::{mremap, MRemapFlags}; + +#[test] +fn test_mmap_anonymous() { + let ref mut byte = unsafe { + let ptr = mmap(std::ptr::null_mut(), 1, + ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, + MapFlags::MAP_PRIVATE | MapFlags::MAP_ANONYMOUS, -1, 0) + .unwrap(); + *(ptr as * mut u8) + }; + assert_eq !(*byte, 0x00u8); + *byte = 0xffu8; + assert_eq !(*byte, 0xffu8); +} + +#[test] +#[cfg(target_os = "linux")] +fn test_mremap_grow() { + const ONE_K : size_t = 1024; + let slice : &mut[u8] = unsafe { + let mem = mmap(std::ptr::null_mut(), ONE_K, + ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, + MapFlags::MAP_ANONYMOUS | MapFlags::MAP_PRIVATE, -1, 0) + .unwrap(); + std::slice::from_raw_parts_mut(mem as * mut u8, ONE_K) + }; + assert_eq !(slice[ONE_K - 1], 0x00); + slice[ONE_K - 1] = 0xFF; + assert_eq !(slice[ONE_K - 1], 0xFF); + + let slice : &mut[u8] = unsafe { + let mem = mremap(slice.as_mut_ptr() as * mut c_void, ONE_K, 10 * ONE_K, + MRemapFlags::MREMAP_MAYMOVE, None) + .unwrap(); + std::slice::from_raw_parts_mut(mem as * mut u8, 10 * ONE_K) + }; + + // The first KB should still have the old data in it. + assert_eq !(slice[ONE_K - 1], 0xFF); + + // The additional range should be zero-init'd and accessible. + assert_eq !(slice[10 * ONE_K - 1], 0x00); + slice[10 * ONE_K - 1] = 0xFF; + assert_eq !(slice[10 * ONE_K - 1], 0xFF); +} + +#[test] +#[cfg(target_os = "linux")] +fn test_mremap_shrink() { + const ONE_K : size_t = 1024; + let slice : &mut[u8] = unsafe { + let mem = mmap(std::ptr::null_mut(), 10 * ONE_K, + ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, + MapFlags::MAP_ANONYMOUS | MapFlags::MAP_PRIVATE, -1, 0) + .unwrap(); + std::slice::from_raw_parts_mut(mem as * mut u8, ONE_K) + }; + assert_eq !(slice[ONE_K - 1], 0x00); + slice[ONE_K - 1] = 0xFF; + assert_eq !(slice[ONE_K - 1], 0xFF); + + let slice : &mut[u8] = unsafe { + let mem = mremap(slice.as_mut_ptr() as * mut c_void, 10 * ONE_K, ONE_K, + MRemapFlags::empty(), None) + .unwrap(); + // Since we didn't supply MREMAP_MAYMOVE, the address should be the + // same. + assert_eq !(mem, slice.as_mut_ptr() as * mut c_void); + std::slice::from_raw_parts_mut(mem as * mut u8, ONE_K) + }; + + // The first KB should still be accessible and have the old data in it. + assert_eq !(slice[ONE_K - 1], 0xFF); +} diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_pthread.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_pthread.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_pthread.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_pthread.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_ptrace.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_ptrace.rs similarity index 97% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_ptrace.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_ptrace.rs index 3b60dd7..b9793b3 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_ptrace.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_ptrace.rs @@ -8,6 +8,8 @@ use nix::sys::ptrace::Options; #[cfg(any(target_os = "android", target_os = "linux"))] use std::mem; +use crate::*; + #[test] fn test_ptrace() { // Just make sure ptrace can be called at all, for now. @@ -98,7 +100,7 @@ fn test_ptrace_cont() { ptrace::cont(child, Some(Signal::SIGKILL)).unwrap(); match waitpid(child, None) { Ok(WaitStatus::Signaled(pid, Signal::SIGKILL, _)) if pid == child => { - // FIXME It's been observed on some systems (apple) the + // FIXME It's been observed on some systems (apple) the // tracee may not be killed but remain as a zombie process // affecting other wait based tests. Add an extra kill just // to make sure there are no zombies. @@ -148,11 +150,11 @@ fn test_ptrace_syscall() { // set this option to recognize syscall-stops ptrace::setoptions(child, ptrace::Options::PTRACE_O_TRACESYSGOOD).unwrap(); - #[cfg(target_pointer_width = "64")] - let get_syscall_id = || ptrace::getregs(child).unwrap().orig_rax as i64; + #[cfg(target_arch = "x86_64")] + let get_syscall_id = || ptrace::getregs(child).unwrap().orig_rax as libc::c_long; - #[cfg(target_pointer_width = "32")] - let get_syscall_id = || ptrace::getregs(child).unwrap().orig_eax as i32; + #[cfg(target_arch = "x86")] + let get_syscall_id = || ptrace::getregs(child).unwrap().orig_eax as libc::c_long; // kill entry ptrace::syscall(child, None).unwrap(); diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_select.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_select.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_select.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_select.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_signal.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_signal.rs similarity index 99% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_signal.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_signal.rs index 5e0b276..ae22527 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_signal.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_signal.rs @@ -12,6 +12,7 @@ fn test_kill_none() { } #[test] +#[cfg(not(target_os = "fuchsia"))] fn test_killpg_none() { killpg(getpgrp(), None) .expect("Should be able to send signal to my process group."); diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_signalfd.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_signalfd.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_signalfd.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_signalfd.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_socket.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_socket.rs similarity index 98% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_socket.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_socket.rs index c5abb7b..7eab28c 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_socket.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_socket.rs @@ -1,4 +1,3 @@ -use nix::ifaddrs::InterfaceAddress; use nix::sys::socket::{AddressFamily, InetAddr, UnixAddr, getsockname}; use std::collections::hash_map::DefaultHasher; use std::hash::{Hash, Hasher}; @@ -9,6 +8,8 @@ use std::slice; use std::str::FromStr; use libc::c_char; use tempfile; +#[cfg(any(target_os = "linux", target_os= "android"))] +use crate::*; #[test] pub fn test_inetv4_addr_to_sock_addr() { @@ -237,6 +238,9 @@ mod recvfrom { use nix::sys::socket::sockopt::{UdpGroSegment, UdpGsoSegment}; #[test] + // Disable the test on emulated platforms because it fails in Cirrus-CI. Lack of QEMU + // support is suspected. + #[cfg_attr(not(any(target_arch = "x86_64", target_arch="i686")), ignore)] pub fn gso() { require_kernel_version!(udp_offload::gso, ">= 4.18"); @@ -288,6 +292,9 @@ mod recvfrom { } #[test] + // Disable the test on emulated platforms because it fails in Cirrus-CI. Lack of QEMU + // support is suspected. + #[cfg_attr(not(any(target_arch = "x86_64", target_arch="i686")), ignore)] pub fn gro() { require_kernel_version!(udp_offload::gro, ">= 5.3"); @@ -592,12 +599,13 @@ pub fn test_af_alg_cipher() { ControlMessage, MsgFlags}; use nix::sys::socket::sockopt::AlgSetKey; + skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1352"); // Travis's seccomp profile blocks AF_ALG // https://docs.docker.com/engine/security/seccomp/ skip_if_seccomp!(test_af_alg_cipher); let alg_type = "skcipher"; - let alg_name = "ctr(aes)"; + let alg_name = "ctr-aes-aesni"; // 256-bits secret key let key = vec![0u8; 32]; // 16-bytes IV @@ -660,6 +668,7 @@ pub fn test_af_alg_aead() { ControlMessage, MsgFlags}; use nix::sys::socket::sockopt::{AlgSetKey, AlgSetAeadAuthSize}; + skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1352"); // Travis's seccomp profile blocks AF_ALG // https://docs.docker.com/engine/security/seccomp/ skip_if_seccomp!(test_af_alg_aead); @@ -1018,7 +1027,7 @@ fn test_too_large_cmsgspace() { fn test_impl_scm_credentials_and_rights(mut space: Vec) { use libc::ucred; use nix::sys::uio::IoVec; - use nix::unistd::{pipe, read, write, close, getpid, getuid, getgid}; + use nix::unistd::{pipe, write, close, getpid, getuid, getgid}; use nix::sys::socket::{socketpair, sendmsg, recvmsg, setsockopt, SockType, SockFlag, ControlMessage, ControlMessageOwned, MsgFlags}; @@ -1151,7 +1160,7 @@ pub fn test_syscontrol() { target_os = "netbsd", target_os = "openbsd", ))] -fn loopback_address(family: AddressFamily) -> Option { +fn loopback_address(family: AddressFamily) -> Option { use std::io; use std::io::Write; use nix::ifaddrs::getifaddrs; diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_sockopt.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_sockopt.rs similarity index 98% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_sockopt.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_sockopt.rs index 8e2adce..5606593 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_sockopt.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_sockopt.rs @@ -1,5 +1,7 @@ use rand::{thread_rng, Rng}; use nix::sys::socket::{socket, sockopt, getsockopt, setsockopt, AddressFamily, SockType, SockFlag, SockProtocol}; +#[cfg(any(target_os = "android", target_os = "linux"))] +use crate::*; #[cfg(target_os = "linux")] #[test] diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_sysinfo.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_sysinfo.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_sysinfo.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_sysinfo.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_termios.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_termios.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_termios.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_termios.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_timerfd.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_timerfd.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_timerfd.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_timerfd.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_uio.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_uio.rs similarity index 99% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_uio.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_uio.rs index 4fa838c..8d22bf1 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_uio.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_uio.rs @@ -203,6 +203,7 @@ fn test_process_vm_readv() { use nix::unistd::ForkResult::*; use nix::sys::signal::*; use nix::sys::wait::*; + use crate::*; require_capability!(CAP_SYS_PTRACE); let _ = crate::FORK_MTX.lock().expect("Mutex got poisoned by another test"); diff --git a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_wait.rs b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_wait.rs similarity index 99% rename from third_party/cargo/vendor/nix-0.19.1/test/sys/test_wait.rs rename to third_party/cargo/vendor/nix-0.20.0/test/sys/test_wait.rs index d105625..5bb298e 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/sys/test_wait.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/sys/test_wait.rs @@ -67,6 +67,7 @@ mod ptrace { use nix::unistd::*; use nix::unistd::ForkResult::*; use libc::_exit; + use crate::*; fn ptrace_child() -> ! { ptrace::traceme().unwrap(); diff --git a/third_party/cargo/vendor/nix-0.20.0/test/test.rs b/third_party/cargo/vendor/nix-0.20.0/test/test.rs new file mode 100644 index 0000000..5a5330b --- /dev/null +++ b/third_party/cargo/vendor/nix-0.20.0/test/test.rs @@ -0,0 +1,100 @@ +#[macro_use] +extern crate cfg_if; +#[cfg_attr(not(target_os = "redox"), macro_use)] +extern crate nix; +#[macro_use] +extern crate lazy_static; + +mod common; +mod sys; +#[cfg(not(target_os = "redox"))] +mod test_dir; +mod test_fcntl; +#[cfg(any(target_os = "android", + target_os = "linux"))] +mod test_kmod; +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "fushsia", + target_os = "linux", + target_os = "netbsd"))] +mod test_mq; +#[cfg(not(target_os = "redox"))] +mod test_net; +mod test_nix_path; +mod test_poll; +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +mod test_pty; +#[cfg(any(target_os = "android", + target_os = "linux"))] +mod test_sched; +#[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] +mod test_sendfile; +mod test_stat; +mod test_time; +mod test_unistd; + +use std::os::unix::io::RawFd; +use std::path::PathBuf; +use std::sync::{Mutex, RwLock, RwLockWriteGuard}; +use nix::unistd::{chdir, getcwd, read}; + + +/// Helper function analogous to `std::io::Read::read_exact`, but for `RawFD`s +fn read_exact(f: RawFd, buf: &mut [u8]) { + let mut len = 0; + while len < buf.len() { + // get_mut would be better than split_at_mut, but it requires nightly + let (_, remaining) = buf.split_at_mut(len); + len += read(f, remaining).unwrap(); + } +} + +lazy_static! { + /// Any test that changes the process's current working directory must grab + /// the RwLock exclusively. Any process that cares about the current + /// working directory must grab it shared. + pub static ref CWD_LOCK: RwLock<()> = RwLock::new(()); + /// Any test that creates child processes must grab this mutex, regardless + /// of what it does with those children. + pub static ref FORK_MTX: Mutex<()> = Mutex::new(()); + /// Any test that changes the process's supplementary groups must grab this + /// mutex + pub static ref GROUPS_MTX: Mutex<()> = Mutex::new(()); + /// Any tests that loads or unloads kernel modules must grab this mutex + pub static ref KMOD_MTX: Mutex<()> = Mutex::new(()); + /// Any test that calls ptsname(3) must grab this mutex. + pub static ref PTSNAME_MTX: Mutex<()> = Mutex::new(()); + /// Any test that alters signal handling must grab this mutex. + pub static ref SIGNAL_MTX: Mutex<()> = Mutex::new(()); +} + +/// RAII object that restores a test's original directory on drop +struct DirRestore<'a> { + d: PathBuf, + _g: RwLockWriteGuard<'a, ()> +} + +impl<'a> DirRestore<'a> { + fn new() -> Self { + let guard = crate::CWD_LOCK.write() + .expect("Lock got poisoned by another test"); + DirRestore{ + _g: guard, + d: getcwd().unwrap(), + } + } +} + +impl<'a> Drop for DirRestore<'a> { + fn drop(&mut self) { + let r = chdir(&self.d); + if std::thread::panicking() { + r.unwrap(); + } + } +} diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_clearenv.rs b/third_party/cargo/vendor/nix-0.20.0/test/test_clearenv.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/test_clearenv.rs rename to third_party/cargo/vendor/nix-0.20.0/test/test_clearenv.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_dir.rs b/third_party/cargo/vendor/nix-0.20.0/test/test_dir.rs similarity index 93% rename from third_party/cargo/vendor/nix-0.19.1/test/test_dir.rs rename to third_party/cargo/vendor/nix-0.20.0/test/test_dir.rs index c5f9c51..505277e 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/test_dir.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/test_dir.rs @@ -34,7 +34,9 @@ fn rewind() { Mode::empty()).unwrap(); let entries1: Vec<_> = dir.iter().map(|e| e.unwrap().file_name().to_owned()).collect(); let entries2: Vec<_> = dir.iter().map(|e| e.unwrap().file_name().to_owned()).collect(); + let entries3: Vec<_> = dir.into_iter().map(|e| e.unwrap().file_name().to_owned()).collect(); assert_eq!(entries1, entries2); + assert_eq!(entries2, entries3); } #[test] diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_fcntl.rs b/third_party/cargo/vendor/nix-0.20.0/test/test_fcntl.rs similarity index 99% rename from third_party/cargo/vendor/nix-0.19.1/test/test_fcntl.rs rename to third_party/cargo/vendor/nix-0.20.0/test/test_fcntl.rs index 2971907..5d1bafe 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/test_fcntl.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/test_fcntl.rs @@ -19,6 +19,8 @@ use std::io::prelude::*; #[cfg(not(target_os = "redox"))] use std::os::unix::fs; +use crate::*; + #[test] #[cfg(not(target_os = "redox"))] fn test_openat() { @@ -93,6 +95,8 @@ mod linux_android { use tempfile::{tempfile, NamedTempFile}; + use crate::*; + /// This test creates a temporary file containing the contents /// 'foobarbaz' and uses the `copy_file_range` call to transfer /// 3 bytes at offset 3 (`bar`) to another empty file at offset 0. The @@ -328,7 +332,7 @@ mod linux_android { target_os = "fuchsia", any(target_os = "wasi", target_env = "wasi"), target_env = "uclibc", - target_env = "freebsd"))] + target_os = "freebsd"))] mod test_posix_fadvise { use tempfile::NamedTempFile; diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_kmod/hello_mod/Makefile b/third_party/cargo/vendor/nix-0.20.0/test/test_kmod/hello_mod/Makefile similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/test_kmod/hello_mod/Makefile rename to third_party/cargo/vendor/nix-0.20.0/test/test_kmod/hello_mod/Makefile diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_kmod/hello_mod/hello.c b/third_party/cargo/vendor/nix-0.20.0/test/test_kmod/hello_mod/hello.c similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/test_kmod/hello_mod/hello.c rename to third_party/cargo/vendor/nix-0.20.0/test/test_kmod/hello_mod/hello.c diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_kmod/mod.rs b/third_party/cargo/vendor/nix-0.20.0/test/test_kmod/mod.rs similarity index 99% rename from third_party/cargo/vendor/nix-0.19.1/test/test_kmod/mod.rs rename to third_party/cargo/vendor/nix-0.20.0/test/test_kmod/mod.rs index e7472ab..fb7260b 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/test_kmod/mod.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/test_kmod/mod.rs @@ -2,6 +2,7 @@ use std::fs::copy; use std::path::PathBuf; use std::process::Command; use tempfile::{tempdir, TempDir}; +use crate::*; fn compile_kernel_module() -> (PathBuf, String, TempDir) { let _m = crate::FORK_MTX diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_mount.rs b/third_party/cargo/vendor/nix-0.20.0/test/test_mount.rs similarity index 98% rename from third_party/cargo/vendor/nix-0.19.1/test/test_mount.rs rename to third_party/cargo/vendor/nix-0.20.0/test/test_mount.rs index 605276b..c1b6c8a 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/test_mount.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/test_mount.rs @@ -1,3 +1,5 @@ +mod common; + // Impelmentation note: to allow unprivileged users to run it, this test makes // use of user and mount namespaces. On systems that allow unprivileged user // namespaces (Linux >= 3.8 compiled with CONFIG_USER_NS), the test should run @@ -222,6 +224,7 @@ fn main() { use test_mount::{setup_namespaces, test_mount_tmpfs_without_flags_allows_rwx, test_mount_rdonly_disallows_write, test_mount_noexec_disallows_exec, test_mount_bind}; + skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1351"); setup_namespaces(); run_tests!(test_mount_tmpfs_without_flags_allows_rwx, diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_mq.rs b/third_party/cargo/vendor/nix-0.20.0/test/test_mq.rs similarity index 93% rename from third_party/cargo/vendor/nix-0.19.1/test/test_mq.rs rename to third_party/cargo/vendor/nix-0.20.0/test/test_mq.rs index ecee200..1667a35 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/test_mq.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/test_mq.rs @@ -1,17 +1,15 @@ -use libc::c_long; - use std::ffi::CString; use std::str; use nix::errno::Errno::*; use nix::Error::Sys; -use nix::mqueue::{mq_open, mq_close, mq_send, mq_receive}; +use nix::mqueue::{mq_open, mq_close, mq_send, mq_receive, mq_attr_member_t}; use nix::mqueue::{MqAttr, MQ_OFlag}; use nix::sys::stat::Mode; #[test] fn test_mq_send_and_receive() { - const MSG_SIZE: c_long = 32; + const MSG_SIZE: mq_attr_member_t = 32; let attr = MqAttr::new(0, 10, MSG_SIZE, 0); let mq_name= &CString::new(b"/a_nix_test_queue".as_ref()).unwrap(); @@ -43,7 +41,7 @@ fn test_mq_send_and_receive() { #[cfg(not(any(target_os = "netbsd")))] fn test_mq_getattr() { use nix::mqueue::mq_getattr; - const MSG_SIZE: c_long = 32; + const MSG_SIZE: mq_attr_member_t = 32; let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); let mq_name = &CString::new(b"/attr_test_get_attr".as_ref()).unwrap(); let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; @@ -66,7 +64,7 @@ fn test_mq_getattr() { #[cfg_attr(any(target_arch = "mips", target_arch = "mips64"), ignore)] fn test_mq_setattr() { use nix::mqueue::{mq_getattr, mq_setattr}; - const MSG_SIZE: c_long = 32; + const MSG_SIZE: mq_attr_member_t = 32; let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); let mq_name = &CString::new(b"/attr_test_get_attr".as_ref()).unwrap(); let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; @@ -87,7 +85,7 @@ fn test_mq_setattr() { // O_NONBLOCK can be set (see tests below) assert_ne!(new_attr_get, new_attr); - let new_attr_non_blocking = MqAttr::new(MQ_OFlag::O_NONBLOCK.bits() as c_long, 10, MSG_SIZE, 0); + let new_attr_non_blocking = MqAttr::new(MQ_OFlag::O_NONBLOCK.bits() as mq_attr_member_t, 10, MSG_SIZE, 0); mq_setattr(mqd, &new_attr_non_blocking).unwrap(); let new_attr_get = mq_getattr(mqd).unwrap(); @@ -103,7 +101,7 @@ fn test_mq_setattr() { #[cfg_attr(any(target_arch = "mips", target_arch = "mips64"), ignore)] fn test_mq_set_nonblocking() { use nix::mqueue::{mq_getattr, mq_set_nonblock, mq_remove_nonblock}; - const MSG_SIZE: c_long = 32; + const MSG_SIZE: mq_attr_member_t = 32; let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); let mq_name = &CString::new(b"/attr_test_get_attr".as_ref()).unwrap(); let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; @@ -116,7 +114,7 @@ fn test_mq_set_nonblocking() { let mqd = r.unwrap(); mq_set_nonblock(mqd).unwrap(); let new_attr = mq_getattr(mqd); - assert_eq!(new_attr.unwrap().flags(), MQ_OFlag::O_NONBLOCK.bits() as c_long); + assert_eq!(new_attr.unwrap().flags(), MQ_OFlag::O_NONBLOCK.bits() as mq_attr_member_t); mq_remove_nonblock(mqd).unwrap(); let new_attr = mq_getattr(mqd); assert_eq!(new_attr.unwrap().flags(), 0); @@ -127,7 +125,7 @@ fn test_mq_set_nonblocking() { #[cfg(not(any(target_os = "netbsd")))] fn test_mq_unlink() { use nix::mqueue::mq_unlink; - const MSG_SIZE: c_long = 32; + const MSG_SIZE: mq_attr_member_t = 32; let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); let mq_name_opened = &CString::new(b"/mq_unlink_test".as_ref()).unwrap(); let mq_name_not_opened = &CString::new(b"/mq_unlink_test".as_ref()).unwrap(); diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_net.rs b/third_party/cargo/vendor/nix-0.20.0/test/test_net.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/test_net.rs rename to third_party/cargo/vendor/nix-0.20.0/test/test_net.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_nix_path.rs b/third_party/cargo/vendor/nix-0.20.0/test/test_nix_path.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/test_nix_path.rs rename to third_party/cargo/vendor/nix-0.20.0/test/test_nix_path.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_poll.rs b/third_party/cargo/vendor/nix-0.20.0/test/test_poll.rs similarity index 72% rename from third_party/cargo/vendor/nix-0.19.1/test/test_poll.rs rename to third_party/cargo/vendor/nix-0.20.0/test/test_poll.rs index d1974ac..a5e2d25 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/test_poll.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/test_poll.rs @@ -1,5 +1,21 @@ -use nix::poll::{PollFlags, poll, PollFd}; -use nix::unistd::{write, pipe}; +use nix::{ + Error, + errno::Errno, + poll::{PollFlags, poll, PollFd}, + unistd::{write, pipe} +}; + +macro_rules! loop_while_eintr { + ($poll_expr: expr) => { + loop { + match $poll_expr { + Ok(nfds) => break nfds, + Err(Error::Sys(Errno::EINTR)) => (), + Err(e) => panic!(e) + } + } + } +} #[test] fn test_poll() { @@ -7,7 +23,7 @@ fn test_poll() { let mut fds = [PollFd::new(r, PollFlags::POLLIN)]; // Poll an idle pipe. Should timeout - let nfds = poll(&mut fds, 100).unwrap(); + let nfds = loop_while_eintr!(poll(&mut fds, 100)); assert_eq!(nfds, 0); assert!(!fds[0].revents().unwrap().contains(PollFlags::POLLIN)); @@ -37,7 +53,8 @@ fn test_ppoll() { let mut fds = [PollFd::new(r, PollFlags::POLLIN)]; // Poll an idle pipe. Should timeout - let nfds = ppoll(&mut fds, Some(timeout), SigSet::empty()).unwrap(); + let sigset = SigSet::empty(); + let nfds = loop_while_eintr!(ppoll(&mut fds, Some(timeout), sigset)); assert_eq!(nfds, 0); assert!(!fds[0].revents().unwrap().contains(PollFlags::POLLIN)); diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_pty.rs b/third_party/cargo/vendor/nix-0.20.0/test/test_pty.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/test_pty.rs rename to third_party/cargo/vendor/nix-0.20.0/test/test_pty.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_ptymaster_drop.rs b/third_party/cargo/vendor/nix-0.20.0/test/test_ptymaster_drop.rs similarity index 93% rename from third_party/cargo/vendor/nix-0.19.1/test/test_ptymaster_drop.rs rename to third_party/cargo/vendor/nix-0.20.0/test/test_ptymaster_drop.rs index 5a5c55d..ff939b9 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/test_ptymaster_drop.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/test_ptymaster_drop.rs @@ -1,4 +1,4 @@ -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] mod t { use nix::fcntl::OFlag; use nix::pty::*; diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_sched.rs b/third_party/cargo/vendor/nix-0.20.0/test/test_sched.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/test_sched.rs rename to third_party/cargo/vendor/nix-0.20.0/test/test_sched.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_sendfile.rs b/third_party/cargo/vendor/nix-0.20.0/test/test_sendfile.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/test_sendfile.rs rename to third_party/cargo/vendor/nix-0.20.0/test/test_sendfile.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_stat.rs b/third_party/cargo/vendor/nix-0.20.0/test/test_stat.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/test_stat.rs rename to third_party/cargo/vendor/nix-0.20.0/test/test_stat.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_time.rs b/third_party/cargo/vendor/nix-0.20.0/test/test_time.rs similarity index 100% rename from third_party/cargo/vendor/nix-0.19.1/test/test_time.rs rename to third_party/cargo/vendor/nix-0.20.0/test/test_time.rs diff --git a/third_party/cargo/vendor/nix-0.19.1/test/test_unistd.rs b/third_party/cargo/vendor/nix-0.20.0/test/test_unistd.rs similarity index 89% rename from third_party/cargo/vendor/nix-0.19.1/test/test_unistd.rs rename to third_party/cargo/vendor/nix-0.20.0/test/test_unistd.rs index a4b8a91..16a8a05 100644 --- a/third_party/cargo/vendor/nix-0.19.1/test/test_unistd.rs +++ b/third_party/cargo/vendor/nix-0.20.0/test/test_unistd.rs @@ -7,7 +7,7 @@ use nix::unistd::ForkResult::*; use nix::sys::signal::{SaFlags, SigAction, SigHandler, SigSet, Signal, sigaction}; use nix::sys::wait::*; use nix::sys::stat::{self, Mode, SFlag}; -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] use nix::pty::{posix_openpt, grantpt, unlockpt, ptsname}; use nix::errno::Errno; #[cfg(not(target_os = "redox"))] @@ -19,13 +19,14 @@ use std::ffi::CString; use std::fs::DirBuilder; use std::fs::{self, File}; use std::io::Write; -use std::mem; use std::os::unix::prelude::*; #[cfg(not(target_os = "redox"))] use std::path::Path; use tempfile::{tempdir, tempfile}; use libc::{_exit, off_t}; +use crate::*; + #[test] #[cfg(not(any(target_os = "netbsd")))] fn test_fork_and_waitpid() { @@ -200,7 +201,7 @@ mod linux_android { #[test] // `getgroups()` and `setgroups()` do not behave as expected on Apple platforms -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox", target_os = "fuchsia")))] fn test_setgroups() { // Skip this test when not run as root as `setgroups()` requires root. skip_if_not_root!("test_setgroups"); @@ -223,7 +224,7 @@ fn test_setgroups() { #[test] // `getgroups()` and `setgroups()` do not behave as expected on Apple platforms -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox", target_os = "fuchsia")))] fn test_initgroups() { // Skip this test when not run as root as `initgroups()` and `setgroups()` // require root. @@ -259,18 +260,24 @@ macro_rules! execve_test_factory( #[cfg(test)] mod $test_name { + use std::ffi::CStr; use super::*; + const EMPTY: &'static [u8] = b"\0"; + const DASH_C: &'static [u8] = b"-c\0"; + const BIGARG: &'static [u8] = b"echo nix!!! && echo foo=$foo && echo baz=$baz\0"; + const FOO: &'static [u8] = b"foo=bar\0"; + const BAZ: &'static [u8] = b"baz=quux\0"; + fn syscall_cstr_ref() -> Result { $syscall( $exe, $(CString::new($pathname).unwrap().as_c_str(), )* - &[CString::new(b"".as_ref()).unwrap().as_c_str(), - CString::new(b"-c".as_ref()).unwrap().as_c_str(), - CString::new(b"echo nix!!! && echo foo=$foo && echo baz=$baz" - .as_ref()).unwrap().as_c_str()], - &[CString::new(b"foo=bar".as_ref()).unwrap().as_c_str(), - CString::new(b"baz=quux".as_ref()).unwrap().as_c_str()] + &[CStr::from_bytes_with_nul(EMPTY).unwrap(), + CStr::from_bytes_with_nul(DASH_C).unwrap(), + CStr::from_bytes_with_nul(BIGARG).unwrap()], + &[CStr::from_bytes_with_nul(FOO).unwrap(), + CStr::from_bytes_with_nul(BAZ).unwrap()] $(, $flags)*) } @@ -278,12 +285,11 @@ macro_rules! execve_test_factory( $syscall( $exe, $(CString::new($pathname).unwrap().as_c_str(), )* - &[CString::new(b"".as_ref()).unwrap(), - CString::new(b"-c".as_ref()).unwrap(), - CString::new(b"echo nix!!! && echo foo=$foo && echo baz=$baz" - .as_ref()).unwrap()], - &[CString::new(b"foo=bar".as_ref()).unwrap(), - CString::new(b"baz=quux".as_ref()).unwrap()] + &[CString::from(CStr::from_bytes_with_nul(EMPTY).unwrap()), + CString::from(CStr::from_bytes_with_nul(DASH_C).unwrap()), + CString::from(CStr::from_bytes_with_nul(BIGARG).unwrap())], + &[CString::from(CStr::from_bytes_with_nul(FOO).unwrap()), + CString::from(CStr::from_bytes_with_nul(BAZ).unwrap())] $(, $flags)*) } @@ -329,11 +335,17 @@ macro_rules! execve_test_factory( } } + // These tests frequently fail on musl, probably due to + // https://github.com/nix-rust/nix/issues/555 + #[cfg_attr(target_env = "musl", ignore)] #[test] fn test_cstr_ref() { common_test(syscall_cstr_ref); } + // These tests frequently fail on musl, probably due to + // https://github.com/nix-rust/nix/issues/555 + #[cfg_attr(target_env = "musl", ignore)] #[test] fn test_cstring() { common_test(syscall_cstring); @@ -349,6 +361,8 @@ cfg_if!{ execve_test_factory!(test_fexecve, fexecve, File::open("/system/bin/sh").unwrap().into_raw_fd()); } else if #[cfg(any(target_os = "freebsd", target_os = "linux"))] { + // These tests frequently fail on musl, probably due to + // https://github.com/nix-rust/nix/issues/555 execve_test_factory!(test_execve, execve, CString::new("/bin/sh").unwrap().as_c_str()); execve_test_factory!(test_fexecve, fexecve, File::open("/bin/sh").unwrap().into_raw_fd()); } else if #[cfg(any(target_os = "dragonfly", @@ -371,11 +385,14 @@ execve_test_factory!(test_execvpe, execvpe, &CString::new("sh").unwrap()); cfg_if!{ if #[cfg(target_os = "android")] { use nix::fcntl::AtFlags; - execve_test_factory!(test_execveat_empty, execveat, File::open("/system/bin/sh").unwrap().into_raw_fd(), + execve_test_factory!(test_execveat_empty, execveat, + File::open("/system/bin/sh").unwrap().into_raw_fd(), "", AtFlags::AT_EMPTY_PATH); - execve_test_factory!(test_execveat_relative, execveat, File::open("/system/bin/").unwrap().into_raw_fd(), + execve_test_factory!(test_execveat_relative, execveat, + File::open("/system/bin/").unwrap().into_raw_fd(), "./sh", AtFlags::empty()); - execve_test_factory!(test_execveat_absolute, execveat, File::open("/").unwrap().into_raw_fd(), + execve_test_factory!(test_execveat_absolute, execveat, + File::open("/").unwrap().into_raw_fd(), "/system/bin/sh", AtFlags::empty()); } else if #[cfg(all(target_os = "linux", any(target_arch ="x86_64", target_arch ="x86")))] { use nix::fcntl::AtFlags; @@ -389,6 +406,7 @@ cfg_if!{ } #[test] +#[cfg(not(target_os = "fuchsia"))] fn test_fchdir() { // fchdir changes the process's cwd let _dr = crate::DirRestore::new(); @@ -459,9 +477,7 @@ fn test_fchown() { fchown(fd, uid, gid).unwrap(); fchown(fd, uid, None).unwrap(); fchown(fd, None, gid).unwrap(); - - mem::drop(path); - fchown(fd, uid, gid).unwrap_err(); + fchown(999999999, uid, gid).unwrap_err(); } #[test] @@ -537,7 +553,7 @@ cfg_if!{ skip_if_jailed!("test_acct"); } } - } else if #[cfg(not(target_os = "redox"))] { + } else if #[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] { macro_rules! require_acct{ () => { skip_if_not_root!("test_acct"); @@ -547,7 +563,7 @@ cfg_if!{ } #[test] -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] fn test_acct() { use tempfile::NamedTempFile; use std::process::Command; @@ -634,7 +650,7 @@ fn test_pipe2() { } #[test] -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] fn test_truncate() { let tempdir = tempdir().unwrap(); let path = tempdir.path().join("file"); @@ -684,6 +700,12 @@ pub extern fn alarm_signal_handler(raw_signal: libc::c_int) { #[test] #[cfg(not(target_os = "redox"))] fn test_alarm() { + use std::{ + time::{Duration, Instant,}, + thread + }; + + // Maybe other tests that fork interfere with this one? let _m = crate::SIGNAL_MTX.lock().expect("Mutex got poisoned by another test"); let handler = SigHandler::Handler(alarm_signal_handler); @@ -701,8 +723,16 @@ fn test_alarm() { // We should be woken up after 1 second by the alarm, so we'll sleep for 2 // seconds to be sure. - sleep(2); - assert_eq!(unsafe { ALARM_CALLED }, true, "expected our alarm signal handler to be called"); + let starttime = Instant::now(); + loop { + thread::sleep(Duration::from_millis(100)); + if unsafe { ALARM_CALLED} { + break; + } + if starttime.elapsed() > Duration::from_secs(3) { + panic!("Timeout waiting for SIGALRM"); + } + } // Reset the signal. unsafe { @@ -976,8 +1006,9 @@ fn test_setfsuid() { let nobody = User::from_name("nobody").unwrap().unwrap(); // create a temporary file with permissions '-rw-r-----' - let file = tempfile::NamedTempFile::new().unwrap(); + let file = tempfile::NamedTempFile::new_in("/var/tmp").unwrap(); let temp_path = file.into_temp_path(); + dbg!(&temp_path); let temp_path_2 = (&temp_path).to_path_buf(); let mut permissions = fs::metadata(&temp_path).unwrap().permissions(); permissions.set_mode(640); @@ -1003,7 +1034,7 @@ fn test_setfsuid() { } #[test] -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] fn test_ttyname() { let fd = posix_openpt(OFlag::O_RDWR).expect("posix_openpt failed"); assert!(fd.as_raw_fd() > 0); @@ -1026,7 +1057,7 @@ fn test_ttyname() { } #[test] -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] fn test_ttyname_not_pty() { let fd = File::open("/dev/zero").unwrap(); assert!(fd.as_raw_fd() > 0); @@ -1034,13 +1065,46 @@ fn test_ttyname_not_pty() { } #[test] -#[cfg(all(not(target_os = "redox"), not(target_env = "musl")))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] fn test_ttyname_invalid_fd() { assert_eq!(ttyname(-1), Err(Error::Sys(Errno::EBADF))); } #[test] -#[cfg(all(not(target_os = "redox"), target_env = "musl"))] -fn test_ttyname_invalid_fd() { - assert_eq!(ttyname(-1), Err(Error::Sys(Errno::ENOTTY))); +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "dragonfly", +))] +fn test_getpeereid() { + use std::os::unix::net::UnixStream; + let (sock_a, sock_b) = UnixStream::pair().unwrap(); + + let (uid_a, gid_a) = getpeereid(sock_a.as_raw_fd()).unwrap(); + let (uid_b, gid_b) = getpeereid(sock_b.as_raw_fd()).unwrap(); + + let uid = geteuid(); + let gid = getegid(); + + assert_eq!(uid, uid_a); + assert_eq!(gid, gid_a); + assert_eq!(uid_a, uid_b); + assert_eq!(gid_a, gid_b); +} + +#[test] +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "dragonfly", +))] +fn test_getpeereid_invalid_fd() { + // getpeereid is not POSIX, so error codes are inconsistent between different Unices. + assert!(getpeereid(-1).is_err()); } diff --git a/third_party/cargo/vendor/nom-6.0.1/.cargo-checksum.json b/third_party/cargo/vendor/nom-6.1.2/.cargo-checksum.json similarity index 72% rename from third_party/cargo/vendor/nom-6.0.1/.cargo-checksum.json rename to third_party/cargo/vendor/nom-6.1.2/.cargo-checksum.json index e42eb73..3e2fe34 100644 --- a/third_party/cargo/vendor/nom-6.0.1/.cargo-checksum.json +++ b/third_party/cargo/vendor/nom-6.1.2/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".travis.yml":"d42be3314463c8292b8007849abbcfa7eb2859d725208bab29f8e6f5b4350d9b","CHANGELOG.md":"b394a89cd25428f9e50b38d37568bf21308c64f8584f6f4bf57daafb7678da22","Cargo.lock":"96ede992472c54261311a29ee271f33f1ac656c0657f286e35fc26e0f2d70db8","Cargo.toml":"8285d7defaff3dbfb65ec688d7dd963d91539b86b5a9ca853f07c33af56d60ae","LICENSE":"4dbda04344456f09a7a588140455413a9ac59b6b26a1ef7cdf9c800c012d87f0","README.md":"c813b3736cb31b3a46af0fa495e812640d48fddbd34618961aa870a787bae5e6","build.rs":"a5af84de9e65e08b88127f99f6cb5ed9a84506b115f60be4a59c918471cc8c48","doc/nom_recipes.md":"a30b42092ebf25d5d4e85a13df81d2c724236851206760bc72a01bc1df1ede99","src/bits/complete.rs":"f5e35d32c3c370510445c7708ec5ff55ce3387aaf8a147b73b26b1bc5a5e171c","src/bits/macros.rs":"82896ae14c47735b906b81517cd49eb87423a5b874dff5a685383fb80427a3aa","src/bits/mod.rs":"490a8595bec6ad0c64ba088452f6a7ebd8846e7d3d48d61432af651e912d186c","src/bits/streaming.rs":"de63b314a893e414b61ba989bfc368136ea2759556d676cb2caad492c3ab7a34","src/branch/macros.rs":"2575b30b2b4a280014cce9b150b25180129ca3df22eb108a59fc4e6e840aeb2e","src/branch/mod.rs":"f2ff0eb5118ea3ecfc64cd522d6c25fabfc3ad4ce5c3ec66b24b80df116e951a","src/bytes/complete.rs":"7a8262ecd25cb4de5c4633681ad2d6e8953fd30545bafd5fc08ba175e8fe7160","src/bytes/macros.rs":"45e2d5c34daff2b1cc667a7908412f5ce05168fb3921e803f6464b49c03f916d","src/bytes/mod.rs":"2eea884d8b95f7caa831f29e918a1cfba112ca22fb842d1999e53aecacc8f6b7","src/bytes/streaming.rs":"7518cbd11f74f392dca9a707196618a909bc9ac6858a78f1efbb0c2ab4f96a2e","src/character/complete.rs":"61a35ab0ba05c2d230bfb4ee580dd44c352cbe3e00c10cddac59867dc835a619","src/character/macros.rs":"46f520da5d8c9443ed0a7e6f7f887729add4f444625727cf4931425c0e1b3afa","src/character/mod.rs":"4758410eb87ec505e616109f8b4bab0c28ce0cec6dd0f200c712d19e0d64f159","src/character/streaming.rs":"011edf543463456e808a7bdd07da2b97ba189270cddad57eb0965ed63987a6af","src/combinator/macros.rs":"634dac67d84444b832cebee612f14eee6e209f6bb3bb1762659d54e3d1466a21","src/combinator/mod.rs":"b45e699bee6119aafb9b240a26a43ac224bbf00e8634dcd99e8eeadd96e89b9e","src/error.rs":"91f1ddf2a6f128f2a6b87e03a77474438436576ee5855fb5050630b1ed86eb50","src/internal.rs":"405a6a8437a9d7c0e85cb66e393c808635e7af24705a5de6aeaf044f237ada57","src/lib.rs":"4eafc5e808e9fcea27695753ca2571bf07dde11ebb13fa14193db69371cc7d68","src/multi/macros.rs":"1f01d62a1478ac0c0329e62d7c5431005e312ef68292408c011741b5eff54216","src/multi/mod.rs":"bf52e7a0e5d70fe31b5aa7151462d4a9116ea25d0ffaa69a8a9f73ea50a9da63","src/number/complete.rs":"fb7d1153ac6795acf8639e2d072ebb6b66a9c0d7b4aec56bed79dfe7f3598a5b","src/number/macros.rs":"565bdd351415a10f72d0d954e41d6edcc12d1f5d315ec952b163f208a9e2849f","src/number/mod.rs":"250acd33777fbb110db438c1be023335a46cf35859ae658b6ce5edf477d95d36","src/number/streaming.rs":"9b3c4002fee0802d5923fdcc0f40af9aee65116057034978784bd1ba0e57d47e","src/regexp/macros.rs":"3455d52e2564b8ab9a440c512ce3bc8370ecaf8dc314d360721ee202882ac458","src/regexp/mod.rs":"60ce2214dceb8b83f9a38d9124ed2855ddff26992ddc3c3674eafb9c22b7e3c3","src/sequence/macros.rs":"29dd388ccf4ef858a47dc3ea552d9e3e0d41c215b9d33d35e380eb5a35e11695","src/sequence/mod.rs":"fff902b0eda9ee59865ab5fd0f8e6ba9bccafad253e0694e4649cc384c610330","src/str.rs":"005fa4185bd1b05244b5d038a9b616a46c308160561ba0a91d625e8152c8fbe9","src/traits.rs":"1701402896d4350fc7068a893a2e8cc04a07ea35f3c5d87fe6e8c07b63e4d6b5","src/util.rs":"581d7c5d2fca708e7c04bb519e09e1a95920618082f0c79123ed5c18427bcf86","tests/arithmetic.rs":"7e49c0f01edcb4395c465b817fdfb0be650939dd23ba5cd39fa450ea963febfd","tests/arithmetic_ast.rs":"0fd86cf6fd674d999057e8ea0c37c07c5db5462f2449bb892d63390f312bc02b","tests/bitstream.rs":"ccaa880c6bf22a1672615e379ae14519d796df5e374eb97eefe05e7a56aab1e0","tests/blockbuf-arithmetic.rs":"099fdf75da97ae032006d8c82ea2207265c5161a08d1370e1ddddb01e73afaf4","tests/css.rs":"25225bbc0dcc5df42938b1a0b122277d01134356e8da106c0885336fb48d8f1c","tests/custom_errors.rs":"3ed0bdf11d25c9763e7a8e6d483d078761dd935d504042097c4d99c71e631dfe","tests/escaped.rs":"c25987ea6d9a7dde74d58a49c332d223da3a495569cb79e3fe921bce51729ead","tests/float.rs":"544a71e78594990c335f6e57e8c648918ca9f0de97625886a946ad90bc020300","tests/fnmut.rs":"c8ee3f9f4036a7bc1662c10e370c092c269529afd878ef7a4bd20460fd083db8","tests/inference.rs":"5a042bca67efe102de271ad2141b8c62340abfc2616722d34c199479da22eefe","tests/ini.rs":"89220678c57e15432b9e4df13729aeb26373e27c0149fa2afb8252a3664f0a20","tests/ini_str.rs":"5d06688889fecabd77a43d428776eab6c3c1941626416178da8fae246c66ca17","tests/issues.rs":"194799d06880cabf56d30e1693139013a1003530adadf1d718198c95993e72de","tests/json.rs":"2a5227216036e28bcff982d2c691346bae2a8d8678e0c088798cb3c773caf4ee","tests/mp4.rs":"802168de1363c42883076a4122d292d8c6f675546f595ad29e1f1b9a34b97c93","tests/multiline.rs":"6a89d3e2cc9b59c0b10993088b396f26a4ef4ad218a44d22284421376a498ec4","tests/named_args.rs":"8b4265ac687eadcac1ef93be3a10ea2ca31aa7119afc14fc4463af3c70e7324c","tests/overflow.rs":"124d503e66e05bb027c332ad5050cc7f5aea4492c8db74430c34b9af12bee1ec","tests/reborrow_fold.rs":"9328deafc2143c2a2d1a0be86e2448b644cffcb5f0935c8b24eb469f1f9477c0","tests/test1.rs":"06fc9e52638f16bfc3ef69cd26b927e0cf55706d6f132ab7c0f1072208475853"},"package":"88034cfd6b4a0d54dd14f4a507eceee36c0b70e5a02236c4e4df571102be17f0"} \ No newline at end of file +{"files":{".travis.yml":"d42be3314463c8292b8007849abbcfa7eb2859d725208bab29f8e6f5b4350d9b","CHANGELOG.md":"b394a89cd25428f9e50b38d37568bf21308c64f8584f6f4bf57daafb7678da22","Cargo.lock":"73ee56320ac53ea573c0b5c9c439c70eef4d4ca198e175b780465a1d40f60353","Cargo.toml":"a85416a91ebdb8cebae50d31c1ce77517de2bcaac6ad9561b3e54a2902315990","LICENSE":"4dbda04344456f09a7a588140455413a9ac59b6b26a1ef7cdf9c800c012d87f0","README.md":"1877d3bf37aa2ad1cbb7126d125a3d05dddc5845b68395a39014020b864fe2fe","build.rs":"a5af84de9e65e08b88127f99f6cb5ed9a84506b115f60be4a59c918471cc8c48","doc/nom_recipes.md":"9e0313c79b97fe9678b0d13bb666793170dcdffb9257a2d597a4a733c0551d4d","src/bits/complete.rs":"f5e35d32c3c370510445c7708ec5ff55ce3387aaf8a147b73b26b1bc5a5e171c","src/bits/macros.rs":"82896ae14c47735b906b81517cd49eb87423a5b874dff5a685383fb80427a3aa","src/bits/mod.rs":"490a8595bec6ad0c64ba088452f6a7ebd8846e7d3d48d61432af651e912d186c","src/bits/streaming.rs":"de63b314a893e414b61ba989bfc368136ea2759556d676cb2caad492c3ab7a34","src/branch/macros.rs":"2575b30b2b4a280014cce9b150b25180129ca3df22eb108a59fc4e6e840aeb2e","src/branch/mod.rs":"f2ff0eb5118ea3ecfc64cd522d6c25fabfc3ad4ce5c3ec66b24b80df116e951a","src/bytes/complete.rs":"7a8262ecd25cb4de5c4633681ad2d6e8953fd30545bafd5fc08ba175e8fe7160","src/bytes/macros.rs":"45e2d5c34daff2b1cc667a7908412f5ce05168fb3921e803f6464b49c03f916d","src/bytes/mod.rs":"2eea884d8b95f7caa831f29e918a1cfba112ca22fb842d1999e53aecacc8f6b7","src/bytes/streaming.rs":"7518cbd11f74f392dca9a707196618a909bc9ac6858a78f1efbb0c2ab4f96a2e","src/character/complete.rs":"61a35ab0ba05c2d230bfb4ee580dd44c352cbe3e00c10cddac59867dc835a619","src/character/macros.rs":"46f520da5d8c9443ed0a7e6f7f887729add4f444625727cf4931425c0e1b3afa","src/character/mod.rs":"4758410eb87ec505e616109f8b4bab0c28ce0cec6dd0f200c712d19e0d64f159","src/character/streaming.rs":"011edf543463456e808a7bdd07da2b97ba189270cddad57eb0965ed63987a6af","src/combinator/macros.rs":"67c598cb9568724b9701c4b400314f06faf81379f9c4cd3631860f727636a1ab","src/combinator/mod.rs":"4569cfe8e84d49dff348c8e65f75a870af1e9acd14d76c217e5ed577df6e1ca1","src/error.rs":"6524cada484c5a9eade3271f9c711c9b49bea7d84985c617e2afa6094cb3d474","src/internal.rs":"a03a2f50a661b79f74591b87438dd65c446f237102db5ff3d8033cee5079568e","src/lib.rs":"f653ce94b759a6e1faa9675e848150ae89641f5ea2c9377386adca4e8d78822b","src/multi/macros.rs":"e2cfd7daca17e4d994e17d6636774ed75ce9a0588fdada09f3026d515d06981b","src/multi/mod.rs":"da98e73e0eb9d245f04faf2d4bb346fdcf95f7349fbdfe409f5690a004b3a900","src/number/complete.rs":"fb7d1153ac6795acf8639e2d072ebb6b66a9c0d7b4aec56bed79dfe7f3598a5b","src/number/macros.rs":"565bdd351415a10f72d0d954e41d6edcc12d1f5d315ec952b163f208a9e2849f","src/number/mod.rs":"250acd33777fbb110db438c1be023335a46cf35859ae658b6ce5edf477d95d36","src/number/streaming.rs":"9b3c4002fee0802d5923fdcc0f40af9aee65116057034978784bd1ba0e57d47e","src/regexp/macros.rs":"3455d52e2564b8ab9a440c512ce3bc8370ecaf8dc314d360721ee202882ac458","src/regexp/mod.rs":"60ce2214dceb8b83f9a38d9124ed2855ddff26992ddc3c3674eafb9c22b7e3c3","src/sequence/macros.rs":"c53b433ed41f4823b7316a450d43de567db01ea5d16288afa7352889d4e44615","src/sequence/mod.rs":"87e5397fc633892ce80c184f4ac48c063d07b636d5f912c13b94195dd16a9cac","src/str.rs":"005fa4185bd1b05244b5d038a9b616a46c308160561ba0a91d625e8152c8fbe9","src/traits.rs":"1701402896d4350fc7068a893a2e8cc04a07ea35f3c5d87fe6e8c07b63e4d6b5","src/util.rs":"581d7c5d2fca708e7c04bb519e09e1a95920618082f0c79123ed5c18427bcf86","tests/arithmetic.rs":"7e49c0f01edcb4395c465b817fdfb0be650939dd23ba5cd39fa450ea963febfd","tests/arithmetic_ast.rs":"0fd86cf6fd674d999057e8ea0c37c07c5db5462f2449bb892d63390f312bc02b","tests/bitstream.rs":"ccaa880c6bf22a1672615e379ae14519d796df5e374eb97eefe05e7a56aab1e0","tests/blockbuf-arithmetic.rs":"099fdf75da97ae032006d8c82ea2207265c5161a08d1370e1ddddb01e73afaf4","tests/css.rs":"25225bbc0dcc5df42938b1a0b122277d01134356e8da106c0885336fb48d8f1c","tests/custom_errors.rs":"3ed0bdf11d25c9763e7a8e6d483d078761dd935d504042097c4d99c71e631dfe","tests/escaped.rs":"c25987ea6d9a7dde74d58a49c332d223da3a495569cb79e3fe921bce51729ead","tests/float.rs":"544a71e78594990c335f6e57e8c648918ca9f0de97625886a946ad90bc020300","tests/fnmut.rs":"c8ee3f9f4036a7bc1662c10e370c092c269529afd878ef7a4bd20460fd083db8","tests/inference.rs":"5a042bca67efe102de271ad2141b8c62340abfc2616722d34c199479da22eefe","tests/ini.rs":"89220678c57e15432b9e4df13729aeb26373e27c0149fa2afb8252a3664f0a20","tests/ini_str.rs":"5d06688889fecabd77a43d428776eab6c3c1941626416178da8fae246c66ca17","tests/issues.rs":"194799d06880cabf56d30e1693139013a1003530adadf1d718198c95993e72de","tests/json.rs":"2a5227216036e28bcff982d2c691346bae2a8d8678e0c088798cb3c773caf4ee","tests/mp4.rs":"802168de1363c42883076a4122d292d8c6f675546f595ad29e1f1b9a34b97c93","tests/multiline.rs":"6a89d3e2cc9b59c0b10993088b396f26a4ef4ad218a44d22284421376a498ec4","tests/named_args.rs":"8b4265ac687eadcac1ef93be3a10ea2ca31aa7119afc14fc4463af3c70e7324c","tests/overflow.rs":"124d503e66e05bb027c332ad5050cc7f5aea4492c8db74430c34b9af12bee1ec","tests/reborrow_fold.rs":"9328deafc2143c2a2d1a0be86e2448b644cffcb5f0935c8b24eb469f1f9477c0","tests/test1.rs":"06fc9e52638f16bfc3ef69cd26b927e0cf55706d6f132ab7c0f1072208475853"},"package":"e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2"} \ No newline at end of file diff --git a/third_party/cargo/vendor/nom-6.0.1/.travis.yml b/third_party/cargo/vendor/nom-6.1.2/.travis.yml similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/.travis.yml rename to third_party/cargo/vendor/nom-6.1.2/.travis.yml diff --git a/third_party/cargo/vendor/nom-6.0.1/BUILD.bazel b/third_party/cargo/vendor/nom-6.1.2/BUILD.bazel similarity index 99% rename from third_party/cargo/vendor/nom-6.0.1/BUILD.bazel rename to third_party/cargo/vendor/nom-6.1.2/BUILD.bazel index c6b9392..815e9ce 100644 --- a/third_party/cargo/vendor/nom-6.0.1/BUILD.bazel +++ b/third_party/cargo/vendor/nom-6.1.2/BUILD.bazel @@ -68,7 +68,7 @@ rust_library( "cargo-raze", "manual", ], - version = "6.0.1", + version = "6.1.2", # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/memchr-2.3.4:memchr", diff --git a/third_party/cargo/vendor/nom-6.0.1/CHANGELOG.md b/third_party/cargo/vendor/nom-6.1.2/CHANGELOG.md similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/CHANGELOG.md rename to third_party/cargo/vendor/nom-6.1.2/CHANGELOG.md diff --git a/third_party/cargo/vendor/nom-6.0.1/Cargo.lock b/third_party/cargo/vendor/nom-6.1.2/Cargo.lock similarity index 78% rename from third_party/cargo/vendor/nom-6.0.1/Cargo.lock rename to third_party/cargo/vendor/nom-6.1.2/Cargo.lock index 2e74b0d..21f8308 100644 --- a/third_party/cargo/vendor/nom-6.0.1/Cargo.lock +++ b/third_party/cargo/vendor/nom-6.1.2/Cargo.lock @@ -52,9 +52,9 @@ dependencies = [ [[package]] name = "bstr" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473fc6b38233f9af7baa94fb5852dca389e3d95b8e21c8e3719301462c5d9faf" +checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" dependencies = [ "lazy_static", "memchr", @@ -64,15 +64,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.4.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" +checksum = "099e596ef14349721d9016f6b80dd3419ea1bf289ab9b44df8e4dfd3a005d5d9" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" [[package]] name = "cast" @@ -85,15 +85,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.65" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95752358c8f7552394baf48cd82695b345628ad3f170d607de3ca03b8dacca15" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" [[package]] name = "cfg-if" @@ -114,22 +108,22 @@ dependencies = [ [[package]] name = "const_fn" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c478836e029dcef17fb47c89023448c64f781a046e0300e257ad8225ae59afab" +checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6" [[package]] name = "criterion" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70daa7ceec6cf143990669a04c7df13391d55fb27bd4079d252fca774ba244d8" +checksum = "ab327ed7354547cc2ef43cbe20ef68b988e70b4b593cbd66a2a61733123a3d23" dependencies = [ "atty", "cast", "clap", "criterion-plot", "csv", - "itertools", + "itertools 0.10.0", "lazy_static", "num-traits", "oorandom", @@ -151,7 +145,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e022feadec601fba1649cfa83586381a4ad31c6bf3a9ab7d408118b05dd9889d" dependencies = [ "cast", - "itertools", + "itertools 0.9.0", ] [[package]] @@ -160,7 +154,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -170,18 +164,18 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0f606a85340376eef0d6d8fec399e6d4a544d648386c6645eb6d0653b27d9f" +checksum = "a1aaa739f95311c2c7887a76863f500026092fb1dce0161dab577e559ef3569d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "const_fn", "crossbeam-utils", "lazy_static", @@ -191,21 +185,20 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec91540d98355f690a86367e566ecad2e9e579f230230eb7c21398372be73ea5" +checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d" dependencies = [ "autocfg", - "cfg-if 1.0.0", - "const_fn", + "cfg-if", "lazy_static", ] [[package]] name = "csv" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4666154fd004af3fd6f1da2e81a96fd5a81927fe8ddb6ecc79e2aa6e138b54" +checksum = "f9d58633299b24b515ac72a3f869f8b91306a3cec616a602843a383acd6f9e97" dependencies = [ "bstr", "csv-core", @@ -243,21 +236,21 @@ checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" [[package]] name = "funty" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ba62103ce691c2fd80fbae2213dfdda9ce60804973ac6b6e97de818ea7f52c8" +checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" [[package]] name = "half" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36fab90f82edc3c747f9d438e06cf0a491055896f2a279638bb5beed6c40177" +checksum = "62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3" [[package]] name = "hermit-abi" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" +checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" dependencies = [ "libc", ] @@ -272,10 +265,19 @@ dependencies = [ ] [[package]] -name = "itoa" -version = "0.4.6" +name = "itertools" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "jemalloc-sys" @@ -300,9 +302,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.45" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca059e81d9486668f12d455a4ea6daa600bd408134cd17e3d3fb5a32d1f016f8" +checksum = "5cfb73131c35423a367daf8cbd24100af0d077668c8c2943f0e7dd775fef0f65" dependencies = [ "wasm-bindgen", ] @@ -315,30 +317,30 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lexical-core" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db65c6da02e61f55dae90a0ae427b2a5f6b3e8db09f58d10efab23af92592616" +checksum = "21f866863575d0e1d654fbeeabdc927292fdf862873dc3c96c6f753357e13374" dependencies = [ "arrayvec", "bitflags", - "cfg-if 0.1.10", + "cfg-if", "ryu", "static_assertions", ] [[package]] name = "libc" -version = "0.2.80" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" [[package]] name = "log" -version = "0.4.11" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", ] [[package]] @@ -349,20 +351,21 @@ checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] name = "memoffset" -version = "0.5.6" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" dependencies = [ "autocfg", ] [[package]] name = "nom" -version = "6.0.1" +version = "6.1.2" dependencies = [ "bitvec", "criterion", "doc-comment", + "funty", "jemallocator", "lazy_static", "lexical-core", @@ -390,6 +393,12 @@ dependencies = [ "libc", ] +[[package]] +name = "once_cell" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" + [[package]] name = "oorandom" version = "11.1.3" @@ -398,16 +407,32 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "plotters" -version = "0.2.15" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d1685fbe7beba33de0330629da9d955ac75bd54f33d7b79f9a895590124f6bb" +checksum = "45ca0ae5f169d0917a7c7f5a9c1a3d3d9598f18f529dd2b8373ed988efea307a" dependencies = [ - "js-sys", "num-traits", + "plotters-backend", + "plotters-svg", "wasm-bindgen", "web-sys", ] +[[package]] +name = "plotters-backend" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b07fffcddc1cb3a1de753caa4e4df03b79922ba43cf882acc1bdd7e8df9f4590" + +[[package]] +name = "plotters-svg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b38a02e23bd9604b842a812063aec4ef702b57989c37b655254bb61c471ad211" +dependencies = [ + "plotters-backend", +] + [[package]] name = "proc-macro2" version = "1.0.24" @@ -419,9 +444,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" dependencies = [ "proc-macro2", ] @@ -459,9 +484,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" +checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" dependencies = [ "aho-corasick", "memchr", @@ -480,9 +505,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.21" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" +checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" [[package]] name = "rustc_version" @@ -531,9 +556,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.117" +version = "1.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a" +checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae" [[package]] name = "serde_cbor" @@ -547,9 +572,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.117" +version = "1.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e" +checksum = "9391c295d64fc0abb2c556bad848f33cb8296276b1ad2677d1ae1ace4f258f31" dependencies = [ "proc-macro2", "quote", @@ -558,9 +583,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.59" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcac07dbffa1c65e7f816ab9eba78eb142c6d44410f4eeba1e26e4f5dfa56b95" +checksum = "ea1c6153794552ea7cf7cf63b1231a25de00ec90db326ba6264440fa08e31486" dependencies = [ "itoa", "ryu", @@ -575,9 +600,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "syn" -version = "1.0.51" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b4f34193997d92804d359ed09953e25d5138df6bcc055a71bf68ee89fdf9223" +checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" dependencies = [ "proc-macro2", "quote", @@ -586,9 +611,9 @@ dependencies = [ [[package]] name = "tap" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36474e732d1affd3a6ed582781b3683df3d0563714c59c39591e8ff707cf078e" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "textwrap" @@ -601,18 +626,18 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.0.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" dependencies = [ - "lazy_static", + "once_cell", ] [[package]] name = "tinytemplate" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3dc76004a03cec1c5932bca4cdc2e39aaa798e3f82363dd94f9adf6098c12f" +checksum = "a2ada8616fad06a2d0c455adc530de4ef57605a8120cc65da9653e0e9623ca74" dependencies = [ "serde", "serde_json", @@ -649,19 +674,19 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.68" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42" +checksum = "55c0f7123de74f0dab9b7d00fd614e7b19349cd1e2f5252bbe9b1754b59433be" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.68" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f22b422e2a757c35a73774860af8e112bff612ce6cb604224e8e47641a9e4f68" +checksum = "7bc45447f0d4573f3d65720f636bbcc3dd6ce920ed704670118650bcd47764c7" dependencies = [ "bumpalo", "lazy_static", @@ -674,9 +699,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.68" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b13312a745c08c469f0b292dd2fcd6411dba5f7160f593da6ef69b64e407038" +checksum = "3b8853882eef39593ad4174dd26fc9865a64e84026d223f63bb2c42affcbba2c" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -684,9 +709,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.68" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe" +checksum = "4133b5e7f2a531fa413b3a1695e925038a05a71cf67e87dafa295cb645a01385" dependencies = [ "proc-macro2", "quote", @@ -697,15 +722,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.68" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d649a3145108d7d3fbcde896a468d1bd636791823c9921135218ad89be08307" +checksum = "dd4945e4943ae02d15c13962b38a5b1e81eadd4b71214eee75af64a4d6a4fd64" [[package]] name = "web-sys" -version = "0.3.45" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf6ef87ad7ae8008e15a355ce696bed26012b7caa21605188cfd8214ab51e2d" +checksum = "c40dc691fc48003eba817c38da7113c15698142da971298003cac3ef175680b3" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/third_party/cargo/vendor/nom-6.0.1/Cargo.toml b/third_party/cargo/vendor/nom-6.1.2/Cargo.toml similarity index 96% rename from third_party/cargo/vendor/nom-6.0.1/Cargo.toml rename to third_party/cargo/vendor/nom-6.1.2/Cargo.toml index 61b876d..a3f933e 100644 --- a/third_party/cargo/vendor/nom-6.0.1/Cargo.toml +++ b/third_party/cargo/vendor/nom-6.1.2/Cargo.toml @@ -13,7 +13,7 @@ [package] edition = "2018" name = "nom" -version = "6.0.1" +version = "6.1.2" authors = ["contact@geoffroycouprie.com"] include = ["CHANGELOG.md", "LICENSE", "README.md", ".gitignore", ".travis.yml", "Cargo.toml", "src/*.rs", "src/*/*.rs", "tests/*.rs", "doc/nom_recipes.md", "build.rs"] autoexamples = false @@ -150,6 +150,11 @@ version = "0.19.3" optional = true default-features = false +[dependencies.funty] +version = ">1.0, <=1.1" +optional = true +default-features = false + [dependencies.lazy_static] version = "^1.0" optional = true @@ -177,7 +182,7 @@ version = "^0.3" version = "0.9" [features] -alloc = ["bitvec/alloc"] +alloc = ["bitvec/alloc", "funty"] default = ["std", "bitvec", "lexical"] docsrs = [] lexical = ["lexical-core"] diff --git a/third_party/cargo/vendor/nom-6.0.1/LICENSE b/third_party/cargo/vendor/nom-6.1.2/LICENSE similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/LICENSE rename to third_party/cargo/vendor/nom-6.1.2/LICENSE diff --git a/third_party/cargo/vendor/nom-6.0.1/README.md b/third_party/cargo/vendor/nom-6.1.2/README.md similarity index 99% rename from third_party/cargo/vendor/nom-6.0.1/README.md rename to third_party/cargo/vendor/nom-6.1.2/README.md index e6ae3d3..0770496 100644 --- a/third_party/cargo/vendor/nom-6.0.1/README.md +++ b/third_party/cargo/vendor/nom-6.1.2/README.md @@ -302,7 +302,8 @@ Here is a (non exhaustive) list of known projects using nom: [Version Numbers](https://github.com/fosskers/rs-versions), [Telcordia/Bellcore SR-4731 SOR OTDR files](https://github.com/JamesHarrison/otdrs), [MySQL binary log](https://github.com/PrivateRookie/boxercrab), -[URI](https://github.com/Skasselbard/nom-uri) +[URI](https://github.com/Skasselbard/nom-uri), +[Furigana](https://github.com/sachaarbonel/furigana.rs) Want to create a new parser using `nom`? A list of not yet implemented formats is available [here](https://github.com/Geal/nom/issues/14). diff --git a/third_party/cargo/vendor/nom-6.0.1/build.rs b/third_party/cargo/vendor/nom-6.1.2/build.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/build.rs rename to third_party/cargo/vendor/nom-6.1.2/build.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/doc/nom_recipes.md b/third_party/cargo/vendor/nom-6.1.2/doc/nom_recipes.md similarity index 97% rename from third_party/cargo/vendor/nom-6.0.1/doc/nom_recipes.md rename to third_party/cargo/vendor/nom-6.1.2/doc/nom_recipes.md index 6a8ab6f..3507e88 100644 --- a/third_party/cargo/vendor/nom-6.0.1/doc/nom_recipes.md +++ b/third_party/cargo/vendor/nom-6.1.2/doc/nom_recipes.md @@ -5,10 +5,10 @@ These are short recipes for accomplishing common tasks with nom. * [Whitespace](#whitespace) + [Wrapper combinators that eat whitespace before and after a parser](#wrapper-combinators-that-eat-whitespace-before-and-after-a-parser) * [Comments](#comments) - + [`// C++/EOL-style comments`](#----c---eol-style-comments-) - + [`/* C-style comments */`](#----c-style-comments----) + + [`// C++/EOL-style comments`](#-ceol-style-comments) + + [`/* C-style comments */`](#-c-style-comments-) * [Identifiers](#identifiers) - + [`Rust-Style Identifiers`](#-rust-style-identifiers-) + + [`Rust-Style Identifiers`](#rust-style-identifiers) * [Literal Values](#literal-values) + [Escaped Strings](#escaped-strings) + [Integers](#integers) diff --git a/third_party/cargo/vendor/nom-6.0.1/src/bits/complete.rs b/third_party/cargo/vendor/nom-6.1.2/src/bits/complete.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/bits/complete.rs rename to third_party/cargo/vendor/nom-6.1.2/src/bits/complete.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/bits/macros.rs b/third_party/cargo/vendor/nom-6.1.2/src/bits/macros.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/bits/macros.rs rename to third_party/cargo/vendor/nom-6.1.2/src/bits/macros.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/bits/mod.rs b/third_party/cargo/vendor/nom-6.1.2/src/bits/mod.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/bits/mod.rs rename to third_party/cargo/vendor/nom-6.1.2/src/bits/mod.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/bits/streaming.rs b/third_party/cargo/vendor/nom-6.1.2/src/bits/streaming.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/bits/streaming.rs rename to third_party/cargo/vendor/nom-6.1.2/src/bits/streaming.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/branch/macros.rs b/third_party/cargo/vendor/nom-6.1.2/src/branch/macros.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/branch/macros.rs rename to third_party/cargo/vendor/nom-6.1.2/src/branch/macros.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/branch/mod.rs b/third_party/cargo/vendor/nom-6.1.2/src/branch/mod.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/branch/mod.rs rename to third_party/cargo/vendor/nom-6.1.2/src/branch/mod.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/bytes/complete.rs b/third_party/cargo/vendor/nom-6.1.2/src/bytes/complete.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/bytes/complete.rs rename to third_party/cargo/vendor/nom-6.1.2/src/bytes/complete.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/bytes/macros.rs b/third_party/cargo/vendor/nom-6.1.2/src/bytes/macros.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/bytes/macros.rs rename to third_party/cargo/vendor/nom-6.1.2/src/bytes/macros.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/bytes/mod.rs b/third_party/cargo/vendor/nom-6.1.2/src/bytes/mod.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/bytes/mod.rs rename to third_party/cargo/vendor/nom-6.1.2/src/bytes/mod.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/bytes/streaming.rs b/third_party/cargo/vendor/nom-6.1.2/src/bytes/streaming.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/bytes/streaming.rs rename to third_party/cargo/vendor/nom-6.1.2/src/bytes/streaming.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/character/complete.rs b/third_party/cargo/vendor/nom-6.1.2/src/character/complete.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/character/complete.rs rename to third_party/cargo/vendor/nom-6.1.2/src/character/complete.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/character/macros.rs b/third_party/cargo/vendor/nom-6.1.2/src/character/macros.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/character/macros.rs rename to third_party/cargo/vendor/nom-6.1.2/src/character/macros.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/character/mod.rs b/third_party/cargo/vendor/nom-6.1.2/src/character/mod.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/character/mod.rs rename to third_party/cargo/vendor/nom-6.1.2/src/character/mod.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/character/streaming.rs b/third_party/cargo/vendor/nom-6.1.2/src/character/streaming.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/character/streaming.rs rename to third_party/cargo/vendor/nom-6.1.2/src/character/streaming.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/combinator/macros.rs b/third_party/cargo/vendor/nom-6.1.2/src/combinator/macros.rs similarity index 99% rename from third_party/cargo/vendor/nom-6.0.1/src/combinator/macros.rs rename to third_party/cargo/vendor/nom-6.1.2/src/combinator/macros.rs index 59bef06..11ece16 100644 --- a/third_party/cargo/vendor/nom-6.0.1/src/combinator/macros.rs +++ b/third_party/cargo/vendor/nom-6.1.2/src/combinator/macros.rs @@ -926,7 +926,8 @@ macro_rules! eof ( use $crate::InputLength; if ($i).input_len() == 0 { - Ok(($i, $i)) + let clone = $i.clone(); + Ok(($i, clone)) } else { Err(Err::Error(error_position!($i, ErrorKind::Eof))) } diff --git a/third_party/cargo/vendor/nom-6.0.1/src/combinator/mod.rs b/third_party/cargo/vendor/nom-6.1.2/src/combinator/mod.rs similarity index 99% rename from third_party/cargo/vendor/nom-6.0.1/src/combinator/mod.rs rename to third_party/cargo/vendor/nom-6.1.2/src/combinator/mod.rs index f948dcc..96799ce 100644 --- a/third_party/cargo/vendor/nom-6.0.1/src/combinator/mod.rs +++ b/third_party/cargo/vendor/nom-6.1.2/src/combinator/mod.rs @@ -411,9 +411,10 @@ where /// assert_eq!(parser(""), Ok(("", ""))); /// # } /// ``` -pub fn eof>(input: I) -> IResult { +pub fn eof>(input: I) -> IResult { if input.input_len() == 0 { - Ok((input, input)) + let clone = input.clone(); + Ok((input, clone)) } else { Err(Err::Error(E::from_error_kind(input, ErrorKind::Eof))) } diff --git a/third_party/cargo/vendor/nom-6.0.1/src/error.rs b/third_party/cargo/vendor/nom-6.1.2/src/error.rs similarity index 99% rename from third_party/cargo/vendor/nom-6.0.1/src/error.rs rename to third_party/cargo/vendor/nom-6.1.2/src/error.rs index 5a65368..a5aa678 100644 --- a/third_party/cargo/vendor/nom-6.0.1/src/error.rs +++ b/third_party/cargo/vendor/nom-6.1.2/src/error.rs @@ -222,6 +222,9 @@ impl fmt::Display for VerboseError { } } +#[cfg(feature = "std")] +impl std::error::Error for VerboseError {} + use crate::internal::{Err, IResult}; /// Create a new error from an input position, a static string and an existing error. diff --git a/third_party/cargo/vendor/nom-6.0.1/src/internal.rs b/third_party/cargo/vendor/nom-6.1.2/src/internal.rs similarity index 98% rename from third_party/cargo/vendor/nom-6.0.1/src/internal.rs rename to third_party/cargo/vendor/nom-6.1.2/src/internal.rs index 47382ee..1335829 100644 --- a/third_party/cargo/vendor/nom-6.0.1/src/internal.rs +++ b/third_party/cargo/vendor/nom-6.1.2/src/internal.rs @@ -288,6 +288,16 @@ where } } +#[cfg(feature = "alloc")] +use alloc::boxed::Box; + +#[cfg(feature = "alloc")] +impl<'a, I, O, E> Parser for Box + 'a> { + fn parse(&mut self, input: I) -> IResult { + (**self).parse(input) + } +} + /// Implementation of `Parser:::map` #[allow(missing_doc_code_examples)] pub struct Map { diff --git a/third_party/cargo/vendor/nom-6.0.1/src/lib.rs b/third_party/cargo/vendor/nom-6.1.2/src/lib.rs similarity index 99% rename from third_party/cargo/vendor/nom-6.0.1/src/lib.rs rename to third_party/cargo/vendor/nom-6.1.2/src/lib.rs index c97dc5e..f668145 100644 --- a/third_party/cargo/vendor/nom-6.0.1/src/lib.rs +++ b/third_party/cargo/vendor/nom-6.1.2/src/lib.rs @@ -408,7 +408,7 @@ #![deny(missing_docs)] #![warn(missing_doc_code_examples)] -#[cfg(all(not(feature = "std"), feature = "alloc"))] +#[cfg(feature = "alloc")] #[macro_use] extern crate alloc; #[cfg(feature = "bitvec")] diff --git a/third_party/cargo/vendor/nom-6.0.1/src/multi/macros.rs b/third_party/cargo/vendor/nom-6.1.2/src/multi/macros.rs similarity index 99% rename from third_party/cargo/vendor/nom-6.0.1/src/multi/macros.rs rename to third_party/cargo/vendor/nom-6.1.2/src/multi/macros.rs index 7599ba6..c03de3a 100644 --- a/third_party/cargo/vendor/nom-6.0.1/src/multi/macros.rs +++ b/third_party/cargo/vendor/nom-6.1.2/src/multi/macros.rs @@ -519,7 +519,7 @@ macro_rules! fold_many1( /// let b = b"abcdabcdefgh"; /// let c = b"abcdabcdabcdabcdabcdefgh"; /// -/// assert_eq!(multi(&a[..]), Err(Err::Error(error_position!(&a[..], ErrorKind::ManyMN)))); +/// assert_eq!(multi(&a[..]), Err(Err::Error(error_position!(&b"efgh"[..], ErrorKind::Tag)))); /// let res = vec![&b"abcd"[..], &b"abcd"[..]]; /// assert_eq!(multi(&b[..]),Ok((&b"efgh"[..], res))); /// let res2 = vec![&b"abcd"[..], &b"abcd"[..], &b"abcd"[..], &b"abcd"[..]]; @@ -958,7 +958,7 @@ mod tests { fn fold_into_vec(mut acc: Vec, item: T) -> Vec { acc.push(item); acc - }; + } named!(tag_abcd, tag!("abcd")); named!(tag_empty, tag!("")); named!( multi<&[u8],Vec<&[u8]> >, fold_many0!(tag_abcd, Vec::new(), fold_into_vec) ); @@ -988,7 +988,7 @@ mod tests { fn fold_into_vec(mut acc: Vec, item: T) -> Vec { acc.push(item); acc - }; + } named!(multi<&[u8],Vec<&[u8]> >, fold_many1!(tag!("abcd"), Vec::new(), fold_into_vec)); let a = &b"abcdef"[..]; @@ -1013,7 +1013,7 @@ mod tests { fn fold_into_vec(mut acc: Vec, item: T) -> Vec { acc.push(item); acc - }; + } named!(multi<&[u8],Vec<&[u8]> >, fold_many_m_n!(2, 4, tag!("Abcd"), Vec::new(), fold_into_vec)); let a = &b"Abcdef"[..]; @@ -1024,7 +1024,7 @@ mod tests { assert_eq!( multi(a), - Err(Err::Error(error_position!(a, ErrorKind::ManyMN))) + Err(Err::Error(error_position!(&b"ef"[..], ErrorKind::Tag))) ); let res1 = vec![&b"Abcd"[..], &b"Abcd"[..]]; assert_eq!(multi(b), Ok((&b"efgh"[..], res1))); diff --git a/third_party/cargo/vendor/nom-6.0.1/src/multi/mod.rs b/third_party/cargo/vendor/nom-6.1.2/src/multi/mod.rs similarity index 96% rename from third_party/cargo/vendor/nom-6.0.1/src/multi/mod.rs rename to third_party/cargo/vendor/nom-6.1.2/src/multi/mod.rs index 32b7d9a..1ecd1e7 100644 --- a/third_party/cargo/vendor/nom-6.0.1/src/multi/mod.rs +++ b/third_party/cargo/vendor/nom-6.1.2/src/multi/mod.rs @@ -140,7 +140,7 @@ where #[cfg_attr(feature = "docsrs", doc(cfg(feature = "alloc")))] pub fn many1c(input: I, f: F) -> IResult, E> where - I: Clone + Copy + PartialEq, + I: Clone + PartialEq, F: Fn(I) -> IResult, E: ParseError, { @@ -407,40 +407,32 @@ where /// ``` #[cfg(feature = "alloc")] #[cfg_attr(feature = "docsrs", doc(cfg(feature = "alloc")))] -pub fn many_m_n(m: usize, n: usize, mut f: F) -> impl FnMut(I) -> IResult, E> +pub fn many_m_n( + min: usize, + max: usize, + mut parse: F, +) -> impl FnMut(I) -> IResult, E> where I: Clone + PartialEq, F: Parser, E: ParseError, { - move |i: I| { - let mut res = crate::lib::std::vec::Vec::with_capacity(m); - let mut input = i.clone(); - let mut count: usize = 0; + move |mut input: I| { + let mut res = crate::lib::std::vec::Vec::with_capacity(min); - if n == 0 { - return Ok((i, vec![])); - } - - loop { - let _i = input.clone(); - match f.parse(_i) { - Ok((i, o)) => { + for count in 0..max { + match parse.parse(input.clone()) { + Ok((tail, value)) => { // do not allow parsers that do not consume input (causes infinite loops) - if i == input { + if tail == input { return Err(Err::Error(E::from_error_kind(input, ErrorKind::ManyMN))); } - res.push(o); - input = i; - count += 1; - - if count == n { - return Ok((input, res)); - } + res.push(value); + input = tail; } Err(Err::Error(e)) => { - if count < m { + if count < min { return Err(Err::Error(E::append(input, ErrorKind::ManyMN, e))); } else { return Ok((input, res)); @@ -451,6 +443,8 @@ where } } } + + Ok((input, res)) } } @@ -903,11 +897,11 @@ where /// assert_eq!(parser("abcabcabc"), Ok(("abc", vec!["abc", "abc"]))); /// ``` pub fn fold_many_m_n( - m: usize, - n: usize, - mut f: F, + min: usize, + max: usize, + mut parse: F, init: R, - g: G, + fold: G, ) -> impl FnMut(I) -> IResult where I: Clone + PartialEq, @@ -916,25 +910,23 @@ where E: ParseError, R: Clone, { - move |i: I| { + move |mut input: I| { let mut acc = init.clone(); - let mut input = i.clone(); - for count in 0..n { - let _input = input.clone(); - match f.parse(_input) { - Ok((i, o)) => { + for count in 0..max { + match parse.parse(input.clone()) { + Ok((tail, value)) => { // do not allow parsers that do not consume input (causes infinite loops) - if i == input { - return Err(Err::Error(E::from_error_kind(i, ErrorKind::ManyMN))); + if tail == input { + return Err(Err::Error(E::from_error_kind(tail, ErrorKind::ManyMN))); } - acc = g(acc, o); - input = i; + acc = fold(acc, value); + input = tail; } //FInputXMError: handle failure properly - Err(Err::Error(_)) => { - if count < m { - return Err(Err::Error(E::from_error_kind(i, ErrorKind::ManyMN))); + Err(Err::Error(err)) => { + if count < min { + return Err(Err::Error(E::append(input, ErrorKind::ManyMN, err))); } else { break; } @@ -949,12 +941,12 @@ where #[doc(hidden)] pub fn fold_many_m_nc( - i: I, - m: usize, - n: usize, - f: F, + input: I, + min: usize, + max: usize, + parse: F, init: R, - g: G, + fold: G, ) -> IResult where I: Clone + PartialEq, @@ -963,7 +955,7 @@ where E: ParseError, R: Clone, { - fold_many_m_n(m, n, f, init, g)(i) + fold_many_m_n(min, max, parse, init, fold)(input) } /// Gets a number from the parser and returns a diff --git a/third_party/cargo/vendor/nom-6.0.1/src/number/complete.rs b/third_party/cargo/vendor/nom-6.1.2/src/number/complete.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/number/complete.rs rename to third_party/cargo/vendor/nom-6.1.2/src/number/complete.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/number/macros.rs b/third_party/cargo/vendor/nom-6.1.2/src/number/macros.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/number/macros.rs rename to third_party/cargo/vendor/nom-6.1.2/src/number/macros.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/number/mod.rs b/third_party/cargo/vendor/nom-6.1.2/src/number/mod.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/number/mod.rs rename to third_party/cargo/vendor/nom-6.1.2/src/number/mod.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/number/streaming.rs b/third_party/cargo/vendor/nom-6.1.2/src/number/streaming.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/number/streaming.rs rename to third_party/cargo/vendor/nom-6.1.2/src/number/streaming.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/regexp/macros.rs b/third_party/cargo/vendor/nom-6.1.2/src/regexp/macros.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/regexp/macros.rs rename to third_party/cargo/vendor/nom-6.1.2/src/regexp/macros.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/regexp/mod.rs b/third_party/cargo/vendor/nom-6.1.2/src/regexp/mod.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/regexp/mod.rs rename to third_party/cargo/vendor/nom-6.1.2/src/regexp/mod.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/sequence/macros.rs b/third_party/cargo/vendor/nom-6.1.2/src/sequence/macros.rs similarity index 99% rename from third_party/cargo/vendor/nom-6.0.1/src/sequence/macros.rs rename to third_party/cargo/vendor/nom-6.1.2/src/sequence/macros.rs index 75ec21c..a98aeb0 100644 --- a/third_party/cargo/vendor/nom-6.0.1/src/sequence/macros.rs +++ b/third_party/cargo/vendor/nom-6.1.2/src/sequence/macros.rs @@ -833,10 +833,10 @@ mod tests { fn do_parse() { fn ret_int1(i: &[u8]) -> IResult<&[u8], u8> { Ok((i, 1)) - }; + } fn ret_int2(i: &[u8]) -> IResult<&[u8], u8> { Ok((i, 2)) - }; + } //trace_macros!(true); named!(do_parser<&[u8], (u8, u8)>, diff --git a/third_party/cargo/vendor/nom-6.0.1/src/sequence/mod.rs b/third_party/cargo/vendor/nom-6.1.2/src/sequence/mod.rs similarity index 93% rename from third_party/cargo/vendor/nom-6.0.1/src/sequence/mod.rs rename to third_party/cargo/vendor/nom-6.1.2/src/sequence/mod.rs index 4df7ae7..3d76725 100644 --- a/third_party/cargo/vendor/nom-6.0.1/src/sequence/mod.rs +++ b/third_party/cargo/vendor/nom-6.1.2/src/sequence/mod.rs @@ -201,31 +201,31 @@ where separated_pair(first, sep, second)(input) } -/// Matches an object from the first parser, -/// then gets an object from the sep_parser, -/// then matches another object from the second parser. +/// Matches an object from the first parser and discards it, +/// then gets an object from the second parser, +/// and finally matches an object from the third parser and discards it. /// /// # Arguments -/// * `first` The first parser to apply. -/// * `sep` The separator parser to apply. +/// * `first` The first parser to apply and discard. /// * `second` The second parser to apply. +/// * `third` The third parser to apply and discard. /// ```rust /// # use nom::{Err, error::ErrorKind, Needed}; /// # use nom::Needed::Size; /// use nom::sequence::delimited; /// use nom::bytes::complete::tag; /// -/// let mut parser = delimited(tag("abc"), tag("|"), tag("efg")); +/// let mut parser = delimited(tag("("), tag("abc"), tag(")")); /// -/// assert_eq!(parser("abc|efg"), Ok(("", "|"))); -/// assert_eq!(parser("abc|efghij"), Ok(("hij", "|"))); +/// assert_eq!(parser("(abc)"), Ok(("", "abc"))); +/// assert_eq!(parser("(abc)def"), Ok(("def", "abc"))); /// assert_eq!(parser(""), Err(Err::Error(("", ErrorKind::Tag)))); /// assert_eq!(parser("123"), Err(Err::Error(("123", ErrorKind::Tag)))); /// ``` pub fn delimited, F, G, H>( mut first: F, - mut sep: G, - mut second: H, + mut second: G, + mut third: H, ) -> impl FnMut(I) -> IResult where F: Parser, @@ -234,8 +234,8 @@ where { move |input: I| { let (input, _) = first.parse(input)?; - let (input, o2) = sep.parse(input)?; - second.parse(input).map(|(i, _)| (i, o2)) + let (input, o2) = second.parse(input)?; + third.parse(input).map(|(i, _)| (i, o2)) } } @@ -244,15 +244,15 @@ where pub fn delimitedc, F, G, H>( input: I, first: F, - sep: G, - second: H, + second: G, + third: H, ) -> IResult where F: Fn(I) -> IResult, G: Fn(I) -> IResult, H: Fn(I) -> IResult, { - delimited(first, sep, second)(input) + delimited(first, second, third)(input) } /// Helper trait for the tuple combinator. diff --git a/third_party/cargo/vendor/nom-6.0.1/src/str.rs b/third_party/cargo/vendor/nom-6.1.2/src/str.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/str.rs rename to third_party/cargo/vendor/nom-6.1.2/src/str.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/traits.rs b/third_party/cargo/vendor/nom-6.1.2/src/traits.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/traits.rs rename to third_party/cargo/vendor/nom-6.1.2/src/traits.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/src/util.rs b/third_party/cargo/vendor/nom-6.1.2/src/util.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/src/util.rs rename to third_party/cargo/vendor/nom-6.1.2/src/util.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/arithmetic.rs b/third_party/cargo/vendor/nom-6.1.2/tests/arithmetic.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/arithmetic.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/arithmetic.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/arithmetic_ast.rs b/third_party/cargo/vendor/nom-6.1.2/tests/arithmetic_ast.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/arithmetic_ast.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/arithmetic_ast.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/bitstream.rs b/third_party/cargo/vendor/nom-6.1.2/tests/bitstream.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/bitstream.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/bitstream.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/blockbuf-arithmetic.rs b/third_party/cargo/vendor/nom-6.1.2/tests/blockbuf-arithmetic.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/blockbuf-arithmetic.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/blockbuf-arithmetic.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/css.rs b/third_party/cargo/vendor/nom-6.1.2/tests/css.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/css.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/css.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/custom_errors.rs b/third_party/cargo/vendor/nom-6.1.2/tests/custom_errors.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/custom_errors.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/custom_errors.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/escaped.rs b/third_party/cargo/vendor/nom-6.1.2/tests/escaped.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/escaped.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/escaped.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/float.rs b/third_party/cargo/vendor/nom-6.1.2/tests/float.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/float.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/float.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/fnmut.rs b/third_party/cargo/vendor/nom-6.1.2/tests/fnmut.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/fnmut.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/fnmut.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/inference.rs b/third_party/cargo/vendor/nom-6.1.2/tests/inference.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/inference.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/inference.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/ini.rs b/third_party/cargo/vendor/nom-6.1.2/tests/ini.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/ini.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/ini.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/ini_str.rs b/third_party/cargo/vendor/nom-6.1.2/tests/ini_str.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/ini_str.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/ini_str.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/issues.rs b/third_party/cargo/vendor/nom-6.1.2/tests/issues.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/issues.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/issues.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/json.rs b/third_party/cargo/vendor/nom-6.1.2/tests/json.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/json.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/json.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/mp4.rs b/third_party/cargo/vendor/nom-6.1.2/tests/mp4.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/mp4.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/mp4.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/multiline.rs b/third_party/cargo/vendor/nom-6.1.2/tests/multiline.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/multiline.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/multiline.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/named_args.rs b/third_party/cargo/vendor/nom-6.1.2/tests/named_args.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/named_args.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/named_args.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/overflow.rs b/third_party/cargo/vendor/nom-6.1.2/tests/overflow.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/overflow.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/overflow.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/reborrow_fold.rs b/third_party/cargo/vendor/nom-6.1.2/tests/reborrow_fold.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/reborrow_fold.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/reborrow_fold.rs diff --git a/third_party/cargo/vendor/nom-6.0.1/tests/test1.rs b/third_party/cargo/vendor/nom-6.1.2/tests/test1.rs similarity index 100% rename from third_party/cargo/vendor/nom-6.0.1/tests/test1.rs rename to third_party/cargo/vendor/nom-6.1.2/tests/test1.rs diff --git a/third_party/cargo/vendor/num_cpus-1.13.0/BUILD.bazel b/third_party/cargo/vendor/num_cpus-1.13.0/BUILD.bazel index 690359a..c1c4077 100644 --- a/third_party/cargo/vendor/num_cpus-1.13.0/BUILD.bazel +++ b/third_party/cargo/vendor/num_cpus-1.13.0/BUILD.bazel @@ -51,6 +51,6 @@ rust_library( version = "1.13.0", # buildifier: leave-alone deps = [ - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ], ) diff --git a/third_party/cargo/vendor/num_enum-0.4.3/BUILD.bazel b/third_party/cargo/vendor/num_enum-0.4.3/BUILD.bazel index 7913765..1c8ab55 100644 --- a/third_party/cargo/vendor/num_enum-0.4.3/BUILD.bazel +++ b/third_party/cargo/vendor/num_enum-0.4.3/BUILD.bazel @@ -42,7 +42,7 @@ rust_library( data = [], edition = "2018", proc_macro_deps = [ - "//third_party/cargo/vendor/derivative-2.1.3:derivative", + "//third_party/cargo/vendor/derivative-2.2.0:derivative", "//third_party/cargo/vendor/num_enum_derive-0.4.3:num_enum_derive", ], rustc_flags = [ diff --git a/third_party/cargo/vendor/num_enum_derive-0.4.3/BUILD.bazel b/third_party/cargo/vendor/num_enum_derive-0.4.3/BUILD.bazel index 2f5a000..4f1eb76 100644 --- a/third_party/cargo/vendor/num_enum_derive-0.4.3/BUILD.bazel +++ b/third_party/cargo/vendor/num_enum_derive-0.4.3/BUILD.bazel @@ -51,8 +51,8 @@ rust_library( # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/proc-macro-crate-0.1.5:proc_macro_crate", - "//third_party/cargo/vendor/proc-macro2-1.0.24:proc_macro2", - "//third_party/cargo/vendor/quote-1.0.8:quote", - "//third_party/cargo/vendor/syn-1.0.58:syn", + "//third_party/cargo/vendor/proc-macro2-1.0.26:proc_macro2", + "//third_party/cargo/vendor/quote-1.0.9:quote", + "//third_party/cargo/vendor/syn-1.0.68:syn", ], ) diff --git a/third_party/cargo/vendor/once_cell-1.5.2/.cargo-checksum.json b/third_party/cargo/vendor/once_cell-1.5.2/.cargo-checksum.json deleted file mode 100644 index a5ba306..0000000 --- a/third_party/cargo/vendor/once_cell-1.5.2/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"CHANGELOG.md":"822a0cbdf9bd857ef63fb775bbb887f685a84719fd866b5349786212b324a053","Cargo.lock":"4181aa848515ee1483b556fdd78b6d59fc025f671d46b18859880ddfa6248412","Cargo.toml":"fc4ae79cd01ea51cbe7a29a78f53b689b389f89feec10cf9383930fd05768ffd","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"d7203c0e18700de8e1408c3f4bb96075df271fea9ab678f6ad2e09855aefa7ed","bors.toml":"ebd69f714a49dceb8fd10ebadfea6e2767be4732fdef49eddf6239151b4bc78c","examples/bench.rs":"1597a52529f75d6c5ad0b86759a775b1d723dfa810e2016317283b13594219da","examples/bench_acquire.rs":"9f4912ca262194cb55e893c33739c85c2f4868d07905b9dd3238552b6ce8a6e4","examples/bench_vs_lazy_static.rs":"d527294a2e73b53ac5faed8b316dfd1ae2a06adb31384134af21f10ce76333a5","examples/lazy_static.rs":"90541b093ed1d1cbb73f4097ff02cf80657e28264d281d6a31d96a708fdfea90","examples/reentrant_init_deadlocks.rs":"ff84929de27a848e5b155549caa96db5db5f030afca975f8ba3f3da640083001","examples/regex.rs":"4a2e0fb093c7f5bbe0fff8689fc0c670c5334344a1bfda376f5faa98a05d459f","examples/test_synchronization.rs":"88abd5c16275bb2f2d77eaecf369d97681404a77b8edd0021f24bfd377c46be3","src/imp_pl.rs":"3b38a5ab0e2b9321b860bd45ccda45d804a5d7cd967b0b1b0c24f93b69eaebb9","src/imp_std.rs":"48121b9079e7289f0749f6e6612553ad587f246f72cd69ad2f1b7c6762bdffa6","src/lib.rs":"2abf26aa938010d546c93cffa9bb31ec1ed9e7522a420e1e144933abc636e081","src/race.rs":"e9110c6673e7ccaee86803e023dd149b74843e372288ef6804e927495a09d597","tests/it.rs":"e701bafda21026c9ea0c3668f9d74debae288b1a576ab3c70c356056efb3f8f9"},"package":"13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0"} \ No newline at end of file diff --git a/third_party/cargo/vendor/once_cell-1.7.2/.cargo-checksum.json b/third_party/cargo/vendor/once_cell-1.7.2/.cargo-checksum.json new file mode 100644 index 0000000..936194d --- /dev/null +++ b/third_party/cargo/vendor/once_cell-1.7.2/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"007575511b35e14e9ebea4bf696ba331cd08d1cd2412ed43e74174ef4760133a","Cargo.lock":"383c174522aea65ff384ad388eff015380ef09581ef0785e9f0dcf8a9c0cc198","Cargo.toml":"20952c4f41d83412eccc2b3866e42e11e33331789bbc3939f4d7ef427e1f6781","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"7e93eec9a4c6c38db0eb3851c1e868c55e64ff2bacc86380d601a2ee08a11589","bors.toml":"ebd69f714a49dceb8fd10ebadfea6e2767be4732fdef49eddf6239151b4bc78c","examples/bench.rs":"1597a52529f75d6c5ad0b86759a775b1d723dfa810e2016317283b13594219da","examples/bench_acquire.rs":"9f4912ca262194cb55e893c33739c85c2f4868d07905b9dd3238552b6ce8a6e4","examples/bench_vs_lazy_static.rs":"d527294a2e73b53ac5faed8b316dfd1ae2a06adb31384134af21f10ce76333a5","examples/lazy_static.rs":"90541b093ed1d1cbb73f4097ff02cf80657e28264d281d6a31d96a708fdfea90","examples/reentrant_init_deadlocks.rs":"ff84929de27a848e5b155549caa96db5db5f030afca975f8ba3f3da640083001","examples/regex.rs":"4a2e0fb093c7f5bbe0fff8689fc0c670c5334344a1bfda376f5faa98a05d459f","examples/test_synchronization.rs":"88abd5c16275bb2f2d77eaecf369d97681404a77b8edd0021f24bfd377c46be3","src/imp_pl.rs":"cac67286119fcfa2b69ffb9ada51d5cb57c89e95a533d95d5d40b0ae4d38a6c2","src/imp_std.rs":"7a9b58444f71ca3025655f060dabc0f33a775d3b27916e9c22fe4182b286265d","src/lib.rs":"708696d9b70d2dd1ea57c6990c806bd53f13f5d1a5727254ca7620caabd77df5","src/race.rs":"b90a00d833919de2e1b03dee7b1b5c2fbfe246357c50b03643097860a95636e5","tests/it.rs":"ed9ff44665f29fa138055800d7199405740bce912f9c568c11aa2ff2249c17f8"},"package":"af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3"} \ No newline at end of file diff --git a/third_party/cargo/vendor/once_cell-1.5.2/BUILD.bazel b/third_party/cargo/vendor/once_cell-1.7.2/BUILD.bazel similarity index 97% rename from third_party/cargo/vendor/once_cell-1.5.2/BUILD.bazel rename to third_party/cargo/vendor/once_cell-1.7.2/BUILD.bazel index cd69bcd..45d6c58 100644 --- a/third_party/cargo/vendor/once_cell-1.5.2/BUILD.bazel +++ b/third_party/cargo/vendor/once_cell-1.7.2/BUILD.bazel @@ -50,6 +50,7 @@ rust_library( crate_features = [ "alloc", "default", + "race", "std", ], crate_root = "src/lib.rs", @@ -63,7 +64,7 @@ rust_library( "cargo-raze", "manual", ], - version = "1.5.2", + version = "1.7.2", # buildifier: leave-alone deps = [ ], diff --git a/third_party/cargo/vendor/once_cell-1.5.2/CHANGELOG.md b/third_party/cargo/vendor/once_cell-1.7.2/CHANGELOG.md similarity index 81% rename from third_party/cargo/vendor/once_cell-1.5.2/CHANGELOG.md rename to third_party/cargo/vendor/once_cell-1.7.2/CHANGELOG.md index 88a4944..53fdf64 100644 --- a/third_party/cargo/vendor/once_cell-1.5.2/CHANGELOG.md +++ b/third_party/cargo/vendor/once_cell-1.7.2/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## 1.7.2 + +- Improve code size when using parking_lot feature. + +## 1.7.1 + +- Fix `race::OnceBox` 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`. diff --git a/third_party/cargo/vendor/once_cell-1.5.2/Cargo.lock b/third_party/cargo/vendor/once_cell-1.7.2/Cargo.lock similarity index 74% rename from third_party/cargo/vendor/once_cell-1.5.2/Cargo.lock rename to third_party/cargo/vendor/once_cell-1.7.2/Cargo.lock index 0fa2d59..c84a2ec 100644 --- a/third_party/cargo/vendor/once_cell-1.5.2/Cargo.lock +++ b/third_party/cargo/vendor/once_cell-1.7.2/Cargo.lock @@ -20,7 +20,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cfg-if" -version = "0.1.10" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -28,27 +28,19 @@ name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "cloudabi" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "crossbeam-utils" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "instant" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -61,12 +53,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.80" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "lock_api" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -79,42 +71,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "once_cell" -version = "1.5.2" +version = "1.7.2" dependencies = [ "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "parking_lot" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "instant 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "lock_api 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot_core 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "instant 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "lock_api 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "parking_lot_core" -version = "0.8.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "cloudabi 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "instant 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "instant 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.87 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "redox_syscall" -version = "0.1.57" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "regex" @@ -143,7 +137,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "smallvec" -version = "1.4.2" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -187,22 +181,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum aho-corasick 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "36b7aa1ccb7d7ea3f437cf025a2ab1c47cc6c1bc9fc84918ff449def12f5e282" "checksum autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" -"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3" "checksum cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -"checksum cloudabi 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467" "checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" -"checksum instant 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "cb1fc4429a33e1f80d41dc9fea4d108a88bec1de8053878898ae448a0b52f613" +"checksum instant 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -"checksum libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614" -"checksum lock_api 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c" +"checksum libc 0.2.87 (registry+https://github.com/rust-lang/crates.io-index)" = "265d751d31d6780a3f956bb5b8022feba2d94eeee5a84ba64f4212eedca42213" +"checksum lock_api 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" -"checksum parking_lot 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733" -"checksum parking_lot_core 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" -"checksum redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)" = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" +"checksum parking_lot 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" +"checksum parking_lot_core 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" +"checksum redox_syscall 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" "checksum regex 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6b23da8dfd98a84bd7e08700190a5d9f7d2d38abd4369dd1dae651bc40bfd2cc" "checksum regex-syntax 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bfaca88e749e19dffb60f77b55e5d87a872fac7e9e48598f7cf93b2d8c047b0a" "checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -"checksum smallvec 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" +"checksum smallvec 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum ucd-util 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f3bf5cdf1df6b578c0947a94d4740bbb2b2afd1b898e33df1ff07b555a335e4" "checksum utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd70f467df6810094968e2fce0ee1bd0e87157aceb026a8c083bcf5e25b9efe4" diff --git a/third_party/cargo/vendor/once_cell-1.5.2/Cargo.toml b/third_party/cargo/vendor/once_cell-1.7.2/Cargo.toml similarity index 97% rename from third_party/cargo/vendor/once_cell-1.5.2/Cargo.toml rename to third_party/cargo/vendor/once_cell-1.7.2/Cargo.toml index 3ca8c9a..0d3797b 100644 --- a/third_party/cargo/vendor/once_cell-1.5.2/Cargo.toml +++ b/third_party/cargo/vendor/once_cell-1.7.2/Cargo.toml @@ -13,7 +13,7 @@ [package] edition = "2018" name = "once_cell" -version = "1.5.2" +version = "1.7.2" authors = ["Aleksey Kladov "] exclude = ["*.png", "*.svg", "/Cargo.lock.min", "/.travis.yml", "/run-miri-tests.sh", "rustfmt.toml"] description = "Single assignment cells and lazy values." @@ -67,7 +67,8 @@ version = "1.0.0" version = "1.2.0" [features] -alloc = [] +alloc = ["race"] default = ["std"] +race = [] std = ["alloc"] unstable = [] diff --git a/third_party/cargo/vendor/once_cell-1.5.2/LICENSE-APACHE b/third_party/cargo/vendor/once_cell-1.7.2/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/once_cell-1.5.2/LICENSE-APACHE rename to third_party/cargo/vendor/once_cell-1.7.2/LICENSE-APACHE diff --git a/third_party/cargo/vendor/hermit-abi-0.1.17/LICENSE-MIT b/third_party/cargo/vendor/once_cell-1.7.2/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/hermit-abi-0.1.17/LICENSE-MIT rename to third_party/cargo/vendor/once_cell-1.7.2/LICENSE-MIT diff --git a/third_party/cargo/vendor/once_cell-1.5.2/README.md b/third_party/cargo/vendor/once_cell-1.7.2/README.md similarity index 96% rename from third_party/cargo/vendor/once_cell-1.5.2/README.md rename to third_party/cargo/vendor/once_cell-1.7.2/README.md index e55c7d4..b5c9896 100644 --- a/third_party/cargo/vendor/once_cell-1.5.2/README.md +++ b/third_party/cargo/vendor/once_cell-1.7.2/README.md @@ -1,4 +1,4 @@ -

once_cell

+

once_cell

[![Build Status](https://travis-ci.org/matklad/once_cell.svg?branch=master)](https://travis-ci.org/matklad/once_cell) diff --git a/third_party/cargo/vendor/once_cell-1.5.2/bors.toml b/third_party/cargo/vendor/once_cell-1.7.2/bors.toml similarity index 100% rename from third_party/cargo/vendor/once_cell-1.5.2/bors.toml rename to third_party/cargo/vendor/once_cell-1.7.2/bors.toml diff --git a/third_party/cargo/vendor/once_cell-1.5.2/examples/bench.rs b/third_party/cargo/vendor/once_cell-1.7.2/examples/bench.rs similarity index 100% rename from third_party/cargo/vendor/once_cell-1.5.2/examples/bench.rs rename to third_party/cargo/vendor/once_cell-1.7.2/examples/bench.rs diff --git a/third_party/cargo/vendor/once_cell-1.5.2/examples/bench_acquire.rs b/third_party/cargo/vendor/once_cell-1.7.2/examples/bench_acquire.rs similarity index 100% rename from third_party/cargo/vendor/once_cell-1.5.2/examples/bench_acquire.rs rename to third_party/cargo/vendor/once_cell-1.7.2/examples/bench_acquire.rs diff --git a/third_party/cargo/vendor/once_cell-1.5.2/examples/bench_vs_lazy_static.rs b/third_party/cargo/vendor/once_cell-1.7.2/examples/bench_vs_lazy_static.rs similarity index 100% rename from third_party/cargo/vendor/once_cell-1.5.2/examples/bench_vs_lazy_static.rs rename to third_party/cargo/vendor/once_cell-1.7.2/examples/bench_vs_lazy_static.rs diff --git a/third_party/cargo/vendor/once_cell-1.5.2/examples/lazy_static.rs b/third_party/cargo/vendor/once_cell-1.7.2/examples/lazy_static.rs similarity index 100% rename from third_party/cargo/vendor/once_cell-1.5.2/examples/lazy_static.rs rename to third_party/cargo/vendor/once_cell-1.7.2/examples/lazy_static.rs diff --git a/third_party/cargo/vendor/once_cell-1.5.2/examples/reentrant_init_deadlocks.rs b/third_party/cargo/vendor/once_cell-1.7.2/examples/reentrant_init_deadlocks.rs similarity index 100% rename from third_party/cargo/vendor/once_cell-1.5.2/examples/reentrant_init_deadlocks.rs rename to third_party/cargo/vendor/once_cell-1.7.2/examples/reentrant_init_deadlocks.rs diff --git a/third_party/cargo/vendor/once_cell-1.5.2/examples/regex.rs b/third_party/cargo/vendor/once_cell-1.7.2/examples/regex.rs similarity index 100% rename from third_party/cargo/vendor/once_cell-1.5.2/examples/regex.rs rename to third_party/cargo/vendor/once_cell-1.7.2/examples/regex.rs diff --git a/third_party/cargo/vendor/once_cell-1.5.2/examples/test_synchronization.rs b/third_party/cargo/vendor/once_cell-1.7.2/examples/test_synchronization.rs similarity index 100% rename from third_party/cargo/vendor/once_cell-1.5.2/examples/test_synchronization.rs rename to third_party/cargo/vendor/once_cell-1.7.2/examples/test_synchronization.rs diff --git a/third_party/cargo/vendor/once_cell-1.5.2/src/imp_pl.rs b/third_party/cargo/vendor/once_cell-1.7.2/src/imp_pl.rs similarity index 75% rename from third_party/cargo/vendor/once_cell-1.5.2/src/imp_pl.rs rename to third_party/cargo/vendor/once_cell-1.7.2/src/imp_pl.rs index ed426b1..6c9b0fe 100644 --- a/third_party/cargo/vendor/once_cell-1.5.2/src/imp_pl.rs +++ b/third_party/cargo/vendor/once_cell-1.7.2/src/imp_pl.rs @@ -7,6 +7,8 @@ use std::{ use parking_lot::Mutex; +use crate::take_unchecked; + pub(crate) struct OnceCell { mutex: Mutex<()>, is_initialized: AtomicBool, @@ -46,8 +48,10 @@ impl OnceCell { where F: FnOnce() -> Result, { - let _guard = self.mutex.lock(); - if !self.is_initialized() { + let mut f = Some(f); + let mut res: Result<(), E> = Ok(()); + let slot: *mut Option = self.value.get(); + initialize_inner(&self.mutex, &self.is_initialized, &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 @@ -56,15 +60,22 @@ impl OnceCell { // 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 value = f()?; - // Safe b/c we have a unique access and no panic may happen - // until the cell is marked as initialized. - let slot: &mut Option = unsafe { &mut *self.value.get() }; - debug_assert!(slot.is_none()); - *slot = Some(value); - self.is_initialized.store(true, Ordering::Release); - } - Ok(()) + let f = unsafe { take_unchecked(&mut f) }; + 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 } /// Get the reference to the underlying value, without checking if the cell @@ -102,6 +113,18 @@ impl OnceCell { } } +// Note: this is intentionally monomorphic +#[inline(never)] +fn initialize_inner(mutex: &Mutex<()>, is_initialized: &AtomicBool, init: &mut dyn FnMut() -> bool) { + let _guard = mutex.lock(); + + if !is_initialized.load(Ordering::Acquire) { + if init() { + is_initialized.store(true, Ordering::Release); + } + } +} + #[test] fn test_size() { use std::mem::size_of; diff --git a/third_party/cargo/vendor/once_cell-1.5.2/src/imp_std.rs b/third_party/cargo/vendor/once_cell-1.7.2/src/imp_std.rs similarity index 95% rename from third_party/cargo/vendor/once_cell-1.5.2/src/imp_std.rs rename to third_party/cargo/vendor/once_cell-1.7.2/src/imp_std.rs index d7ccc85..d7dda96 100644 --- a/third_party/cargo/vendor/once_cell-1.5.2/src/imp_std.rs +++ b/third_party/cargo/vendor/once_cell-1.7.2/src/imp_std.rs @@ -12,6 +12,8 @@ use std::{ thread::{self, Thread}, }; +use crate::take_unchecked; + #[derive(Debug)] pub(crate) struct OnceCell { // This `state` word is actually an encoded version of just a pointer to a @@ -89,7 +91,7 @@ impl OnceCell { let mut res: Result<(), E> = Ok(()); let slot: *mut Option = self.value.get(); initialize_inner(&self.state_and_queue, &mut || { - let f = f.take().unwrap(); + let f = unsafe { take_unchecked(&mut f) }; match f() { Ok(value) => { unsafe { *slot = Some(value) }; @@ -144,6 +146,7 @@ impl OnceCell { // Corresponds to `std::sync::Once::call_inner` // Note: this is intentionally monomorphic +#[inline(never)] fn initialize_inner(my_state_and_queue: &AtomicUsize, init: &mut dyn FnMut() -> bool) -> bool { let mut state_and_queue = my_state_and_queue.load(Ordering::Acquire); @@ -151,12 +154,13 @@ fn initialize_inner(my_state_and_queue: &AtomicUsize, init: &mut dyn FnMut() -> match state_and_queue { COMPLETE => return true, INCOMPLETE => { - let old = my_state_and_queue.compare_and_swap( + let exchange = my_state_and_queue.compare_exchange( state_and_queue, RUNNING, Ordering::Acquire, + Ordering::Acquire, ); - if old != state_and_queue { + if let Err(old) = exchange { state_and_queue = old; continue; } @@ -193,8 +197,13 @@ fn wait(state_and_queue: &AtomicUsize, mut current_state: usize) { }; let me = &node as *const Waiter as usize; - let old = state_and_queue.compare_and_swap(current_state, me | RUNNING, Ordering::Release); - if old != current_state { + let exchange = state_and_queue.compare_exchange( + current_state, + me | RUNNING, + Ordering::Release, + Ordering::Relaxed, + ); + if let Err(old) = exchange { current_state = old; continue; } @@ -253,6 +262,7 @@ mod tests { } #[test] + #[cfg(not(miri))] fn stampede_once() { static O: OnceCell<()> = OnceCell::new(); static mut RUN: bool = false; diff --git a/third_party/cargo/vendor/once_cell-1.5.2/src/lib.rs b/third_party/cargo/vendor/once_cell-1.7.2/src/lib.rs similarity index 95% rename from third_party/cargo/vendor/once_cell-1.5.2/src/lib.rs rename to third_party/cargo/vendor/once_cell-1.7.2/src/lib.rs index 79df2b6..a455cb4 100644 --- a/third_party/cargo/vendor/once_cell-1.5.2/src/lib.rs +++ b/third_party/cargo/vendor/once_cell-1.7.2/src/lib.rs @@ -233,10 +233,11 @@ //! 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, which -//! is enabled by default. Performance is the same for both cases, but the `parking_lot` based `OnceCell` -//! is smaller by up to 16 bytes. +//! 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` is +//! smaller by up to 16 bytes. //! //! This crate uses `unsafe`. //! @@ -277,7 +278,6 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[cfg(feature = "unstable")] #[cfg(feature = "alloc")] extern crate alloc; @@ -599,6 +599,17 @@ pub mod unsync { pub const fn new(init: F) -> Lazy { 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) -> Result { + 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> Lazy { @@ -980,6 +991,17 @@ pub mod sync { pub const fn new(f: F) -> Lazy { 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) -> Result { + 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> Lazy { @@ -1043,5 +1065,16 @@ pub mod sync { fn _dummy() {} } -#[cfg(feature = "unstable")] +#[cfg(feature = "race")] pub mod race; + +#[cfg(feature = "std")] +unsafe fn take_unchecked(val: &mut Option) -> T { + match val.take() { + Some(it) => it, + None => { + debug_assert!(false); + std::hint::unreachable_unchecked() + } + } +} diff --git a/third_party/cargo/vendor/once_cell-1.5.2/src/race.rs b/third_party/cargo/vendor/once_cell-1.7.2/src/race.rs similarity index 86% rename from third_party/cargo/vendor/once_cell-1.5.2/src/race.rs rename to third_party/cargo/vendor/once_cell-1.7.2/src/race.rs index 6693da6..e0dc8fc 100644 --- a/third_party/cargo/vendor/once_cell-1.5.2/src/race.rs +++ b/third_party/cargo/vendor/once_cell-1.7.2/src/race.rs @@ -19,11 +19,13 @@ pub struct OnceNonZeroUsize { 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 { let val = self.inner.load(Ordering::Acquire); NonZeroUsize::new(val) @@ -33,12 +35,13 @@ impl OnceNonZeroUsize { /// /// Returns `Ok(())` if the cell was empty and `Err(())` if it was /// full. + #[inline] pub fn set(&self, value: NonZeroUsize) -> Result<(), ()> { - let val = self.inner.compare_and_swap(0, value.get(), Ordering::AcqRel); - if val == 0 { - Ok(()) - } else { - Err(()) + let exchange = + self.inner.compare_exchange(0, value.get(), Ordering::AcqRel, Ordering::Acquire); + match exchange { + Ok(_) => Ok(()), + Err(_) => Err(()), } } @@ -75,9 +78,10 @@ impl OnceNonZeroUsize { Some(it) => it, None => { let mut val = f()?.get(); - let old_val = self.inner.compare_and_swap(0, val, Ordering::AcqRel); - if old_val != 0 { - val = old_val; + let exchange = + self.inner.compare_exchange(0, val, Ordering::AcqRel, Ordering::Acquire); + if let Err(old) = exchange { + val = old; } unsafe { NonZeroUsize::new_unchecked(val) } } @@ -94,11 +98,13 @@ pub struct OnceBool { 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 { self.inner.get().map(OnceBool::from_usize) } @@ -107,6 +113,7 @@ impl OnceBool { /// /// 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)) } @@ -138,9 +145,11 @@ impl OnceBool { 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 }) } } @@ -148,22 +157,30 @@ impl OnceBool { #[cfg(feature = "alloc")] pub use self::once_box::OnceBox; + #[cfg(feature = "alloc")] mod once_box { - use alloc::boxed::Box; use core::{ marker::PhantomData, ptr, sync::atomic::{AtomicPtr, Ordering}, }; + use alloc::boxed::Box; + /// A thread-safe cell which can be written to only once. - #[derive(Default, Debug)] + #[derive(Debug)] pub struct OnceBox { inner: AtomicPtr, ghost: PhantomData>>, } + impl Default for OnceBox { + fn default() -> Self { + Self::new() + } + } + impl Drop for OnceBox { fn drop(&mut self) { let ptr = *self.inner.get_mut(); @@ -194,8 +211,13 @@ mod once_box { /// full. pub fn set(&self, value: Box) -> Result<(), Box> { let ptr = Box::into_raw(value); - let old_ptr = self.inner.compare_and_swap(ptr::null_mut(), ptr, Ordering::AcqRel); - if !old_ptr.is_null() { + let exchange = self.inner.compare_exchange( + ptr::null_mut(), + ptr, + Ordering::AcqRel, + Ordering::Acquire, + ); + if let Err(_) = exchange { let value = unsafe { Box::from_raw(ptr) }; return Err(value); } @@ -235,16 +257,23 @@ mod once_box { if ptr.is_null() { let val = f()?; ptr = Box::into_raw(val); - let old_ptr = self.inner.compare_and_swap(ptr::null_mut(), ptr, Ordering::AcqRel); - if !old_ptr.is_null() { + 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_ptr; + ptr = old; } }; Ok(unsafe { &*ptr }) } } + unsafe impl Sync for OnceBox {} + /// ```compile_fail /// struct S(*mut ()); /// unsafe impl Sync for S {} @@ -252,5 +281,5 @@ mod once_box { /// fn share(_: &T) {} /// share(&once_cell::race::OnceBox::::new()); /// ``` - unsafe impl Sync for OnceBox {} + fn _dummy() {} } diff --git a/third_party/cargo/vendor/once_cell-1.5.2/tests/it.rs b/third_party/cargo/vendor/once_cell-1.7.2/tests/it.rs similarity index 96% rename from third_party/cargo/vendor/once_cell-1.5.2/tests/it.rs rename to third_party/cargo/vendor/once_cell-1.7.2/tests/it.rs index 2a3a985..81faaff 100644 --- a/third_party/cargo/vendor/once_cell-1.5.2/tests/it.rs +++ b/third_party/cargo/vendor/once_cell-1.7.2/tests/it.rs @@ -155,6 +155,15 @@ mod unsync { assert_eq!(CALLED.load(SeqCst), 1); } + #[test] + fn lazy_into_value() { + let l: Lazy = 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() { @@ -467,6 +476,15 @@ mod sync { assert_eq!(xs(), &vec![1, 2, 3]); } + #[test] + fn lazy_into_value() { + let l: Lazy = 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 = Lazy::new(|| panic!("kaboom")); @@ -571,7 +589,7 @@ mod sync { } } -#[cfg(feature = "unstable")] +#[cfg(feature = "race")] mod race { use std::{ num::NonZeroUsize, @@ -707,7 +725,7 @@ mod race { } } -#[cfg(all(feature = "unstable", feature = "alloc"))] +#[cfg(all(feature = "race", feature = "alloc"))] mod race_once_box { use std::sync::{ atomic::{AtomicUsize, Ordering::SeqCst}, @@ -841,4 +859,12 @@ mod race_once_box { }); assert_eq!(res, "hello"); } + + #[test] + fn once_box_default() { + struct Foo; + + let cell: OnceBox = Default::default(); + assert!(cell.get().is_none()); + } } diff --git a/third_party/cargo/vendor/parking_lot-0.11.1/BUILD.bazel b/third_party/cargo/vendor/parking_lot-0.11.1/BUILD.bazel index d0dcdb3..9b1c59b 100644 --- a/third_party/cargo/vendor/parking_lot-0.11.1/BUILD.bazel +++ b/third_party/cargo/vendor/parking_lot-0.11.1/BUILD.bazel @@ -52,8 +52,8 @@ rust_library( # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/instant-0.1.9:instant", - "//third_party/cargo/vendor/lock_api-0.4.2:lock_api", - "//third_party/cargo/vendor/parking_lot_core-0.8.2:parking_lot_core", + "//third_party/cargo/vendor/lock_api-0.4.3:lock_api", + "//third_party/cargo/vendor/parking_lot_core-0.8.3:parking_lot_core", ], ) diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/.cargo-checksum.json b/third_party/cargo/vendor/parking_lot_core-0.8.3/.cargo-checksum.json similarity index 86% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/.cargo-checksum.json rename to third_party/cargo/vendor/parking_lot_core-0.8.3/.cargo-checksum.json index 85ed91a..0398359 100644 --- a/third_party/cargo/vendor/parking_lot_core-0.8.2/.cargo-checksum.json +++ b/third_party/cargo/vendor/parking_lot_core-0.8.3/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"47ce78ae2c5d40969f0ce1f370fd54c99f24e3d1962c446aba19d832b63cf4b8","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5","src/lib.rs":"7baf09034aafc28f7dbb1550cdde89221e4eb5dfda51b55aeb652ee8710c715d","src/parking_lot.rs":"58125667bd78399e8753b6bd8acef84f180f369f0bc174c573887176bab9f9d3","src/spinwait.rs":"d568d8a81f9144ec4c4a139dc934d7d04ee1656a4a221eb548742fe7aba09ab1","src/thread_parker/generic.rs":"574aecb3c325012b683eca4135441ec73f44c33cc9955aa05db24d7e4c991cd7","src/thread_parker/linux.rs":"4a2c76b3dc09301ceb73d904460f49d91bc1a2492cc123ee26ca22ece3faae79","src/thread_parker/mod.rs":"9c675b7690bbde62e88d946fad218623d423edccff4e01e8e52b116d815c695c","src/thread_parker/redox.rs":"91ca107c4edffa57e87294cadec3b6010b584fb272c044e2557c925dbcb90f6a","src/thread_parker/sgx.rs":"898ced116fb7b0ac077b5977b5bcac610f1d55beffb613ec73e083b1ef09cc28","src/thread_parker/unix.rs":"02a17ad1241e8547cc7ee096318757b01d328354b639d0f799fca66ff2f07439","src/thread_parker/wasm.rs":"903b7eec240cdbe8a23467f6b41d042d93b35755bd1763be02f9cc55756c4aec","src/thread_parker/wasm_atomic.rs":"cf761157803256b18205e747bc99e30b18d5410c27121fa9595e12cb51bb6bef","src/thread_parker/windows/keyed_event.rs":"fc1cf4e592d814c4c949217d91317ec2afb6048430abebb3cea2e8487b369734","src/thread_parker/windows/mod.rs":"c99a3871e69800452a56928a9e870530b7f48a563a4d3efe6184103147899f0c","src/thread_parker/windows/waitaddress.rs":"8e037df2a5692905e2bc2d4ea955295ab92bcc7e26eea0bb7a4eaac9ce657321","src/util.rs":"285e6133150645525f2ca1ece41f6d35bad4e7c5e08b42b20c99d2a97e04a974","src/word_lock.rs":"2c030aedb340ae8ca564365206452c298fe29986d005d6a40e808c9760f91c95"},"package":"9ccb628cad4f84851442432c60ad8e1f607e29752d0bf072cbd0baf28aa34272"} \ No newline at end of file +{"files":{"Cargo.toml":"ccd1260851c747071cbc3750ac0d4a29f0c1d0896ef8fa756f3583c4e5089243","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5","src/lib.rs":"7baf09034aafc28f7dbb1550cdde89221e4eb5dfda51b55aeb652ee8710c715d","src/parking_lot.rs":"58125667bd78399e8753b6bd8acef84f180f369f0bc174c573887176bab9f9d3","src/spinwait.rs":"d568d8a81f9144ec4c4a139dc934d7d04ee1656a4a221eb548742fe7aba09ab1","src/thread_parker/generic.rs":"574aecb3c325012b683eca4135441ec73f44c33cc9955aa05db24d7e4c991cd7","src/thread_parker/linux.rs":"4a2c76b3dc09301ceb73d904460f49d91bc1a2492cc123ee26ca22ece3faae79","src/thread_parker/mod.rs":"9c675b7690bbde62e88d946fad218623d423edccff4e01e8e52b116d815c695c","src/thread_parker/redox.rs":"91ca107c4edffa57e87294cadec3b6010b584fb272c044e2557c925dbcb90f6a","src/thread_parker/sgx.rs":"898ced116fb7b0ac077b5977b5bcac610f1d55beffb613ec73e083b1ef09cc28","src/thread_parker/unix.rs":"02a17ad1241e8547cc7ee096318757b01d328354b639d0f799fca66ff2f07439","src/thread_parker/wasm.rs":"903b7eec240cdbe8a23467f6b41d042d93b35755bd1763be02f9cc55756c4aec","src/thread_parker/wasm_atomic.rs":"cf761157803256b18205e747bc99e30b18d5410c27121fa9595e12cb51bb6bef","src/thread_parker/windows/keyed_event.rs":"fc1cf4e592d814c4c949217d91317ec2afb6048430abebb3cea2e8487b369734","src/thread_parker/windows/mod.rs":"c99a3871e69800452a56928a9e870530b7f48a563a4d3efe6184103147899f0c","src/thread_parker/windows/waitaddress.rs":"8e037df2a5692905e2bc2d4ea955295ab92bcc7e26eea0bb7a4eaac9ce657321","src/util.rs":"285e6133150645525f2ca1ece41f6d35bad4e7c5e08b42b20c99d2a97e04a974","src/word_lock.rs":"2c030aedb340ae8ca564365206452c298fe29986d005d6a40e808c9760f91c95"},"package":"fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018"} \ No newline at end of file diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/BUILD.bazel b/third_party/cargo/vendor/parking_lot_core-0.8.3/BUILD.bazel similarity index 91% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/BUILD.bazel rename to third_party/cargo/vendor/parking_lot_core-0.8.3/BUILD.bazel index 0d59de2..e126979 100644 --- a/third_party/cargo/vendor/parking_lot_core-0.8.2/BUILD.bazel +++ b/third_party/cargo/vendor/parking_lot_core-0.8.3/BUILD.bazel @@ -48,18 +48,18 @@ rust_library( "cargo-raze", "manual", ], - version = "0.8.2", + version = "0.8.3", # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/cfg-if-1.0.0:cfg_if", "//third_party/cargo/vendor/instant-0.1.9:instant", - "//third_party/cargo/vendor/smallvec-1.6.0:smallvec", + "//third_party/cargo/vendor/smallvec-1.6.1:smallvec", ] + selects.with_or({ # cfg(unix) ( "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", ): [ - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ], "//conditions:default": [], }) + selects.with_or({ diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/Cargo.toml b/third_party/cargo/vendor/parking_lot_core-0.8.3/Cargo.toml similarity index 96% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/Cargo.toml rename to third_party/cargo/vendor/parking_lot_core-0.8.3/Cargo.toml index c24c1de..a9184c2 100644 --- a/third_party/cargo/vendor/parking_lot_core-0.8.2/Cargo.toml +++ b/third_party/cargo/vendor/parking_lot_core-0.8.3/Cargo.toml @@ -13,7 +13,7 @@ [package] edition = "2018" name = "parking_lot_core" -version = "0.8.2" +version = "0.8.3" authors = ["Amanieu d'Antras "] description = "An advanced API for creating custom synchronization primitives." keywords = ["mutex", "condvar", "rwlock", "once", "thread"] @@ -35,7 +35,7 @@ version = "0.5.1" optional = true [dependencies.smallvec] -version = "1.0" +version = "1.6.1" [dependencies.thread-id] version = "3.3.0" @@ -45,7 +45,7 @@ optional = true deadlock_detection = ["petgraph", "thread-id", "backtrace"] nightly = [] [target."cfg(target_os = \"redox\")".dependencies.redox_syscall] -version = "0.1.56" +version = "0.2.4" [target."cfg(unix)".dependencies.libc] version = "0.2.71" [target."cfg(windows)".dependencies.winapi] diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/LICENSE-APACHE b/third_party/cargo/vendor/parking_lot_core-0.8.3/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/LICENSE-APACHE rename to third_party/cargo/vendor/parking_lot_core-0.8.3/LICENSE-APACHE diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/LICENSE-MIT b/third_party/cargo/vendor/parking_lot_core-0.8.3/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/LICENSE-MIT rename to third_party/cargo/vendor/parking_lot_core-0.8.3/LICENSE-MIT diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/src/lib.rs b/third_party/cargo/vendor/parking_lot_core-0.8.3/src/lib.rs similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/src/lib.rs rename to third_party/cargo/vendor/parking_lot_core-0.8.3/src/lib.rs diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/src/parking_lot.rs b/third_party/cargo/vendor/parking_lot_core-0.8.3/src/parking_lot.rs similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/src/parking_lot.rs rename to third_party/cargo/vendor/parking_lot_core-0.8.3/src/parking_lot.rs diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/src/spinwait.rs b/third_party/cargo/vendor/parking_lot_core-0.8.3/src/spinwait.rs similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/src/spinwait.rs rename to third_party/cargo/vendor/parking_lot_core-0.8.3/src/spinwait.rs diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/generic.rs b/third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/generic.rs similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/generic.rs rename to third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/generic.rs diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/linux.rs b/third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/linux.rs similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/linux.rs rename to third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/linux.rs diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/mod.rs b/third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/mod.rs similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/mod.rs rename to third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/mod.rs diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/redox.rs b/third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/redox.rs similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/redox.rs rename to third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/redox.rs diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/sgx.rs b/third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/sgx.rs similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/sgx.rs rename to third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/sgx.rs diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/unix.rs b/third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/unix.rs similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/unix.rs rename to third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/unix.rs diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/wasm.rs b/third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/wasm.rs similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/wasm.rs rename to third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/wasm.rs diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/wasm_atomic.rs b/third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/wasm_atomic.rs similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/wasm_atomic.rs rename to third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/wasm_atomic.rs diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/windows/keyed_event.rs b/third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/windows/keyed_event.rs similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/windows/keyed_event.rs rename to third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/windows/keyed_event.rs diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/windows/mod.rs b/third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/windows/mod.rs similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/windows/mod.rs rename to third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/windows/mod.rs diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/windows/waitaddress.rs b/third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/windows/waitaddress.rs similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/src/thread_parker/windows/waitaddress.rs rename to third_party/cargo/vendor/parking_lot_core-0.8.3/src/thread_parker/windows/waitaddress.rs diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/src/util.rs b/third_party/cargo/vendor/parking_lot_core-0.8.3/src/util.rs similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/src/util.rs rename to third_party/cargo/vendor/parking_lot_core-0.8.3/src/util.rs diff --git a/third_party/cargo/vendor/parking_lot_core-0.8.2/src/word_lock.rs b/third_party/cargo/vendor/parking_lot_core-0.8.3/src/word_lock.rs similarity index 100% rename from third_party/cargo/vendor/parking_lot_core-0.8.2/src/word_lock.rs rename to third_party/cargo/vendor/parking_lot_core-0.8.3/src/word_lock.rs diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/.cargo-checksum.json b/third_party/cargo/vendor/proc-macro2-1.0.24/.cargo-checksum.json deleted file mode 100644 index e7849f2..0000000 --- a/third_party/cargo/vendor/proc-macro2-1.0.24/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"Cargo.toml":"302d447d62c8d091d6241cf62bdad607c0d4ed8ff9f43d9b254c9d99c253ee8e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"e1f9d4fc22cff2c049f166a403b41458632a94357890d31cf0e3ad83807fb430","build.rs":"a71283fbc495095eebbbf46753df3fe2c19505c745b508dea157f65796b64dd7","src/detection.rs":"9d25d896889e65330858f2d6f6223c1b98cd1dad189813ad4161ff189fbda2b8","src/fallback.rs":"b114e013695260f6066395c8712cea112ec2a386010397a80f15a60f8b986444","src/lib.rs":"7f528764a958587f007f0c2a330a6a414bae2c8e73d5ed9fb64ff1b42b1805b1","src/marker.rs":"87fce2d0357f5b7998b6d9dfb064f4a0cbc9dabb19e33d4b514a446243ebe2e8","src/parse.rs":"1d2253eacbd40eb3a2a933be2adcee356af922bdb48cc89ff266252a41fd98a1","src/wrapper.rs":"f52646ce1705c1f6265516f30d4c43297b5f529dd31fb91f4c806be89d5a4122","tests/comments.rs":"ea6cbe6f4c8852e6a0612893c7d4f2c144a2e6a134a6c3db641a320cbfc3c800","tests/features.rs":"a86deb8644992a4eb64d9fd493eff16f9cf9c5cb6ade3a634ce0c990cf87d559","tests/marker.rs":"652db9f25c69ffc65baa60cdca8f195aa2e254d4de0a9ddc85de4dc2470544b6","tests/test.rs":"5f30a704eeb2b9198b57f416d622da72d25cb9bf8d8b12e6d0e90aa2cb0e43fc","tests/test_fmt.rs":"745dfdc41d09c5308c221395eb43f2041f0a1413d2927a813bc2ad4554438fe2"},"package":"1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"} \ No newline at end of file diff --git a/third_party/cargo/vendor/proc-macro2-1.0.26/.cargo-checksum.json b/third_party/cargo/vendor/proc-macro2-1.0.26/.cargo-checksum.json new file mode 100644 index 0000000..7f9ea43 --- /dev/null +++ b/third_party/cargo/vendor/proc-macro2-1.0.26/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"d790bd30ab27a368d01e6eaab90ef990a9bc446ff0e0a0fac71e69c725259714","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"e1f9d4fc22cff2c049f166a403b41458632a94357890d31cf0e3ad83807fb430","build.rs":"a71283fbc495095eebbbf46753df3fe2c19505c745b508dea157f65796b64dd7","src/detection.rs":"9d25d896889e65330858f2d6f6223c1b98cd1dad189813ad4161ff189fbda2b8","src/fallback.rs":"528a5859f4e11efaf1f4c58ec8551d369cddc0a5bdb4d5f2408f1319988a4c82","src/lib.rs":"83a4a8ec284ebe4cfa4f4889569344acfd0541a6d477f0ec4f5a8ea6b0c0909e","src/marker.rs":"87fce2d0357f5b7998b6d9dfb064f4a0cbc9dabb19e33d4b514a446243ebe2e8","src/parse.rs":"b6179432a3919da02d486b1dd1789af504e765c1e2e5b92b5f2868107b96fc41","src/wrapper.rs":"85bc6edd37e7a1bea89cadfc17011ece7b51456402799598dc86a52f633de32b","tests/comments.rs":"ea6cbe6f4c8852e6a0612893c7d4f2c144a2e6a134a6c3db641a320cbfc3c800","tests/features.rs":"a86deb8644992a4eb64d9fd493eff16f9cf9c5cb6ade3a634ce0c990cf87d559","tests/marker.rs":"652db9f25c69ffc65baa60cdca8f195aa2e254d4de0a9ddc85de4dc2470544b6","tests/test.rs":"9ec99517d324532801e93a76ae6e4e07b98218aa61d901ee45d250ee93bac417","tests/test_fmt.rs":"745dfdc41d09c5308c221395eb43f2041f0a1413d2927a813bc2ad4554438fe2"},"package":"a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec"} \ No newline at end of file diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/BUILD.bazel b/third_party/cargo/vendor/proc-macro2-1.0.26/BUILD.bazel similarity index 97% rename from third_party/cargo/vendor/proc-macro2-1.0.24/BUILD.bazel rename to third_party/cargo/vendor/proc-macro2-1.0.26/BUILD.bazel index ff4ca6e..217f8d4 100644 --- a/third_party/cargo/vendor/proc-macro2-1.0.24/BUILD.bazel +++ b/third_party/cargo/vendor/proc-macro2-1.0.26/BUILD.bazel @@ -54,7 +54,7 @@ cargo_build_script( "cargo-raze", "manual", ], - version = "1.0.24", + version = "1.0.26", visibility = ["//visibility:private"], deps = [ ], @@ -78,7 +78,7 @@ rust_library( "cargo-raze", "manual", ], - version = "1.0.24", + version = "1.0.26", # buildifier: leave-alone deps = [ ":proc_macro2_build_script", diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/Cargo.toml b/third_party/cargo/vendor/proc-macro2-1.0.26/Cargo.toml similarity index 93% rename from third_party/cargo/vendor/proc-macro2-1.0.24/Cargo.toml rename to third_party/cargo/vendor/proc-macro2-1.0.26/Cargo.toml index 22150c5..3bb4b8e 100644 --- a/third_party/cargo/vendor/proc-macro2-1.0.24/Cargo.toml +++ b/third_party/cargo/vendor/proc-macro2-1.0.26/Cargo.toml @@ -13,7 +13,7 @@ [package] edition = "2018" name = "proc-macro2" -version = "1.0.24" +version = "1.0.26" authors = ["Alex Crichton ", "David Tolnay "] description = "A substitute implementation of the compiler's `proc_macro` API to decouple\ntoken-based libraries from the procedural macro use case.\n" documentation = "https://docs.rs/proc-macro2" @@ -24,7 +24,7 @@ license = "MIT OR Apache-2.0" repository = "https://github.com/alexcrichton/proc-macro2" [package.metadata.docs.rs] rustc-args = ["--cfg", "procmacro2_semver_exempt"] -rustdoc-args = ["--cfg", "procmacro2_semver_exempt"] +rustdoc-args = ["--cfg", "procmacro2_semver_exempt", "--cfg", "doc_cfg"] targets = ["x86_64-unknown-linux-gnu"] [package.metadata.playground] diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/LICENSE-APACHE b/third_party/cargo/vendor/proc-macro2-1.0.26/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/proc-macro2-1.0.24/LICENSE-APACHE rename to third_party/cargo/vendor/proc-macro2-1.0.26/LICENSE-APACHE diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/LICENSE-MIT b/third_party/cargo/vendor/proc-macro2-1.0.26/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/proc-macro2-1.0.24/LICENSE-MIT rename to third_party/cargo/vendor/proc-macro2-1.0.26/LICENSE-MIT diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/README.md b/third_party/cargo/vendor/proc-macro2-1.0.26/README.md similarity index 100% rename from third_party/cargo/vendor/proc-macro2-1.0.24/README.md rename to third_party/cargo/vendor/proc-macro2-1.0.26/README.md diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/build.rs b/third_party/cargo/vendor/proc-macro2-1.0.26/build.rs similarity index 100% rename from third_party/cargo/vendor/proc-macro2-1.0.24/build.rs rename to third_party/cargo/vendor/proc-macro2-1.0.26/build.rs diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/src/detection.rs b/third_party/cargo/vendor/proc-macro2-1.0.26/src/detection.rs similarity index 100% rename from third_party/cargo/vendor/proc-macro2-1.0.24/src/detection.rs rename to third_party/cargo/vendor/proc-macro2-1.0.26/src/detection.rs diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/src/fallback.rs b/third_party/cargo/vendor/proc-macro2-1.0.26/src/fallback.rs similarity index 99% rename from third_party/cargo/vendor/proc-macro2-1.0.24/src/fallback.rs rename to third_party/cargo/vendor/proc-macro2-1.0.26/src/fallback.rs index 8900c5f..50d10db 100644 --- a/third_party/cargo/vendor/proc-macro2-1.0.24/src/fallback.rs +++ b/third_party/cargo/vendor/proc-macro2-1.0.26/src/fallback.rs @@ -1,4 +1,4 @@ -use crate::parse::{token_stream, Cursor}; +use crate::parse::{self, Cursor}; use crate::{Delimiter, Spacing, TokenTree}; #[cfg(span_locations)] use std::cell::RefCell; @@ -35,7 +35,15 @@ pub(crate) struct TokenStream { } #[derive(Debug)] -pub(crate) struct LexError; +pub(crate) struct LexError { + pub(crate) span: Span, +} + +impl LexError { + pub(crate) fn span(&self) -> Span { + self.span + } +} impl TokenStream { pub fn new() -> TokenStream { @@ -139,12 +147,7 @@ impl FromStr for TokenStream { // Create a dummy file & add it to the source map let cursor = get_cursor(src); - let (rest, tokens) = token_stream(cursor)?; - if rest.is_empty() { - Ok(tokens) - } else { - Err(LexError) - } + parse::token_stream(cursor) } } diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/src/lib.rs b/third_party/cargo/vendor/proc-macro2-1.0.26/src/lib.rs similarity index 95% rename from third_party/cargo/vendor/proc-macro2-1.0.24/src/lib.rs rename to third_party/cargo/vendor/proc-macro2-1.0.26/src/lib.rs index c20fb50..9dec309 100644 --- a/third_party/cargo/vendor/proc-macro2-1.0.24/src/lib.rs +++ b/third_party/cargo/vendor/proc-macro2-1.0.26/src/lib.rs @@ -78,10 +78,11 @@ //! 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.24")] +#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.26")] #![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))] #![cfg_attr(super_unstable, feature(proc_macro_raw_ident, proc_macro_def_site))] -#![allow(clippy::needless_doctest_main)] +#![cfg_attr(doc_cfg, feature(doc_cfg))] +#![allow(clippy::needless_doctest_main, clippy::vec_init_then_push)] #[cfg(use_proc_macro)] extern crate proc_macro; @@ -249,6 +250,12 @@ impl Debug for TokenStream { } } +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) @@ -267,6 +274,7 @@ impl Error for LexError {} /// /// This type is semver exempt and not exposed by default. #[cfg(procmacro2_semver_exempt)] +#[cfg_attr(doc_cfg, doc(cfg(procmacro2_semver_exempt)))] #[derive(Clone, PartialEq, Eq)] pub struct SourceFile { inner: imp::SourceFile, @@ -317,6 +325,7 @@ impl Debug for SourceFile { /// /// This type is semver exempt and not exposed by default. #[cfg(span_locations)] +#[cfg_attr(doc_cfg, doc(cfg(feature = "span-locations")))] #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub struct LineColumn { /// The 1-indexed line in the source file on which the span starts or ends @@ -388,6 +397,7 @@ impl Span { /// /// This method is semver exempt and not exposed by default. #[cfg(procmacro2_semver_exempt)] + #[cfg_attr(doc_cfg, doc(cfg(procmacro2_semver_exempt)))] pub fn def_site() -> Span { Span::_new(imp::Span::def_site()) } @@ -430,6 +440,7 @@ impl Span { /// /// This method is semver exempt and not exposed by default. #[cfg(procmacro2_semver_exempt)] + #[cfg_attr(doc_cfg, doc(cfg(procmacro2_semver_exempt)))] pub fn source_file(&self) -> SourceFile { SourceFile::_new(self.inner.source_file()) } @@ -437,7 +448,14 @@ impl Span { /// 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(doc_cfg, doc(cfg(feature = "span-locations")))] pub fn start(&self) -> LineColumn { let imp::LineColumn { line, column } = self.inner.start(); LineColumn { line, column } @@ -446,7 +464,14 @@ impl Span { /// 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(doc_cfg, doc(cfg(feature = "span-locations")))] pub fn end(&self) -> LineColumn { let imp::LineColumn { line, column } = self.inner.end(); LineColumn { line, column } @@ -469,6 +494,7 @@ impl Span { /// /// This method is semver exempt and not exposed by default. #[cfg(procmacro2_semver_exempt)] + #[cfg_attr(doc_cfg, doc(cfg(procmacro2_semver_exempt)))] pub fn eq(&self, other: &Span) -> bool { self.inner.eq(&other.inner) } @@ -699,7 +725,7 @@ impl Debug for Group { } } -/// An `Punct` is an single punctuation character like `+`, `-` or `#`. +/// 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. @@ -710,7 +736,7 @@ pub struct Punct { span: Span, } -/// Whether an `Punct` is followed immediately by another `Punct` or followed by +/// 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 { @@ -899,6 +925,7 @@ impl Ident { /// /// This method is semver exempt and not exposed by default. #[cfg(procmacro2_semver_exempt)] + #[cfg_attr(doc_cfg, doc(cfg(procmacro2_semver_exempt)))] pub fn new_raw(string: &str, span: Span) -> Ident { Ident::_new_raw(string, span) } @@ -987,7 +1014,7 @@ macro_rules! suffixed_int_literals { /// 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 rountrips through `TokenStream` or strings and may be + /// 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()` @@ -1008,7 +1035,7 @@ macro_rules! unsuffixed_int_literals { /// 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 rountrips through `TokenStream` or strings and may + /// 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()` diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/src/marker.rs b/third_party/cargo/vendor/proc-macro2-1.0.26/src/marker.rs similarity index 100% rename from third_party/cargo/vendor/proc-macro2-1.0.24/src/marker.rs rename to third_party/cargo/vendor/proc-macro2-1.0.26/src/marker.rs diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/src/parse.rs b/third_party/cargo/vendor/proc-macro2-1.0.26/src/parse.rs similarity index 84% rename from third_party/cargo/vendor/proc-macro2-1.0.24/src/parse.rs rename to third_party/cargo/vendor/proc-macro2-1.0.26/src/parse.rs index 365fe04..e5caed8 100644 --- a/third_party/cargo/vendor/proc-macro2-1.0.24/src/parse.rs +++ b/third_party/cargo/vendor/proc-macro2-1.0.26/src/parse.rs @@ -26,7 +26,7 @@ impl<'a> Cursor<'a> { self.rest.starts_with(s) } - pub(crate) fn is_empty(&self) -> bool { + fn is_empty(&self) -> bool { self.rest.is_empty() } @@ -50,16 +50,17 @@ impl<'a> Cursor<'a> { self.rest.char_indices() } - fn parse(&self, tag: &str) -> Result, LexError> { + fn parse(&self, tag: &str) -> Result, Reject> { if self.starts_with(tag) { Ok(self.advance(tag.len())) } else { - Err(LexError) + Err(Reject) } } } -type PResult<'a, O> = Result<(Cursor<'a>, O), LexError>; +struct Reject; +type PResult<'a, O> = Result<(Cursor<'a>, O), Reject>; fn skip_whitespace(input: Cursor) -> Cursor { let mut s = input; @@ -86,7 +87,7 @@ fn skip_whitespace(input: Cursor) -> Cursor { s = rest; continue; } - Err(LexError) => return s, + Err(Reject) => return s, } } } @@ -111,7 +112,7 @@ fn skip_whitespace(input: Cursor) -> Cursor { fn block_comment(input: Cursor) -> PResult<&str> { if !input.starts_with("/*") { - return Err(LexError); + return Err(Reject); } let mut depth = 0; @@ -133,7 +134,7 @@ fn block_comment(input: Cursor) -> PResult<&str> { i += 1; } - Err(LexError) + Err(Reject) } fn is_whitespace(ch: char) -> bool { @@ -141,14 +142,14 @@ fn is_whitespace(ch: char) -> bool { ch.is_whitespace() || ch == '\u{200e}' || ch == '\u{200f}' } -fn word_break(input: Cursor) -> Result { +fn word_break(input: Cursor) -> Result { match input.chars().next() { - Some(ch) if is_ident_continue(ch) => Err(LexError), + Some(ch) if is_ident_continue(ch) => Err(Reject), Some(_) | None => Ok(input), } } -pub(crate) fn token_stream(mut input: Cursor) -> PResult { +pub(crate) fn token_stream(mut input: Cursor) -> Result { let mut trees = Vec::new(); let mut stack = Vec::new(); @@ -166,7 +167,17 @@ pub(crate) fn token_stream(mut input: Cursor) -> PResult { let first = match input.bytes().next() { Some(first) => first, - None => break, + None => match stack.last() { + None => return Ok(TokenStream { inner: trees }), + #[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 { @@ -187,14 +198,17 @@ pub(crate) fn token_stream(mut input: Cursor) -> PResult { b'}' => Some(Delimiter::Brace), _ => None, } { - input = input.advance(1); - let frame = stack.pop().ok_or(LexError)?; + 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(LexError); + return Err(lex_error(input)); } + input = input.advance(1); let mut g = Group::new(open_delimiter, TokenStream { inner: trees }); g.set_span(Span { #[cfg(span_locations)] @@ -205,7 +219,10 @@ pub(crate) fn token_stream(mut input: Cursor) -> PResult { trees = outer; trees.push(TokenTree::Group(crate::Group::_new_stable(g))); } else { - let (rest, mut tt) = leaf_token(input)?; + 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_stable(Span { #[cfg(span_locations)] lo, @@ -216,11 +233,18 @@ pub(crate) fn token_stream(mut input: Cursor) -> PResult { input = rest; } } +} - if stack.is_empty() { - Ok((input, TokenStream { inner: trees })) - } else { - Err(LexError) +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, + }, } } @@ -233,7 +257,7 @@ fn leaf_token(input: Cursor) -> PResult { } else if let Ok((input, i)) = ident(input) { Ok((input, TokenTree::Ident(i))) } else { - Err(LexError) + Err(Reject) } } @@ -242,7 +266,7 @@ fn ident(input: Cursor) -> PResult { .iter() .any(|prefix| input.starts_with(prefix)) { - Err(LexError) + Err(Reject) } else { ident_any(input) } @@ -260,7 +284,7 @@ fn ident_any(input: Cursor) -> PResult { } if sym == "_" { - return Err(LexError); + return Err(Reject); } let ident = crate::Ident::_new_raw(sym, crate::Span::call_site()); @@ -272,7 +296,7 @@ fn ident_not_raw(input: Cursor) -> PResult<&str> { match chars.next() { Some((_, ch)) if is_ident_start(ch) => {} - _ => return Err(LexError), + _ => return Err(Reject), } let mut end = input.len(); @@ -287,16 +311,12 @@ fn ident_not_raw(input: Cursor) -> PResult<&str> { } fn literal(input: Cursor) -> PResult { - match literal_nocapture(input) { - Ok(a) => { - let end = input.len() - a.len(); - Ok((a, Literal::_new(input.rest[..end].to_string()))) - } - Err(LexError) => Err(LexError), - } + 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 { +fn literal_nocapture(input: Cursor) -> Result { if let Ok(ok) = string(input) { Ok(ok) } else if let Ok(ok) = byte_string(input) { @@ -310,28 +330,28 @@ fn literal_nocapture(input: Cursor) -> Result { } else if let Ok(ok) = int(input) { Ok(ok) } else { - Err(LexError) + Err(Reject) } } fn literal_suffix(input: Cursor) -> Cursor { match ident_not_raw(input) { Ok((input, _)) => input, - Err(LexError) => input, + Err(Reject) => input, } } -fn string(input: Cursor) -> Result { +fn string(input: Cursor) -> Result { if let Ok(input) = input.parse("\"") { cooked_string(input) } else if let Ok(input) = input.parse("r") { raw_string(input) } else { - Err(LexError) + Err(Reject) } } -fn cooked_string(input: Cursor) -> Result { +fn cooked_string(input: Cursor) -> Result { let mut chars = input.char_indices().peekable(); while let Some((i, ch)) = chars.next() { @@ -361,7 +381,7 @@ fn cooked_string(input: Cursor) -> Result { let mut last = ch; loop { if last == '\r' && chars.next().map_or(true, |(_, ch)| ch != '\n') { - return Err(LexError); + return Err(Reject); } match chars.peek() { Some((_, ch)) if ch.is_whitespace() => { @@ -377,20 +397,20 @@ fn cooked_string(input: Cursor) -> Result { _ch => {} } } - Err(LexError) + Err(Reject) } -fn byte_string(input: Cursor) -> Result { +fn byte_string(input: Cursor) -> Result { if let Ok(input) = input.parse("b\"") { cooked_byte_string(input) } else if let Ok(input) = input.parse("br") { raw_string(input) } else { - Err(LexError) + Err(Reject) } } -fn cooked_byte_string(mut input: Cursor) -> Result { +fn cooked_byte_string(mut input: Cursor) -> Result { let mut bytes = input.bytes().enumerate(); while let Some((offset, b)) = bytes.next() { match b { @@ -416,7 +436,7 @@ fn cooked_byte_string(mut input: Cursor) -> Result { let mut chars = rest.char_indices(); loop { if last == '\r' && chars.next().map_or(true, |(_, ch)| ch != '\n') { - return Err(LexError); + return Err(Reject); } match chars.next() { Some((_, ch)) if ch.is_whitespace() => last = ch, @@ -425,7 +445,7 @@ fn cooked_byte_string(mut input: Cursor) -> Result { bytes = input.bytes().enumerate(); break; } - None => return Err(LexError), + None => return Err(Reject), } } } @@ -435,10 +455,10 @@ fn cooked_byte_string(mut input: Cursor) -> Result { _ => break, } } - Err(LexError) + Err(Reject) } -fn raw_string(input: Cursor) -> Result { +fn raw_string(input: Cursor) -> Result { let mut chars = input.char_indices(); let mut n = 0; while let Some((i, ch)) = chars.next() { @@ -448,7 +468,7 @@ fn raw_string(input: Cursor) -> Result { break; } '#' => {} - _ => return Err(LexError), + _ => return Err(Reject), } } while let Some((i, ch)) = chars.next() { @@ -464,10 +484,10 @@ fn raw_string(input: Cursor) -> Result { _ => {} } } - Err(LexError) + Err(Reject) } -fn byte(input: Cursor) -> Result { +fn byte(input: Cursor) -> Result { let input = input.parse("b'")?; let mut bytes = input.bytes().enumerate(); let ok = match bytes.next().map(|(_, b)| b) { @@ -480,17 +500,17 @@ fn byte(input: Cursor) -> Result { b => b.is_some(), }; if !ok { - return Err(LexError); + return Err(Reject); } - let (offset, _) = bytes.next().ok_or(LexError)?; + let (offset, _) = bytes.next().ok_or(Reject)?; if !input.chars().as_str().is_char_boundary(offset) { - return Err(LexError); + return Err(Reject); } let input = input.advance(offset).parse("'")?; Ok(literal_suffix(input)) } -fn character(input: Cursor) -> Result { +fn character(input: Cursor) -> Result { let input = input.parse("'")?; let mut chars = input.char_indices(); let ok = match chars.next().map(|(_, ch)| ch) { @@ -505,9 +525,9 @@ fn character(input: Cursor) -> Result { ch => ch.is_some(), }; if !ok { - return Err(LexError); + return Err(Reject); } - let (idx, _) = chars.next().ok_or(LexError)?; + let (idx, _) = chars.next().ok_or(Reject)?; let input = input.advance(idx).parse("'")?; Ok(literal_suffix(input)) } @@ -549,7 +569,7 @@ where next_ch!(chars @ '{'); let mut value = 0; let mut len = 0; - while let Some((_, ch)) = chars.next() { + for (_, ch) in chars { let digit = match ch { '0'..='9' => ch as u8 - b'0', 'a'..='f' => 10 + ch as u8 - b'a', @@ -568,7 +588,7 @@ where false } -fn float(input: Cursor) -> Result { +fn float(input: Cursor) -> Result { let mut rest = float_digits(input)?; if let Some(ch) = rest.chars().next() { if is_ident_start(ch) { @@ -578,11 +598,11 @@ fn float(input: Cursor) -> Result { word_break(rest) } -fn float_digits(input: Cursor) -> Result { +fn float_digits(input: Cursor) -> Result { let mut chars = input.chars().peekable(); match chars.next() { Some(ch) if ch >= '0' && ch <= '9' => {} - _ => return Err(LexError), + _ => return Err(Reject), } let mut len = 1; @@ -604,7 +624,7 @@ fn float_digits(input: Cursor) -> Result { .map(|&ch| ch == '.' || is_ident_start(ch)) .unwrap_or(false) { - return Err(LexError); + return Err(Reject); } len += 1; has_dot = true; @@ -620,14 +640,14 @@ fn float_digits(input: Cursor) -> Result { } if !(has_dot || has_exp) { - return Err(LexError); + return Err(Reject); } if has_exp { let token_before_exp = if has_dot { Ok(input.advance(len - 1)) } else { - Err(LexError) + Err(Reject) }; let mut has_sign = false; let mut has_exp_value = false; @@ -664,7 +684,7 @@ fn float_digits(input: Cursor) -> Result { Ok(input.advance(len)) } -fn int(input: Cursor) -> Result { +fn int(input: Cursor) -> Result { let mut rest = digits(input)?; if let Some(ch) = rest.chars().next() { if is_ident_start(ch) { @@ -674,7 +694,7 @@ fn int(input: Cursor) -> Result { word_break(rest) } -fn digits(mut input: Cursor) -> Result { +fn digits(mut input: Cursor) -> Result { let base = if input.starts_with("0x") { input = input.advance(2); 16 @@ -695,7 +715,7 @@ fn digits(mut input: Cursor) -> Result { b'0'..=b'9' => { let digit = (b - b'0') as u64; if digit >= base { - return Err(LexError); + return Err(Reject); } } b'a'..=b'f' => { @@ -712,7 +732,7 @@ fn digits(mut input: Cursor) -> Result { } b'_' => { if empty && base == 10 { - return Err(LexError); + return Err(Reject); } len += 1; continue; @@ -723,50 +743,47 @@ fn digits(mut input: Cursor) -> Result { empty = false; } if empty { - Err(LexError) + Err(Reject) } else { Ok(input.advance(len)) } } fn punct(input: Cursor) -> PResult { - match punct_char(input) { - Ok((rest, '\'')) => { - if ident_any(rest)?.0.starts_with("'") { - Err(LexError) - } else { - Ok((rest, Punct::new('\'', Spacing::Joint))) - } + let (rest, ch) = punct_char(input)?; + if ch == '\'' { + if ident_any(rest)?.0.starts_with("'") { + Err(Reject) + } else { + Ok((rest, Punct::new('\'', Spacing::Joint))) } - Ok((rest, ch)) => { - let kind = match punct_char(rest) { - Ok(_) => Spacing::Joint, - Err(LexError) => Spacing::Alone, - }; - Ok((rest, Punct::new(ch, kind))) - } - Err(LexError) => Err(LexError), + } 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 { if input.starts_with("//") || input.starts_with("/*") { // Do not accept `/` of a comment as a punct. - return Err(LexError); + return Err(Reject); } let mut chars = input.chars(); let first = match chars.next() { Some(ch) => ch, None => { - return Err(LexError); + return Err(Reject); } }; let recognized = "~!@#$%^&*-=+|;:,<.>/?'"; if recognized.contains(first) { Ok((input.advance(first.len_utf8()), first)) } else { - Err(LexError) + Err(Reject) } } @@ -785,7 +802,7 @@ fn doc_comment(input: Cursor) -> PResult> { 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(LexError); + return Err(Reject); } scan_for_bare_cr = rest; } @@ -822,7 +839,7 @@ fn doc_comment_contents(input: Cursor) -> PResult<(&str, bool)> { } else if input.starts_with("///") { let input = input.advance(3); if input.starts_with("/") { - return Err(LexError); + return Err(Reject); } let (input, s) = take_until_newline_or_eof(input); Ok((input, (s, false))) @@ -830,7 +847,7 @@ fn doc_comment_contents(input: Cursor) -> PResult<(&str, bool)> { let (input, s) = block_comment(input)?; Ok((input, (&s[3..s.len() - 2], false))) } else { - Err(LexError) + Err(Reject) } } diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/src/wrapper.rs b/third_party/cargo/vendor/proc-macro2-1.0.26/src/wrapper.rs similarity index 97% rename from third_party/cargo/vendor/proc-macro2-1.0.24/src/wrapper.rs rename to third_party/cargo/vendor/proc-macro2-1.0.26/src/wrapper.rs index 3df044a..24d86e8 100644 --- a/third_party/cargo/vendor/proc-macro2-1.0.24/src/wrapper.rs +++ b/third_party/cargo/vendor/proc-macro2-1.0.26/src/wrapper.rs @@ -107,8 +107,12 @@ impl FromStr for TokenStream { // Work around https://github.com/rust-lang/rust/issues/58736. fn proc_macro_parse(src: &str) -> Result { - panic::catch_unwind(|| src.parse().map_err(LexError::Compiler)) - .unwrap_or(Err(LexError::Fallback(fallback::LexError))) + let result = panic::catch_unwind(|| src.parse().map_err(LexError::Compiler)); + result.unwrap_or_else(|_| { + Err(LexError::Fallback(fallback::LexError { + span: fallback::Span::call_site(), + })) + }) } impl Display for TokenStream { @@ -243,6 +247,15 @@ impl Debug for TokenStream { } } +impl LexError { + pub(crate) fn span(&self) -> Span { + match self { + LexError::Compiler(_) => Span::call_site(), + LexError::Fallback(e) => Span::Fallback(e.span()), + } + } +} + impl From for LexError { fn from(e: proc_macro::LexError) -> LexError { LexError::Compiler(e) @@ -270,7 +283,12 @@ impl Display for LexError { #[cfg(lexerror_display)] LexError::Compiler(e) => Display::fmt(e, f), #[cfg(not(lexerror_display))] - LexError::Compiler(_e) => Display::fmt(&fallback::LexError, f), + LexError::Compiler(_e) => Display::fmt( + &fallback::LexError { + span: fallback::Span::call_site(), + }, + f, + ), LexError::Fallback(e) => Display::fmt(e, f), } } diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/tests/comments.rs b/third_party/cargo/vendor/proc-macro2-1.0.26/tests/comments.rs similarity index 100% rename from third_party/cargo/vendor/proc-macro2-1.0.24/tests/comments.rs rename to third_party/cargo/vendor/proc-macro2-1.0.26/tests/comments.rs diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/tests/features.rs b/third_party/cargo/vendor/proc-macro2-1.0.26/tests/features.rs similarity index 100% rename from third_party/cargo/vendor/proc-macro2-1.0.24/tests/features.rs rename to third_party/cargo/vendor/proc-macro2-1.0.26/tests/features.rs diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/tests/marker.rs b/third_party/cargo/vendor/proc-macro2-1.0.26/tests/marker.rs similarity index 100% rename from third_party/cargo/vendor/proc-macro2-1.0.24/tests/marker.rs rename to third_party/cargo/vendor/proc-macro2-1.0.26/tests/marker.rs diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/tests/test.rs b/third_party/cargo/vendor/proc-macro2-1.0.26/tests/test.rs similarity index 95% rename from third_party/cargo/vendor/proc-macro2-1.0.24/tests/test.rs rename to third_party/cargo/vendor/proc-macro2-1.0.26/tests/test.rs index 1e9f633..6d0a93e 100644 --- a/third_party/cargo/vendor/proc-macro2-1.0.24/tests/test.rs +++ b/third_party/cargo/vendor/proc-macro2-1.0.26/tests/test.rs @@ -1,4 +1,5 @@ use proc_macro2::{Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree}; +use std::panic; use std::str::{self, FromStr}; #[test] @@ -71,9 +72,24 @@ fn lifetime_number() { } #[test] -#[should_panic(expected = r#""\'a#" is not a valid Ident"#)] fn lifetime_invalid() { - Ident::new("'a#", Span::call_site()); + let result = panic::catch_unwind(|| Ident::new("'a#", Span::call_site())); + match result { + Err(box_any) => { + let message = box_any.downcast_ref::().unwrap(); + let expected1 = r#""\'a#" is not a valid Ident"#; // 1.31.0 .. 1.53.0 + let expected2 = r#""'a#" is not a valid Ident"#; // 1.53.0 .. + assert!( + message == expected1 || message == expected2, + "panic message does not match expected string\n\ + \x20 panic message: `{:?}`\n\ + \x20expected message: `{:?}`", + message, + expected2, + ); + } + Ok(_) => panic!("test did not panic as expected"), + } } #[test] diff --git a/third_party/cargo/vendor/proc-macro2-1.0.24/tests/test_fmt.rs b/third_party/cargo/vendor/proc-macro2-1.0.26/tests/test_fmt.rs similarity index 100% rename from third_party/cargo/vendor/proc-macro2-1.0.24/tests/test_fmt.rs rename to third_party/cargo/vendor/proc-macro2-1.0.26/tests/test_fmt.rs diff --git a/third_party/cargo/vendor/quote-1.0.8/.cargo-checksum.json b/third_party/cargo/vendor/quote-1.0.9/.cargo-checksum.json similarity index 80% rename from third_party/cargo/vendor/quote-1.0.8/.cargo-checksum.json rename to third_party/cargo/vendor/quote-1.0.9/.cargo-checksum.json index b4a95db..768055d 100644 --- a/third_party/cargo/vendor/quote-1.0.8/.cargo-checksum.json +++ b/third_party/cargo/vendor/quote-1.0.9/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"63a099cf11c03b8c25c019a137babf22622eaf847f938a2fe95efbd3bba542c5","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5","README.md":"9209682116de84bb9cc7be6ccf44478b46b909c7857f9e186d90bcff522af864","src/ext.rs":"a9fed3a1a4c9d3f2de717ba808af99291b995db2cbf8067f4b6927c39cc62bc6","src/format.rs":"a9c3e3a333c6dacf6e330d02b4c726862e273df1c2c6be6da199049cd1e521db","src/ident_fragment.rs":"e66a63f6e9020f2639a71f120d627bc6cfd60081a6caf8a1d735b59ee2413d29","src/lib.rs":"f0fbd8d2e3d2ea51935c73c65a9c36bb1c06e6f9025fde36e044fe9eb368667a","src/runtime.rs":"f2d1fa6084764d98f98b96344cf675886a79b46a845c592e604f96bbde9aca07","src/spanned.rs":"adc0ed742ad17327c375879472d435cea168c208c303f53eb93cb2c0f10f3650","src/to_tokens.rs":"e589c1643479a9003d4dd1d9fa63714042b106f1b16d8ea3903cfe2f73a020f5","tests/compiletest.rs":"0a52a44786aea1c299c695bf948b2ed2081e4cc344e5c2cadceab4eb03d0010d","tests/test.rs":"6eb200350fa78405d4fd920ecf71d226e258c61aa88f850750efa99e065f06d6","tests/ui/does-not-have-iter-interpolated-dup.rs":"ad13eea21d4cdd2ab6c082f633392e1ff20fb0d1af5f2177041e0bf7f30da695","tests/ui/does-not-have-iter-interpolated.rs":"83a5b3f240651adcbe4b6e51076d76d653ad439b37442cf4054f1fd3c073f3b7","tests/ui/does-not-have-iter-separated.rs":"fe413c48331d5e3a7ae5fef6a5892a90c72f610d54595879eb49d0a94154ba3f","tests/ui/does-not-have-iter.rs":"09dc9499d861b63cebb0848b855b78e2dc9497bfde37ba6339f3625ae009a62f","tests/ui/not-quotable.rs":"5759d0884943417609f28faadc70254a3e2fd3d9bd6ff7297a3fb70a77fafd8a","tests/ui/not-repeatable.rs":"a4b115c04e4e41049a05f5b69450503fbffeba031218b4189cb931839f7f9a9c","tests/ui/wrong-type-span.rs":"5f310cb7fde3ef51bad01e7f286d244e3b6e67396cd2ea7eab77275c9d902699"},"package":"991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df"} \ No newline at end of file +{"files":{"Cargo.toml":"d1e6bb8b4ac54b84f367a4e1b46e7dca3b1a744017d8f7fa2f4c11a8730e657a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5","README.md":"9209682116de84bb9cc7be6ccf44478b46b909c7857f9e186d90bcff522af864","src/ext.rs":"a9fed3a1a4c9d3f2de717ba808af99291b995db2cbf8067f4b6927c39cc62bc6","src/format.rs":"a9c3e3a333c6dacf6e330d02b4c726862e273df1c2c6be6da199049cd1e521db","src/ident_fragment.rs":"e66a63f6e9020f2639a71f120d627bc6cfd60081a6caf8a1d735b59ee2413d29","src/lib.rs":"2500b1955d139e5b467df046cda4f2837fb1edace838aa190020752ab79314c4","src/runtime.rs":"f2d1fa6084764d98f98b96344cf675886a79b46a845c592e604f96bbde9aca07","src/spanned.rs":"adc0ed742ad17327c375879472d435cea168c208c303f53eb93cb2c0f10f3650","src/to_tokens.rs":"e589c1643479a9003d4dd1d9fa63714042b106f1b16d8ea3903cfe2f73a020f5","tests/compiletest.rs":"0a52a44786aea1c299c695bf948b2ed2081e4cc344e5c2cadceab4eb03d0010d","tests/test.rs":"6eb200350fa78405d4fd920ecf71d226e258c61aa88f850750efa99e065f06d6","tests/ui/does-not-have-iter-interpolated-dup.rs":"ad13eea21d4cdd2ab6c082f633392e1ff20fb0d1af5f2177041e0bf7f30da695","tests/ui/does-not-have-iter-interpolated.rs":"83a5b3f240651adcbe4b6e51076d76d653ad439b37442cf4054f1fd3c073f3b7","tests/ui/does-not-have-iter-separated.rs":"fe413c48331d5e3a7ae5fef6a5892a90c72f610d54595879eb49d0a94154ba3f","tests/ui/does-not-have-iter.rs":"09dc9499d861b63cebb0848b855b78e2dc9497bfde37ba6339f3625ae009a62f","tests/ui/not-quotable.rs":"5759d0884943417609f28faadc70254a3e2fd3d9bd6ff7297a3fb70a77fafd8a","tests/ui/not-repeatable.rs":"a4b115c04e4e41049a05f5b69450503fbffeba031218b4189cb931839f7f9a9c","tests/ui/wrong-type-span.rs":"5f310cb7fde3ef51bad01e7f286d244e3b6e67396cd2ea7eab77275c9d902699"},"package":"c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"} \ No newline at end of file diff --git a/third_party/cargo/vendor/quote-1.0.8/BUILD.bazel b/third_party/cargo/vendor/quote-1.0.9/BUILD.bazel similarity index 93% rename from third_party/cargo/vendor/quote-1.0.8/BUILD.bazel rename to third_party/cargo/vendor/quote-1.0.9/BUILD.bazel index 5509aea..9740021 100644 --- a/third_party/cargo/vendor/quote-1.0.8/BUILD.bazel +++ b/third_party/cargo/vendor/quote-1.0.9/BUILD.bazel @@ -48,10 +48,10 @@ rust_library( "cargo-raze", "manual", ], - version = "1.0.8", + version = "1.0.9", # buildifier: leave-alone deps = [ - "//third_party/cargo/vendor/proc-macro2-1.0.24:proc_macro2", + "//third_party/cargo/vendor/proc-macro2-1.0.26:proc_macro2", ], ) diff --git a/third_party/cargo/vendor/quote-1.0.8/Cargo.toml b/third_party/cargo/vendor/quote-1.0.9/Cargo.toml similarity index 98% rename from third_party/cargo/vendor/quote-1.0.8/Cargo.toml rename to third_party/cargo/vendor/quote-1.0.9/Cargo.toml index 8311673..411f943 100644 --- a/third_party/cargo/vendor/quote-1.0.8/Cargo.toml +++ b/third_party/cargo/vendor/quote-1.0.9/Cargo.toml @@ -13,7 +13,7 @@ [package] edition = "2018" name = "quote" -version = "1.0.8" +version = "1.0.9" authors = ["David Tolnay "] include = ["Cargo.toml", "src/**/*.rs", "tests/**/*.rs", "README.md", "LICENSE-APACHE", "LICENSE-MIT"] description = "Quasi-quoting macro quote!(...)" diff --git a/third_party/cargo/vendor/quote-1.0.8/LICENSE-APACHE b/third_party/cargo/vendor/quote-1.0.9/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/LICENSE-APACHE rename to third_party/cargo/vendor/quote-1.0.9/LICENSE-APACHE diff --git a/third_party/cargo/vendor/quote-1.0.8/LICENSE-MIT b/third_party/cargo/vendor/quote-1.0.9/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/LICENSE-MIT rename to third_party/cargo/vendor/quote-1.0.9/LICENSE-MIT diff --git a/third_party/cargo/vendor/quote-1.0.8/README.md b/third_party/cargo/vendor/quote-1.0.9/README.md similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/README.md rename to third_party/cargo/vendor/quote-1.0.9/README.md diff --git a/third_party/cargo/vendor/quote-1.0.8/src/ext.rs b/third_party/cargo/vendor/quote-1.0.9/src/ext.rs similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/src/ext.rs rename to third_party/cargo/vendor/quote-1.0.9/src/ext.rs diff --git a/third_party/cargo/vendor/quote-1.0.8/src/format.rs b/third_party/cargo/vendor/quote-1.0.9/src/format.rs similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/src/format.rs rename to third_party/cargo/vendor/quote-1.0.9/src/format.rs diff --git a/third_party/cargo/vendor/quote-1.0.8/src/ident_fragment.rs b/third_party/cargo/vendor/quote-1.0.9/src/ident_fragment.rs similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/src/ident_fragment.rs rename to third_party/cargo/vendor/quote-1.0.9/src/ident_fragment.rs diff --git a/third_party/cargo/vendor/quote-1.0.8/src/lib.rs b/third_party/cargo/vendor/quote-1.0.9/src/lib.rs similarity index 99% rename from third_party/cargo/vendor/quote-1.0.8/src/lib.rs rename to third_party/cargo/vendor/quote-1.0.9/src/lib.rs index fb09b5d..356e43a 100644 --- a/third_party/cargo/vendor/quote-1.0.8/src/lib.rs +++ b/third_party/cargo/vendor/quote-1.0.9/src/lib.rs @@ -80,9 +80,14 @@ //! }; //! ``` -#![forbid(unsafe_code)] // Quote types in rustdoc of other crates get linked to here. -#![doc(html_root_url = "https://docs.rs/quote/1.0.8")] +#![doc(html_root_url = "https://docs.rs/quote/1.0.9")] +#![allow( + clippy::doc_markdown, + clippy::missing_errors_doc, + clippy::missing_panics_doc, + clippy::module_name_repetitions +)] #[cfg(all( not(all(target_arch = "wasm32", target_os = "unknown")), diff --git a/third_party/cargo/vendor/quote-1.0.8/src/runtime.rs b/third_party/cargo/vendor/quote-1.0.9/src/runtime.rs similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/src/runtime.rs rename to third_party/cargo/vendor/quote-1.0.9/src/runtime.rs diff --git a/third_party/cargo/vendor/quote-1.0.8/src/spanned.rs b/third_party/cargo/vendor/quote-1.0.9/src/spanned.rs similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/src/spanned.rs rename to third_party/cargo/vendor/quote-1.0.9/src/spanned.rs diff --git a/third_party/cargo/vendor/quote-1.0.8/src/to_tokens.rs b/third_party/cargo/vendor/quote-1.0.9/src/to_tokens.rs similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/src/to_tokens.rs rename to third_party/cargo/vendor/quote-1.0.9/src/to_tokens.rs diff --git a/third_party/cargo/vendor/quote-1.0.8/tests/compiletest.rs b/third_party/cargo/vendor/quote-1.0.9/tests/compiletest.rs similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/tests/compiletest.rs rename to third_party/cargo/vendor/quote-1.0.9/tests/compiletest.rs diff --git a/third_party/cargo/vendor/quote-1.0.8/tests/test.rs b/third_party/cargo/vendor/quote-1.0.9/tests/test.rs similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/tests/test.rs rename to third_party/cargo/vendor/quote-1.0.9/tests/test.rs diff --git a/third_party/cargo/vendor/quote-1.0.8/tests/ui/does-not-have-iter-interpolated-dup.rs b/third_party/cargo/vendor/quote-1.0.9/tests/ui/does-not-have-iter-interpolated-dup.rs similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/tests/ui/does-not-have-iter-interpolated-dup.rs rename to third_party/cargo/vendor/quote-1.0.9/tests/ui/does-not-have-iter-interpolated-dup.rs diff --git a/third_party/cargo/vendor/quote-1.0.8/tests/ui/does-not-have-iter-interpolated.rs b/third_party/cargo/vendor/quote-1.0.9/tests/ui/does-not-have-iter-interpolated.rs similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/tests/ui/does-not-have-iter-interpolated.rs rename to third_party/cargo/vendor/quote-1.0.9/tests/ui/does-not-have-iter-interpolated.rs diff --git a/third_party/cargo/vendor/quote-1.0.8/tests/ui/does-not-have-iter-separated.rs b/third_party/cargo/vendor/quote-1.0.9/tests/ui/does-not-have-iter-separated.rs similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/tests/ui/does-not-have-iter-separated.rs rename to third_party/cargo/vendor/quote-1.0.9/tests/ui/does-not-have-iter-separated.rs diff --git a/third_party/cargo/vendor/quote-1.0.8/tests/ui/does-not-have-iter.rs b/third_party/cargo/vendor/quote-1.0.9/tests/ui/does-not-have-iter.rs similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/tests/ui/does-not-have-iter.rs rename to third_party/cargo/vendor/quote-1.0.9/tests/ui/does-not-have-iter.rs diff --git a/third_party/cargo/vendor/quote-1.0.8/tests/ui/not-quotable.rs b/third_party/cargo/vendor/quote-1.0.9/tests/ui/not-quotable.rs similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/tests/ui/not-quotable.rs rename to third_party/cargo/vendor/quote-1.0.9/tests/ui/not-quotable.rs diff --git a/third_party/cargo/vendor/quote-1.0.8/tests/ui/not-repeatable.rs b/third_party/cargo/vendor/quote-1.0.9/tests/ui/not-repeatable.rs similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/tests/ui/not-repeatable.rs rename to third_party/cargo/vendor/quote-1.0.9/tests/ui/not-repeatable.rs diff --git a/third_party/cargo/vendor/quote-1.0.8/tests/ui/wrong-type-span.rs b/third_party/cargo/vendor/quote-1.0.9/tests/ui/wrong-type-span.rs similarity index 100% rename from third_party/cargo/vendor/quote-1.0.8/tests/ui/wrong-type-span.rs rename to third_party/cargo/vendor/quote-1.0.9/tests/ui/wrong-type-span.rs diff --git a/third_party/cargo/vendor/raw-window-handle-0.3.3/BUILD.bazel b/third_party/cargo/vendor/raw-window-handle-0.3.3/BUILD.bazel index 838e0a2..39b29e2 100644 --- a/third_party/cargo/vendor/raw-window-handle-0.3.3/BUILD.bazel +++ b/third_party/cargo/vendor/raw-window-handle-0.3.3/BUILD.bazel @@ -49,6 +49,6 @@ rust_library( version = "0.3.3", # buildifier: leave-alone deps = [ - "//third_party/cargo/vendor/libc-0.2.82:libc", + "//third_party/cargo/vendor/libc-0.2.92:libc", ], ) diff --git a/third_party/cargo/vendor/rayon-core-1.9.0/BUILD.bazel b/third_party/cargo/vendor/rayon-core-1.9.0/BUILD.bazel index 9fcbbc2..bfcbd3e 100644 --- a/third_party/cargo/vendor/rayon-core-1.9.0/BUILD.bazel +++ b/third_party/cargo/vendor/rayon-core-1.9.0/BUILD.bazel @@ -55,7 +55,7 @@ rust_library( deps = [ "//third_party/cargo/vendor/crossbeam-channel-0.5.0:crossbeam_channel", "//third_party/cargo/vendor/crossbeam-deque-0.8.0:crossbeam_deque", - "//third_party/cargo/vendor/crossbeam-utils-0.8.1:crossbeam_utils", + "//third_party/cargo/vendor/crossbeam-utils-0.8.3:crossbeam_utils", "//third_party/cargo/vendor/lazy_static-1.4.0:lazy_static", "//third_party/cargo/vendor/num_cpus-1.13.0:num_cpus", ] + selects.with_or({ diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/.cargo-checksum.json b/third_party/cargo/vendor/redox_syscall-0.1.57/.cargo-checksum.json deleted file mode 100644 index 69c30b1..0000000 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"Cargo.toml":"9494475634c86ca0cfc30688aaf3e3961c0bdab1380e12a9e36597b24dece24c","LICENSE":"efcfee7981ff72431fffb06925cad00a23dce079ed4354f61030ad5abdb78829","README.md":"9161f18ba7f69b4ca51e844aee8ffb8237513a468c5c3b1f3a5f989044f895ac","src/arch/aarch64.rs":"5d9afb0813ca903cd5ac48add7f6f9b538d9e0346bc9bac0924d509d2004c07b","src/arch/arm.rs":"6f0eea58ea5dc7e87a66f335cb4264995bdf5352b379428dd0ba6a11887491a6","src/arch/nonredox.rs":"de54557f642218b34d451fc52fe3cff97e3e4307304ae02a678a900cab96cdb0","src/arch/x86.rs":"a433a3cfaf4fe2987e7516069e814f539172a1bb51d02bcfab74fa4c56dd9fdf","src/arch/x86_64.rs":"0bb1ebc3aba5d240b2ab813f6aa999b071d1230641849775d38d2074e2e4026a","src/call.rs":"b5b53aab18bb91bfef88d82f1708d05e210a30cde141fce0031dad543d988391","src/data.rs":"84f8beb9d40b753a8c1713b922e99ed9913d35e959694b2c849351b1a92d87c9","src/error.rs":"d832a641ccb1baf10315e2e1ce59b12c30d605a526fc65a31f63bb3a92c3a2f7","src/flag.rs":"1e944be3b134d3776725529e2190e2d1548dd67a631838281b8c5bc829523dbe","src/io/dma.rs":"740cd441f844718a14f77c2fe292d29b7c468d686505810d8b3281f9528a6fe7","src/io/io.rs":"1bcb36d1867e9bab6a8186cd6928efe70ae2655e9f9d0dd3def20bc0fb6a82f6","src/io/mmio.rs":"b9fdb37d37a25a48106d60f1a977c541cb5162b20b12507c7dcd6eb3dff0a2c8","src/io/mod.rs":"4df12af3e82e6b5fe22112c9f51552112ee4811b7d1131d2a43d608d8d1cac09","src/io/pio.rs":"39f4176a2995c7acfb32204b065af0ec14d7ff0d45dc51eff2679f3195c36ee2","src/lib.rs":"a5a56fa43f30d2d994075539425ffaa8da7106ccd77c3022950623eb82cd59b1","src/number.rs":"4718baa58a0f3e6b9b66d1f328cb2a145e9b1f807654c3079a13b226c4085a29","src/scheme/generate.sh":"b022adacb74f2af1470e691341c37acc1582f428e9b8b6b9dccb790dde594b40","src/scheme/mod.rs":"2679272397bf0247e1a4695853465243ca02960feb4ced1124969f67ebd3e3ce","src/scheme/scheme.rs":"879728e4d4e7d8f3057df5a3a6af1636079135652594ee50ca1b665e876be595","src/scheme/scheme_block.rs":"a8ea17b1101548e9b36f6c9000f68fd5438a796069252f948bde7dda44088a7f","src/scheme/scheme_block_mut.rs":"8b881f84a54e2477967d43eb68dac7c578ff6451dba59eba0d517037b2ac4def","src/scheme/scheme_mut.rs":"30f9b0750437b7f55d5bb24da546fd4afcb3c27b0af06d5f681b8f1c4877e7b4","src/tests.rs":"b9d60e419f7e57bb942756e8011e19704cfd46fb6ec96ffa925fb7deb35c5d43"},"package":"41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"} \ No newline at end of file diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/arch/x86_64.rs b/third_party/cargo/vendor/redox_syscall-0.1.57/src/arch/x86_64.rs deleted file mode 100644 index 425c83c..0000000 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/arch/x86_64.rs +++ /dev/null @@ -1,74 +0,0 @@ -use super::error::{Error, Result}; - -pub unsafe fn syscall0(mut a: usize) -> Result { - llvm_asm!("syscall" - : "={rax}"(a) - : "{rax}"(a) - : "rcx", "r11", "memory" - : "intel", "volatile"); - - Error::demux(a) -} - -pub unsafe fn syscall1(mut a: usize, b: usize) -> Result { - llvm_asm!("syscall" - : "={rax}"(a) - : "{rax}"(a), "{rdi}"(b) - : "rcx", "r11", "memory" - : "intel", "volatile"); - - Error::demux(a) -} - -// Clobbers all registers - special for clone -pub unsafe fn syscall1_clobber(mut a: usize, b: usize) -> Result { - llvm_asm!("syscall" - : "={rax}"(a) - : "{rax}"(a), "{rdi}"(b) - : "memory", "rbx", "rcx", "rdx", "rsi", "rdi", "r8", - "r9", "r10", "r11", "r12", "r13", "r14", "r15" - : "intel", "volatile"); - - Error::demux(a) -} - -pub unsafe fn syscall2(mut a: usize, b: usize, c: usize) -> Result { - llvm_asm!("syscall" - : "={rax}"(a) - : "{rax}"(a), "{rdi}"(b), "{rsi}"(c) - : "rcx", "r11", "memory" - : "intel", "volatile"); - - Error::demux(a) -} - -pub unsafe fn syscall3(mut a: usize, b: usize, c: usize, d: usize) -> Result { - llvm_asm!("syscall" - : "={rax}"(a) - : "{rax}"(a), "{rdi}"(b), "{rsi}"(c), "{rdx}"(d) - : "rcx", "r11", "memory" - : "intel", "volatile"); - - Error::demux(a) -} - -pub unsafe fn syscall4(mut a: usize, b: usize, c: usize, d: usize, e: usize) -> Result { - llvm_asm!("syscall" - : "={rax}"(a) - : "{rax}"(a), "{rdi}"(b), "{rsi}"(c), "{rdx}"(d), "{r10}"(e) - : "rcx", "r11", "memory" - : "intel", "volatile"); - - Error::demux(a) -} - -pub unsafe fn syscall5(mut a: usize, b: usize, c: usize, d: usize, e: usize, f: usize) - -> Result { - llvm_asm!("syscall" - : "={rax}"(a) - : "{rax}"(a), "{rdi}"(b), "{rsi}"(c), "{rdx}"(d), "{r10}"(e), "{r8}"(f) - : "rcx", "r11", "memory" - : "intel", "volatile"); - - Error::demux(a) -} diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/flag.rs b/third_party/cargo/vendor/redox_syscall-0.1.57/src/flag.rs deleted file mode 100644 index e6c4cbf..0000000 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/flag.rs +++ /dev/null @@ -1,169 +0,0 @@ -pub const CLONE_VM: usize = 0x100; -pub const CLONE_FS: usize = 0x200; -pub const CLONE_FILES: usize = 0x400; -pub const CLONE_SIGHAND: usize = 0x800; -pub const CLONE_VFORK: usize = 0x4000; -pub const CLONE_THREAD: usize = 0x10000; -pub const CLONE_STACK: usize = 0x1000_0000; - -pub const CLOCK_REALTIME: usize = 1; -pub const CLOCK_MONOTONIC: usize = 4; - -pub const EVENT_NONE: usize = 0; -pub const EVENT_READ: usize = 1; -pub const EVENT_WRITE: usize = 2; - -pub const F_DUPFD: usize = 0; -pub const F_GETFD: usize = 1; -pub const F_SETFD: usize = 2; -pub const F_GETFL: usize = 3; -pub const F_SETFL: usize = 4; - -pub const FUTEX_WAIT: usize = 0; -pub const FUTEX_WAKE: usize = 1; -pub const FUTEX_REQUEUE: usize = 2; - -pub const MAP_SHARED: usize = 0x0001; -pub const MAP_PRIVATE: usize = 0x0002; - -pub const MODE_TYPE: u16 = 0xF000; -pub const MODE_DIR: u16 = 0x4000; -pub const MODE_FILE: u16 = 0x8000; -pub const MODE_SYMLINK: u16 = 0xA000; -pub const MODE_FIFO: u16 = 0x1000; -pub const MODE_CHR: u16 = 0x2000; - -pub const MODE_PERM: u16 = 0x0FFF; -pub const MODE_SETUID: u16 = 0o4000; -pub const MODE_SETGID: u16 = 0o2000; - -pub const O_RDONLY: usize = 0x0001_0000; -pub const O_WRONLY: usize = 0x0002_0000; -pub const O_RDWR: usize = 0x0003_0000; -pub const O_NONBLOCK: usize = 0x0004_0000; -pub const O_APPEND: usize = 0x0008_0000; -pub const O_SHLOCK: usize = 0x0010_0000; -pub const O_EXLOCK: usize = 0x0020_0000; -pub const O_ASYNC: usize = 0x0040_0000; -pub const O_FSYNC: usize = 0x0080_0000; -pub const O_CLOEXEC: usize = 0x0100_0000; -pub const O_CREAT: usize = 0x0200_0000; -pub const O_TRUNC: usize = 0x0400_0000; -pub const O_EXCL: usize = 0x0800_0000; -pub const O_DIRECTORY: usize = 0x1000_0000; -pub const O_STAT: usize = 0x2000_0000; -pub const O_SYMLINK: usize = 0x4000_0000; -pub const O_NOFOLLOW: usize = 0x8000_0000; -pub const O_ACCMODE: usize = O_RDONLY | O_WRONLY | O_RDWR; - -pub const PHYSMAP_WRITE: usize = 0x0000_0001; -pub const PHYSMAP_WRITE_COMBINE: usize = 0x0000_0002; -pub const PHYSMAP_NO_CACHE: usize = 0x0000_0004; - -pub const PROT_NONE: usize = 0x0000_0000; -pub const PROT_EXEC: usize = 0x0001_0000; -pub const PROT_WRITE: usize = 0x0002_0000; -pub const PROT_READ: usize = 0x0004_0000; - -pub const PTRACE_CONT: u8 = 0b0000_0001; -pub const PTRACE_SINGLESTEP: u8 = 0b0000_0010; -pub const PTRACE_SYSCALL: u8 = 0b0000_0011; -pub const PTRACE_WAIT: u8 = 0b0000_0100; -pub const PTRACE_OPERATIONMASK: u8 = 0b0000_1111; -pub const PTRACE_SYSEMU: u8 = 0b0001_0000; - -pub const SEEK_SET: usize = 0; -pub const SEEK_CUR: usize = 1; -pub const SEEK_END: usize = 2; - -pub const SIGHUP: usize = 1; -pub const SIGINT: usize = 2; -pub const SIGQUIT: usize = 3; -pub const SIGILL: usize = 4; -pub const SIGTRAP: usize = 5; -pub const SIGABRT: usize = 6; -pub const SIGBUS: usize = 7; -pub const SIGFPE: usize = 8; -pub const SIGKILL: usize = 9; -pub const SIGUSR1: usize = 10; -pub const SIGSEGV: usize = 11; -pub const SIGUSR2: usize = 12; -pub const SIGPIPE: usize = 13; -pub const SIGALRM: usize = 14; -pub const SIGTERM: usize = 15; -pub const SIGSTKFLT: usize= 16; -pub const SIGCHLD: usize = 17; -pub const SIGCONT: usize = 18; -pub const SIGSTOP: usize = 19; -pub const SIGTSTP: usize = 20; -pub const SIGTTIN: usize = 21; -pub const SIGTTOU: usize = 22; -pub const SIGURG: usize = 23; -pub const SIGXCPU: usize = 24; -pub const SIGXFSZ: usize = 25; -pub const SIGVTALRM: usize= 26; -pub const SIGPROF: usize = 27; -pub const SIGWINCH: usize = 28; -pub const SIGIO: usize = 29; -pub const SIGPWR: usize = 30; -pub const SIGSYS: usize = 31; - -pub const SIG_DFL: usize = 0; -pub const SIG_IGN: usize = 1; - -pub const SIG_BLOCK: usize = 0; -pub const SIG_UNBLOCK: usize = 1; -pub const SIG_SETMASK: usize = 2; - -pub const SA_NOCLDSTOP: usize = 0x00000001; -pub const SA_NOCLDWAIT: usize = 0x00000002; -pub const SA_SIGINFO: usize = 0x00000004; -pub const SA_RESTORER: usize = 0x04000000; -pub const SA_ONSTACK: usize = 0x08000000; -pub const SA_RESTART: usize = 0x10000000; -pub const SA_NODEFER: usize = 0x40000000; -pub const SA_RESETHAND: usize = 0x80000000; - -pub const WNOHANG: usize = 0x01; -pub const WUNTRACED: usize = 0x02; -pub const WCONTINUED: usize = 0x08; - -/// True if status indicates the child is stopped. -pub fn wifstopped(status: usize) -> bool { - (status & 0xff) == 0x7f -} - -/// If wifstopped(status), the signal that stopped the child. -pub fn wstopsig(status: usize) -> usize { - (status >> 8) & 0xff -} - -/// True if status indicates the child continued after a stop. -pub fn wifcontinued(status: usize) -> bool { - status == 0xffff -} - -/// True if STATUS indicates termination by a signal. -pub fn wifsignaled(status: usize) -> bool { - ((status & 0x7f) + 1) as i8 >= 2 -} - -/// If wifsignaled(status), the terminating signal. -pub fn wtermsig(status: usize) -> usize { - status & 0x7f -} - -/// True if status indicates normal termination. -pub fn wifexited(status: usize) -> bool { - wtermsig(status) == 0 -} - -/// If wifexited(status), the exit status. -pub fn wexitstatus(status: usize) -> usize { - (status >> 8) & 0xff -} - -/// True if status indicates a core dump was created. -pub fn wcoredump(status: usize) -> bool { - (status & 0x80) != 0 -} diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/io/dma.rs b/third_party/cargo/vendor/redox_syscall-0.1.57/src/io/dma.rs deleted file mode 100644 index d5334b8..0000000 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/io/dma.rs +++ /dev/null @@ -1,76 +0,0 @@ -use core::{mem, ptr}; -use core::ops::{Deref, DerefMut}; - -use Result; - -struct PhysBox { - address: usize, - size: usize -} - -impl PhysBox { - fn new(size: usize) -> Result { - let address = unsafe { ::physalloc(size)? }; - Ok(PhysBox { - address: address, - size: size - }) - } -} - -impl Drop for PhysBox { - fn drop(&mut self) { - let _ = unsafe { ::physfree(self.address, self.size) }; - } -} - -pub struct Dma { - phys: PhysBox, - virt: *mut T -} - -impl Dma { - pub fn new(value: T) -> Result> { - let phys = PhysBox::new(mem::size_of::())?; - let virt = unsafe { ::physmap(phys.address, phys.size, ::PHYSMAP_WRITE)? } as *mut T; - unsafe { ptr::write(virt, value); } - Ok(Dma { - phys: phys, - virt: virt - }) - } - - pub fn zeroed() -> Result> { - let phys = PhysBox::new(mem::size_of::())?; - let virt = unsafe { ::physmap(phys.address, phys.size, ::PHYSMAP_WRITE)? } as *mut T; - unsafe { ptr::write_bytes(virt as *mut u8, 0, phys.size); } - Ok(Dma { - phys: phys, - virt: virt - }) - } - - pub fn physical(&self) -> usize { - self.phys.address - } -} - -impl Deref for Dma { - type Target = T; - fn deref(&self) -> &T { - unsafe { &*self.virt } - } -} - -impl DerefMut for Dma { - fn deref_mut(&mut self) -> &mut T { - unsafe { &mut *self.virt } - } -} - -impl Drop for Dma { - fn drop(&mut self) { - unsafe { drop(ptr::read(self.virt)); } - let _ = unsafe { ::physunmap(self.virt as usize) }; - } -} diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/io/mmio.rs b/third_party/cargo/vendor/redox_syscall-0.1.57/src/io/mmio.rs deleted file mode 100644 index b8e7727..0000000 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/io/mmio.rs +++ /dev/null @@ -1,31 +0,0 @@ -use core::ptr::{read_volatile, write_volatile}; -use core::mem::uninitialized; -use core::ops::{BitAnd, BitOr, Not}; - -use super::io::Io; - -#[repr(packed)] -pub struct Mmio { - value: T, -} - -impl Mmio { - /// Create a new Mmio without initializing - pub fn new() -> Self { - Mmio { - value: unsafe { uninitialized() } - } - } -} - -impl Io for Mmio where T: Copy + PartialEq + BitAnd + BitOr + Not { - type Value = T; - - fn read(&self) -> T { - unsafe { read_volatile(&self.value) } - } - - fn write(&mut self, value: T) { - unsafe { write_volatile(&mut self.value, value) }; - } -} diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/tests.rs b/third_party/cargo/vendor/redox_syscall-0.1.57/src/tests.rs deleted file mode 100644 index cf89ec9..0000000 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/tests.rs +++ /dev/null @@ -1,129 +0,0 @@ -#[test] -fn brk() { - unsafe { - let start = dbg!(crate::brk(0)).unwrap(); - let end = start + 4 * 1024 * 1024; - assert_eq!(dbg!(crate::brk(end)), Ok(end)); - } -} - -#[test] -fn chdir() { - //TODO: Verify CWD - assert_eq!(dbg!(crate::chdir("file:/")), Ok(0)); - assert_eq!(dbg!(crate::chdir("file:/root")), Ok(0)); -} - -//TODO: chmod - -#[test] -fn clone() { - let expected_status = 42; - let pid_res = unsafe { crate::clone(0) }; - if pid_res == Ok(0) { - crate::exit(expected_status).unwrap(); - panic!("failed to exit"); - } else { - let pid = dbg!(pid_res).unwrap(); - let mut status = 0; - assert_eq!(dbg!(crate::waitpid(pid, &mut status, 0)), Ok(pid)); - assert_eq!(dbg!(crate::wifexited(status)), true); - assert_eq!(dbg!(crate::wexitstatus(status)), expected_status); - } -} - -//TODO: close - -#[test] -fn clock_gettime() { - let mut tp = crate::TimeSpec::default(); - assert_eq!(dbg!( - crate::clock_gettime(crate::CLOCK_MONOTONIC, &mut tp) - ), Ok(0)); - assert_ne!(dbg!(tp), crate::TimeSpec::default()); - - tp = crate::TimeSpec::default(); - assert_eq!(dbg!( - crate::clock_gettime(crate::CLOCK_REALTIME, &mut tp) - ), Ok(0)); - assert_ne!(dbg!(tp), crate::TimeSpec::default()); -} - -//TODO: dup - -//TODO: dup2 - -//TODO: exit (handled by clone?) - -//TODO: fchmod - -//TODO: fcntl - -#[test] -fn fexec() { - let name = "/bin/ls"; - - let fd = dbg!( - crate::open(name, crate::O_RDONLY | crate::O_CLOEXEC) - ).unwrap(); - - let args = &[ - [name.as_ptr() as usize, name.len()] - ]; - - let vars = &[]; - - let pid_res = unsafe { crate::clone(0) }; - if pid_res == Ok(0) { - crate::fexec(fd, args, vars).unwrap(); - panic!("failed to fexec"); - } else { - assert_eq!(dbg!(crate::close(fd)), Ok(0)); - - let pid = dbg!(pid_res).unwrap(); - let mut status = 0; - assert_eq!(dbg!(crate::waitpid(pid, &mut status, 0)), Ok(pid)); - assert_eq!(dbg!(crate::wifexited(status)), true); - assert_eq!(dbg!(crate::wexitstatus(status)), 0); - } -} - -#[test] -fn fmap() { - use std::slice; - - let fd = dbg!( - crate::open( - "/tmp/syscall-tests-fmap", - crate::O_CREAT | crate::O_RDWR | crate::O_CLOEXEC - ) - ).unwrap(); - - let map = unsafe { - slice::from_raw_parts_mut( - dbg!( - crate::fmap(fd, &crate::Map { - offset: 0, - size: 128, - flags: crate::PROT_READ | crate::PROT_WRITE - }) - ).unwrap() as *mut u8, - 128 - ) - }; - - // Maps should be available after closing - assert_eq!(dbg!(crate::close(fd)), Ok(0)); - - for i in 0..128 { - map[i as usize] = i; - assert_eq!(map[i as usize], i); - } - - //TODO: add msync - unsafe { - assert_eq!(dbg!( - crate::funmap(map.as_mut_ptr() as usize) - ), Ok(0)); - } -} diff --git a/third_party/cargo/vendor/redox_syscall-0.2.5/.cargo-checksum.json b/third_party/cargo/vendor/redox_syscall-0.2.5/.cargo-checksum.json new file mode 100644 index 0000000..afd55c0 --- /dev/null +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"fa6c6b799f96f2dc4a8bb00dfcdbe55b1a50e012b4f4cc8218ff190f3433d974","LICENSE":"efcfee7981ff72431fffb06925cad00a23dce079ed4354f61030ad5abdb78829","README.md":"9161f18ba7f69b4ca51e844aee8ffb8237513a468c5c3b1f3a5f989044f895ac","src/arch/aarch64.rs":"7dade48302d4fc691cae48499cf91d7676ef8c82efe2270f17aee0fe2611f3ec","src/arch/arm.rs":"abc547bd2be32ff15f35032452e645668ec5050d2540e2dca073fc5670ca1a75","src/arch/nonredox.rs":"9eac0fa2cf9eae07f0cafa2dd63c4a820791897a3de9ad1a933ab4f53458dbd8","src/arch/x86.rs":"3a517a8f0a70ae1b513d7a44e7399ce47a2ca7aca72a8200662b9800b41455d6","src/arch/x86_64.rs":"ae2cec2079a36d3d3676c2431a55f19365d58545ed72748588679982a6619ab2","src/call.rs":"0d3e32e33ecdf75963e5d244f9e86e94047d155c5de5fa3c0085faf18ed97b33","src/data.rs":"bd4545d4c2fcc59ff26ae52ad7f773a697d5ccf639a2ffc253cece6b31e94d51","src/error.rs":"ef20f3817f997a1aeb7114628407f19cb8bc13c555d4e093918f38a5d098f798","src/flag.rs":"fbb6992383e68100339d854f15a1e7c6586474fac34d3b816778926f0809a015","src/io/dma.rs":"fbc46e924d5913f5a3fb723751d7a9dd1b079ccf058500fde4957aaf9fa7dd1c","src/io/io.rs":"1bcb36d1867e9bab6a8186cd6928efe70ae2655e9f9d0dd3def20bc0fb6a82f6","src/io/mmio.rs":"c71a956f57554b126080b14378f235f9e98c994648ba524231ceae841326251f","src/io/mod.rs":"4df12af3e82e6b5fe22112c9f51552112ee4811b7d1131d2a43d608d8d1cac09","src/io/pio.rs":"39f4176a2995c7acfb32204b065af0ec14d7ff0d45dc51eff2679f3195c36ee2","src/lib.rs":"8fbacb97f56059fbd32067d6c065f95189d2eb11bc9913f98609430ec94bf9fa","src/number.rs":"fe7b47b06566aa1f8a75f50b685801259df03a1a5c85b91817b4552583cd7862","src/scheme/generate.sh":"dde4e30f4e0223fb1a24ed486a6c36e624c854dbf890862cb6866f4fa3c7a6eb","src/scheme/mod.rs":"cb622405deb0aef4ab04499ea1adfd338c9c5dd9c31a1fe9989786dbf69b49d8","src/scheme/scheme.rs":"30263996f0b4930edd76dace5f5750e48229066bc888bc13365846688d0a870b","src/scheme/scheme_block.rs":"b7a761e4349eb87d106c8af14894e8c4272769b9eb235cd500b075ac1f823683","src/scheme/scheme_block_mut.rs":"4a4fc03bce14757b64006b9bc3fa2779e95382b2d99579870146ee0c3be3f46c","src/scheme/scheme_mut.rs":"e6f0671b77f1bf5263e497c69dec553352249b75d52af62ac19477ba5127f803","src/scheme/seek.rs":"94e044de47b0f00eb0c2aea3fb21001ac2b9aa1e4b20d73fd54163fe92fa63f7","src/tests.rs":"ea460f580116575890031a48fbfa101db75b191ef6b2aebfeab11dbb866091c3"},"package":"94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9"} \ No newline at end of file diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/BUILD.bazel b/third_party/cargo/vendor/redox_syscall-0.2.5/BUILD.bazel similarity index 91% rename from third_party/cargo/vendor/redox_syscall-0.1.57/BUILD.bazel rename to third_party/cargo/vendor/redox_syscall-0.2.5/BUILD.bazel index 63244f7..a2a587d 100644 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/BUILD.bazel +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/BUILD.bazel @@ -47,7 +47,7 @@ rust_library( crate_root = "src/lib.rs", crate_type = "lib", data = [], - edition = "2015", + edition = "2018", rustc_flags = [ "--cap-lints=allow", ], @@ -55,8 +55,9 @@ rust_library( "cargo-raze", "manual", ], - version = "0.1.57", + version = "0.2.5", # buildifier: leave-alone deps = [ + "//third_party/cargo/vendor/bitflags-1.2.1:bitflags", ], ) diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/Cargo.toml b/third_party/cargo/vendor/redox_syscall-0.2.5/Cargo.toml similarity index 91% rename from third_party/cargo/vendor/redox_syscall-0.1.57/Cargo.toml rename to third_party/cargo/vendor/redox_syscall-0.2.5/Cargo.toml index 1f8782c..43317fd 100644 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/Cargo.toml +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/Cargo.toml @@ -11,8 +11,9 @@ # will likely look very different (and much more reasonable) [package] +edition = "2018" name = "redox_syscall" -version = "0.1.57" +version = "0.2.5" authors = ["Jeremy Soller "] description = "A Rust library to access raw Redox system calls" documentation = "https://docs.rs/redox_syscall" @@ -21,3 +22,5 @@ repository = "https://gitlab.redox-os.org/redox-os/syscall" [lib] name = "syscall" +[dependencies.bitflags] +version = "1.1.0" diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/LICENSE b/third_party/cargo/vendor/redox_syscall-0.2.5/LICENSE similarity index 100% rename from third_party/cargo/vendor/redox_syscall-0.1.57/LICENSE rename to third_party/cargo/vendor/redox_syscall-0.2.5/LICENSE diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/README.md b/third_party/cargo/vendor/redox_syscall-0.2.5/README.md similarity index 100% rename from third_party/cargo/vendor/redox_syscall-0.1.57/README.md rename to third_party/cargo/vendor/redox_syscall-0.2.5/README.md diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/arch/aarch64.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/arch/aarch64.rs similarity index 75% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/arch/aarch64.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/arch/aarch64.rs index 33715a3..23abe49 100644 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/arch/aarch64.rs +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/arch/aarch64.rs @@ -20,21 +20,6 @@ pub unsafe fn syscall1(mut a: usize, b: usize) -> Result { Error::demux(a) } -// Clobbers all registers - special for clone -pub unsafe fn syscall1_clobber(mut a: usize, b: usize) -> Result { - llvm_asm!("svc 0" - : "={x0}"(a) - : "{x8}"(a), "{x0}"(b) - : "memory", - "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", - "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", - "x16", "x17","x18", "x19", "x20", "x21", "x22", "x23", - "x24", "x25", "x26", "x27", "x28", "x29", "x30" - : "volatile"); - - Error::demux(a) -} - pub unsafe fn syscall2(mut a: usize, b: usize, c: usize) -> Result { llvm_asm!("svc 0" : "={x0}"(a) diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/arch/arm.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/arch/arm.rs similarity index 83% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/arch/arm.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/arch/arm.rs index fb852d8..cec4174 100644 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/arch/arm.rs +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/arch/arm.rs @@ -20,17 +20,6 @@ pub unsafe fn syscall1(mut a: usize, b: usize) -> Result { Error::demux(a) } -// Clobbers all registers - special for clone -pub unsafe fn syscall1_clobber(mut a: usize, b: usize) -> Result { - llvm_asm!("swi $$0" - : "={r0}"(a) - : "{r7}"(a), "{r0}"(b) - : "memory", "r0", "r1", "r2", "r3", "r4" - : "volatile"); - - Error::demux(a) -} - pub unsafe fn syscall2(mut a: usize, b: usize, c: usize) -> Result { llvm_asm!("swi $$0" : "={r0}"(a) diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/arch/nonredox.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/arch/nonredox.rs similarity index 83% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/arch/nonredox.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/arch/nonredox.rs index c99d41a..f99a714 100644 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/arch/nonredox.rs +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/arch/nonredox.rs @@ -8,11 +8,6 @@ pub unsafe fn syscall1(_a: usize, _b: usize) -> Result { Err(Error::new(ENOSYS)) } -// Clobbers all registers - special for clone -pub unsafe fn syscall1_clobber(_a: usize, _b: usize) -> Result { - Err(Error::new(ENOSYS)) -} - pub unsafe fn syscall2(_a: usize, _b: usize, _c: usize) -> Result { Err(Error::new(ENOSYS)) } diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/arch/x86.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/arch/x86.rs similarity index 83% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/arch/x86.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/arch/x86.rs index 93e3e58..40a9493 100644 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/arch/x86.rs +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/arch/x86.rs @@ -20,17 +20,6 @@ pub unsafe fn syscall1(mut a: usize, b: usize) -> Result { Error::demux(a) } -// Clobbers all registers - special for clone -pub unsafe fn syscall1_clobber(mut a: usize, b: usize) -> Result { - llvm_asm!("int 0x80" - : "={eax}"(a) - : "{eax}"(a), "{ebx}"(b) - : "memory", "ebx", "ecx", "edx", "esi", "edi" - : "intel", "volatile"); - - Error::demux(a) -} - pub unsafe fn syscall2(mut a: usize, b: usize, c: usize) -> Result { llvm_asm!("int 0x80" : "={eax}"(a) diff --git a/third_party/cargo/vendor/redox_syscall-0.2.5/src/arch/x86_64.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/arch/x86_64.rs new file mode 100644 index 0000000..3f96e2a --- /dev/null +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/arch/x86_64.rs @@ -0,0 +1,130 @@ +use core::{mem, slice}; +use core::ops::{Deref, DerefMut}; + +use super::error::{Error, Result}; + +macro_rules! syscall { + ($($name:ident($a:ident, $($b:ident, $($c:ident, $($d:ident, $($e:ident, $($f:ident, )?)?)?)?)?);)+) => { + $( + pub unsafe fn $name(mut $a: usize, $($b: usize, $($c: usize, $($d: usize, $($e: usize, $($f: usize)?)?)?)?)?) -> Result { + asm!( + "syscall", + inout("rax") $a, + $( + in("rdi") $b, + $( + in("rsi") $c, + $( + in("rdx") $d, + $( + in("r10") $e, + $( + in("r8") $f, + )? + )? + )? + )? + )? + out("rcx") _, + out("r11") _, + options(nostack), + ); + + Error::demux($a) + } + )+ + }; +} + +syscall! { + syscall0(a,); + syscall1(a, b,); + syscall2(a, b, c,); + syscall3(a, b, c, d,); + syscall4(a, b, c, d, e,); + syscall5(a, b, c, d, e, f,); +} + +#[derive(Copy, Clone, Debug, Default)] +#[repr(C)] +pub struct IntRegisters { + // TODO: Some of these don't get set by Redox yet. Should they? + + pub r15: usize, + pub r14: usize, + pub r13: usize, + pub r12: usize, + pub rbp: usize, + pub rbx: usize, + pub r11: usize, + pub r10: usize, + pub r9: usize, + pub r8: usize, + pub rax: usize, + pub rcx: usize, + pub rdx: usize, + pub rsi: usize, + pub rdi: usize, + // pub orig_rax: usize, + pub rip: usize, + pub cs: usize, + pub rflags: usize, + pub rsp: usize, + pub ss: usize, + // pub fs_base: usize, + // pub gs_base: usize, + // pub ds: usize, + // pub es: usize, + pub fs: usize, + // pub gs: usize +} + +impl Deref for IntRegisters { + type Target = [u8]; + fn deref(&self) -> &[u8] { + unsafe { + slice::from_raw_parts(self as *const IntRegisters as *const u8, mem::size_of::()) + } + } +} + +impl DerefMut for IntRegisters { + fn deref_mut(&mut self) -> &mut [u8] { + unsafe { + slice::from_raw_parts_mut(self as *mut IntRegisters as *mut u8, mem::size_of::()) + } + } +} + +#[derive(Clone, Copy, Debug, Default)] +#[repr(packed)] +pub struct FloatRegisters { + pub fcw: u16, + pub fsw: u16, + pub ftw: u8, + pub _reserved: u8, + pub fop: u16, + pub fip: u64, + pub fdp: u64, + pub mxcsr: u32, + pub mxcsr_mask: u32, + pub st_space: [u128; 8], + pub xmm_space: [u128; 16] +} + +impl Deref for FloatRegisters { + type Target = [u8]; + fn deref(&self) -> &[u8] { + unsafe { + slice::from_raw_parts(self as *const FloatRegisters as *const u8, mem::size_of::()) + } + } +} + +impl DerefMut for FloatRegisters { + fn deref_mut(&mut self) -> &mut [u8] { + unsafe { + slice::from_raw_parts_mut(self as *mut FloatRegisters as *mut u8, mem::size_of::()) + } + } +} diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/call.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/call.rs similarity index 79% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/call.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/call.rs index 8b56541..f6eb89c 100644 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/call.rs +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/call.rs @@ -1,6 +1,7 @@ use super::arch::*; use super::data::{Map, SigAction, Stat, StatVfs, TimeSpec}; use super::error::Result; +use super::flag::*; use super::number::*; use core::{mem, ptr}; @@ -11,20 +12,6 @@ extern "C" fn restorer() -> ! { unreachable!(); } -/// Set the end of the process's heap -/// -/// When `addr` is `0`, this function will return the current break. -/// -/// When `addr` is nonzero, this function will attempt to set the end of the process's -/// heap to `addr` and return the new program break. The new program break should be -/// checked by the allocator, it may not be exactly `addr`, as it may be aligned to a page -/// boundary. -/// -/// On error, `Err(ENOMEM)` will be returned indicating that no memory is available -pub unsafe fn brk(addr: usize) -> Result { - syscall1(SYS_BRK, addr) -} - /// Change the process's working directory /// /// This function will attempt to set the process's working directory to `path`, which can be @@ -39,7 +26,7 @@ pub unsafe fn brk(addr: usize) -> Result { /// * `EIO` - an I/O error occurred /// * `ENOENT` - `path` does not exit /// * `ENOTDIR` - `path` is not a directory -pub fn chdir>(path: T) -> Result { +pub fn chdir>(path: T) -> Result { unsafe { syscall2(SYS_CHDIR, path.as_ref().as_ptr() as usize, path.as_ref().len()) } } @@ -47,13 +34,13 @@ pub fn chdir>(path: T) -> Result { since = "0.1.55", note = "use fchmod instead" )] -pub fn chmod>(path: T, mode: usize) -> Result { +pub fn chmod>(path: T, mode: usize) -> Result { unsafe { syscall3(SYS_CHMOD, path.as_ref().as_ptr() as usize, path.as_ref().len(), mode) } } /// Produce a fork of the current process, or a new process thread -pub unsafe fn clone(flags: usize) -> Result { - syscall1_clobber(SYS_CLONE, flags) +pub unsafe fn clone(flags: CloneFlags) -> Result { + syscall1(SYS_CLONE, flags.bits()) } /// Close a file @@ -103,14 +90,23 @@ pub fn fexec(fd: usize, args: &[[usize; 2]], vars: &[[usize; 2]]) -> Result Result { syscall3(SYS_FMAP, fd, map as *const Map as usize, mem::size_of::()) } -/// Unmap a memory-mapped file -pub unsafe fn funmap(addr: usize) -> Result { - syscall1(SYS_FUNMAP, addr) +/// Unmap whole (or partial) continous memory-mapped files +pub unsafe fn funmap(addr: usize, len: usize) -> Result { + syscall2(SYS_FUNMAP, addr, len) } /// Retrieve the canonical path of a file @@ -119,7 +115,7 @@ pub fn fpath(fd: usize, buf: &mut [u8]) -> Result { } /// Rename a file -pub fn frename>(fd: usize, path: T) -> Result { +pub fn frename>(fd: usize, path: T) -> Result { unsafe { syscall3(SYS_FRENAME, fd, path.as_ref().as_ptr() as usize, path.as_ref().len()) } } @@ -235,8 +231,8 @@ pub fn mkns(schemes: &[[usize; 2]]) -> Result { } /// Change mapping flags -pub unsafe fn mprotect(addr: usize, size: usize, flags: usize) -> Result { - syscall3(SYS_MPROTECT, addr, size, flags) +pub unsafe fn mprotect(addr: usize, size: usize, flags: MapFlags) -> Result { + syscall3(SYS_MPROTECT, addr, size, flags.bits()) } /// Sleep for the time specified in `req` @@ -246,11 +242,11 @@ pub fn nanosleep(req: &TimeSpec, rem: &mut TimeSpec) -> Result { } /// Open a file -pub fn open>(path: T, flags: usize) -> Result { +pub fn open>(path: T, flags: usize) -> Result { unsafe { syscall3(SYS_OPEN, path.as_ref().as_ptr() as usize, path.as_ref().len(), flags) } } -/// Allocate pages, linearly in physical memory +/// Allocate frames, linearly in physical memory. /// /// # Errors /// @@ -260,6 +256,37 @@ pub unsafe fn physalloc(size: usize) -> Result { syscall1(SYS_PHYSALLOC, size) } +/// Allocate frames, linearly in physical memory, with an extra set of flags. If the flags contain +/// [`PARTIAL_ALLOC`], this will result in `physalloc3` with `min = 1`. +/// +/// Refer to the simpler [`physalloc`] and the more complex [`physalloc3`], that this convenience +/// function is based on. +/// +/// # Errors +/// +/// * `EPERM` - `uid != 0` +/// * `ENOMEM` - the system has run out of available memory +pub unsafe fn physalloc2(size: usize, flags: usize) -> Result { + let mut ret = 1usize; + physalloc3(size, flags, &mut ret) +} + +/// Allocate frames, linearly in physical memory, with an extra set of flags. If the flags contain +/// [`PARTIAL_ALLOC`], the `min` parameter specifies the number of frames that have to be allocated +/// for this operation to succeed. The return value is the offset of the first frame, and `min` is +/// overwritten with the number of frames actually allocated. +/// +/// Refer to the simpler [`physalloc`] and the simpler library function [`physalloc2`]. +/// +/// # Errors +/// +/// * `EPERM` - `uid != 0` +/// * `ENOMEM` - the system has run out of available memory +/// * `EINVAL` - `min = 0` +pub unsafe fn physalloc3(size: usize, flags: usize, min: &mut usize) -> Result { + syscall3(SYS_PHYSALLOC3, size, flags, min as *mut usize as usize) +} + /// Free physically allocated pages /// /// # Errors @@ -274,8 +301,8 @@ pub unsafe fn physfree(physical_address: usize, size: usize) -> Result { /// # Errors /// /// * `EPERM` - `uid != 0` -pub unsafe fn physmap(physical_address: usize, size: usize, flags: usize) -> Result { - syscall3(SYS_PHYSMAP, physical_address, size, flags) +pub unsafe fn physmap(physical_address: usize, size: usize, flags: PhysmapFlags) -> Result { + syscall3(SYS_PHYSMAP, physical_address, size, flags.bits()) } /// Unmap previously mapped physical memory @@ -299,7 +326,7 @@ pub fn read(fd: usize, buf: &mut [u8]) -> Result { } /// Remove a directory -pub fn rmdir>(path: T) -> Result { +pub fn rmdir>(path: T) -> Result { unsafe { syscall2(SYS_RMDIR, path.as_ref().as_ptr() as usize, path.as_ref().len()) } } @@ -349,7 +376,7 @@ pub fn umask(mask: usize) -> Result { } /// Remove a file -pub fn unlink>(path: T) -> Result { +pub fn unlink>(path: T) -> Result { unsafe { syscall2(SYS_UNLINK, path.as_ref().as_ptr() as usize, path.as_ref().len()) } } @@ -363,8 +390,8 @@ pub unsafe fn virttophys(virtual_address: usize) -> Result { } /// Check if a child process has exited or received a signal -pub fn waitpid(pid: usize, status: &mut usize, options: usize) -> Result { - unsafe { syscall3(SYS_WAITPID, pid, status as *mut usize as usize, options) } +pub fn waitpid(pid: usize, status: &mut usize, options: WaitFlags) -> Result { + unsafe { syscall3(SYS_WAITPID, pid, status as *mut usize as usize, options.bits()) } } /// Write a buffer to a file descriptor diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/data.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/data.rs similarity index 62% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/data.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/data.rs index f2290e0..45d2dd8 100644 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/data.rs +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/data.rs @@ -1,11 +1,12 @@ use core::ops::{Deref, DerefMut}; use core::{mem, slice}; +use crate::flag::{EventFlags, MapFlags, PtraceFlags, SigActionFlags}; #[derive(Copy, Clone, Debug, Default)] #[repr(C)] pub struct Event { pub id: usize, - pub flags: usize, + pub flags: EventFlags, pub data: usize } @@ -13,7 +14,7 @@ impl Deref for Event { type Target = [u8]; fn deref(&self) -> &[u8] { unsafe { - slice::from_raw_parts(self as *const Event as *const u8, mem::size_of::()) as &[u8] + slice::from_raw_parts(self as *const Event as *const u8, mem::size_of::()) } } } @@ -21,7 +22,7 @@ impl Deref for Event { impl DerefMut for Event { fn deref_mut(&mut self) -> &mut [u8] { unsafe { - slice::from_raw_parts_mut(self as *mut Event as *mut u8, mem::size_of::()) as &mut [u8] + slice::from_raw_parts_mut(self as *mut Event as *mut u8, mem::size_of::()) } } } @@ -38,7 +39,7 @@ impl Deref for ITimerSpec { fn deref(&self) -> &[u8] { unsafe { slice::from_raw_parts(self as *const ITimerSpec as *const u8, - mem::size_of::()) as &[u8] + mem::size_of::()) } } } @@ -47,24 +48,58 @@ impl DerefMut for ITimerSpec { fn deref_mut(&mut self) -> &mut [u8] { unsafe { slice::from_raw_parts_mut(self as *mut ITimerSpec as *mut u8, - mem::size_of::()) as &mut [u8] + mem::size_of::()) } } } #[derive(Copy, Clone, Debug, Default)] #[repr(C)] -pub struct Map { +pub struct OldMap { pub offset: usize, pub size: usize, - pub flags: usize, + pub flags: MapFlags, +} + +impl Deref for OldMap { + type Target = [u8]; + fn deref(&self) -> &[u8] { + unsafe { + slice::from_raw_parts(self as *const OldMap as *const u8, mem::size_of::()) + } + } +} + +impl DerefMut for OldMap { + fn deref_mut(&mut self) -> &mut [u8] { + unsafe { + slice::from_raw_parts_mut(self as *mut OldMap as *mut u8, mem::size_of::()) + } + } +} +#[derive(Copy, Clone, Debug, Default)] +#[repr(C)] +pub struct Map { + /// The offset inside the file that is being mapped. + pub offset: usize, + + /// The size of the memory map. + pub size: usize, + + /// Contains both prot and map flags. + pub flags: MapFlags, + + /// Functions as a hint to where in the virtual address space of the running process, to place + /// the memory map. If [`MapFlags::MAP_FIXED`] is set, then this address must be the address to + /// map to. + pub address: usize, } impl Deref for Map { type Target = [u8]; fn deref(&self) -> &[u8] { unsafe { - slice::from_raw_parts(self as *const Map as *const u8, mem::size_of::()) as &[u8] + slice::from_raw_parts(self as *const Map as *const u8, mem::size_of::()) } } } @@ -72,7 +107,7 @@ impl Deref for Map { impl DerefMut for Map { fn deref_mut(&mut self) -> &mut [u8] { unsafe { - slice::from_raw_parts_mut(self as *mut Map as *mut u8, mem::size_of::()) as &mut [u8] + slice::from_raw_parts_mut(self as *mut Map as *mut u8, mem::size_of::()) } } } @@ -94,7 +129,7 @@ impl Deref for Packet { type Target = [u8]; fn deref(&self) -> &[u8] { unsafe { - slice::from_raw_parts(self as *const Packet as *const u8, mem::size_of::()) as &[u8] + slice::from_raw_parts(self as *const Packet as *const u8, mem::size_of::()) } } } @@ -102,30 +137,29 @@ impl Deref for Packet { impl DerefMut for Packet { fn deref_mut(&mut self) -> &mut [u8] { unsafe { - slice::from_raw_parts_mut(self as *mut Packet as *mut u8, mem::size_of::()) as &mut [u8] + slice::from_raw_parts_mut(self as *mut Packet as *mut u8, mem::size_of::()) } } } -#[derive(Copy, Clone, Debug)] +#[derive(Copy, Clone, Debug, Default, PartialEq)] #[repr(C)] pub struct SigAction { - pub sa_handler: extern "C" fn(usize), + pub sa_handler: Option, pub sa_mask: [u64; 2], - pub sa_flags: usize, + pub sa_flags: SigActionFlags, } -impl Default for SigAction { - fn default() -> Self { - Self { - sa_handler: unsafe { mem::transmute(0usize) }, - sa_mask: [0; 2], - sa_flags: 0, - } - } +#[allow(dead_code)] +unsafe fn _assert_size_of_function_is_sane() { + // Transmuting will complain *at compile time* if sizes differ. + // Rust forbids a fn-pointer from being 0 so to allow SIG_DFL to + // exist, we use Option which will mean 0 + // becomes None + let _ = mem::transmute::, usize>(None); } -#[derive(Copy, Clone, Debug, Default)] +#[derive(Copy, Clone, Debug, Default, PartialEq)] #[repr(C)] pub struct Stat { pub st_dev: u64, @@ -150,7 +184,7 @@ impl Deref for Stat { fn deref(&self) -> &[u8] { unsafe { slice::from_raw_parts(self as *const Stat as *const u8, - mem::size_of::()) as &[u8] + mem::size_of::()) } } } @@ -159,12 +193,12 @@ impl DerefMut for Stat { fn deref_mut(&mut self) -> &mut [u8] { unsafe { slice::from_raw_parts_mut(self as *mut Stat as *mut u8, - mem::size_of::()) as &mut [u8] + mem::size_of::()) } } } -#[derive(Copy, Clone, Debug, Default)] +#[derive(Copy, Clone, Debug, Default, PartialEq)] #[repr(C)] pub struct StatVfs { pub f_bsize: u32, @@ -178,7 +212,7 @@ impl Deref for StatVfs { fn deref(&self) -> &[u8] { unsafe { slice::from_raw_parts(self as *const StatVfs as *const u8, - mem::size_of::()) as &[u8] + mem::size_of::()) } } } @@ -187,7 +221,7 @@ impl DerefMut for StatVfs { fn deref_mut(&mut self) -> &mut [u8] { unsafe { slice::from_raw_parts_mut(self as *mut StatVfs as *mut u8, - mem::size_of::()) as &mut [u8] + mem::size_of::()) } } } @@ -204,7 +238,7 @@ impl Deref for TimeSpec { fn deref(&self) -> &[u8] { unsafe { slice::from_raw_parts(self as *const TimeSpec as *const u8, - mem::size_of::()) as &[u8] + mem::size_of::()) } } } @@ -213,97 +247,51 @@ impl DerefMut for TimeSpec { fn deref_mut(&mut self) -> &mut [u8] { unsafe { slice::from_raw_parts_mut(self as *mut TimeSpec as *mut u8, - mem::size_of::()) as &mut [u8] + mem::size_of::()) } } } -#[derive(Copy, Clone, Debug, Default)] +#[derive(Clone, Copy, Debug, Default)] #[repr(C)] -#[cfg(target_arch = "x86_64")] -pub struct IntRegisters { - pub r15: usize, - pub r14: usize, - pub r13: usize, - pub r12: usize, - pub rbp: usize, - pub rbx: usize, - pub r11: usize, - pub r10: usize, - pub r9: usize, - pub r8: usize, - pub rax: usize, - pub rcx: usize, - pub rdx: usize, - pub rsi: usize, - pub rdi: usize, - // pub orig_rax: usize, - pub rip: usize, - pub cs: usize, - pub eflags: usize, - pub rsp: usize, - pub ss: usize, - pub fs_base: usize, - pub gs_base: usize, - pub ds: usize, - pub es: usize, - pub fs: usize, - pub gs: usize +pub struct PtraceEvent { + pub cause: PtraceFlags, + pub a: usize, + pub b: usize, + pub c: usize, + pub d: usize, + pub e: usize, + pub f: usize } -impl Deref for IntRegisters { +impl Deref for PtraceEvent { type Target = [u8]; fn deref(&self) -> &[u8] { unsafe { - slice::from_raw_parts(self as *const IntRegisters as *const u8, mem::size_of::()) as &[u8] + slice::from_raw_parts(self as *const PtraceEvent as *const u8, mem::size_of::()) } } } -impl DerefMut for IntRegisters { +impl DerefMut for PtraceEvent { fn deref_mut(&mut self) -> &mut [u8] { unsafe { - slice::from_raw_parts_mut(self as *mut IntRegisters as *mut u8, mem::size_of::()) as &mut [u8] + slice::from_raw_parts_mut(self as *mut PtraceEvent as *mut u8, mem::size_of::()) } } } -#[derive(Clone, Copy)] -#[repr(C)] -#[cfg(target_arch = "x86_64")] -pub struct FloatRegisters { - 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_space: [u32; 32], - pub xmm_space: [u32; 64] -} - -impl Default for FloatRegisters { - fn default() -> Self { - // xmm_space is not Default until const generics - unsafe { mem::zeroed() } - } -} - -impl Deref for FloatRegisters { - type Target = [u8]; - fn deref(&self) -> &[u8] { - unsafe { - slice::from_raw_parts(self as *const FloatRegisters as *const u8, mem::size_of::()) as &[u8] - } - } -} - -impl DerefMut for FloatRegisters { - fn deref_mut(&mut self) -> &mut [u8] { - unsafe { - slice::from_raw_parts_mut(self as *mut FloatRegisters as *mut u8, mem::size_of::()) as &mut [u8] +#[macro_export] +macro_rules! ptrace_event { + ($cause:expr $(, $a:expr $(, $b:expr $(, $c:expr)?)?)?) => { + $crate::data::PtraceEvent { + cause: $cause, + $(a: $a, + $(b: $b, + $(c: $c,)? + )? + )? + ..Default::default() } } } diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/error.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/error.rs similarity index 99% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/error.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/error.rs index fde4796..9a4b0b5 100644 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/error.rs +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/error.rs @@ -5,7 +5,7 @@ pub struct Error { pub errno: i32, } -pub type Result = result::Result; +pub type Result = result::Result; impl Error { pub fn new(errno: i32) -> Error { diff --git a/third_party/cargo/vendor/redox_syscall-0.2.5/src/flag.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/flag.rs new file mode 100644 index 0000000..d831f1f --- /dev/null +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/flag.rs @@ -0,0 +1,345 @@ +use bitflags::bitflags as inner_bitflags; +use core::{mem, ops::Deref, slice}; + +macro_rules! bitflags { + ( + $(#[$outer:meta])* + pub struct $BitFlags:ident: $T:ty { + $( + $(#[$inner:ident $($args:tt)*])* + const $Flag:ident = $value:expr; + )+ + } + ) => { + // First, use the inner bitflags + inner_bitflags! { + #[derive(Default)] + $(#[$outer])* + pub struct $BitFlags: $T { + $( + $(#[$inner $($args)*])* + const $Flag = $value; + )+ + } + } + + // Secondly, re-export all inner constants + // (`pub use self::Struct::*` doesn't work) + $( + $(#[$inner $($args)*])* + pub const $Flag: $BitFlags = $BitFlags::$Flag; + )+ + } +} + +bitflags! { + pub struct CloneFlags: usize { + const CLONE_VM = 0x100; + const CLONE_FS = 0x200; + const CLONE_FILES = 0x400; + const CLONE_SIGHAND = 0x800; + const CLONE_VFORK = 0x4000; + const CLONE_THREAD = 0x10000; + const CLONE_STACK = 0x1000_0000; + } +} + +pub const CLOCK_REALTIME: usize = 1; +pub const CLOCK_MONOTONIC: usize = 4; + +bitflags! { + pub struct EventFlags: usize { + const EVENT_NONE = 0; + const EVENT_READ = 1; + const EVENT_WRITE = 2; + } +} + +pub const F_DUPFD: usize = 0; +pub const F_GETFD: usize = 1; +pub const F_SETFD: usize = 2; +pub const F_GETFL: usize = 3; +pub const F_SETFL: usize = 4; + +pub const FUTEX_WAIT: usize = 0; +pub const FUTEX_WAKE: usize = 1; +pub const FUTEX_REQUEUE: usize = 2; + +bitflags! { + pub struct MapFlags: usize { + const PROT_NONE = 0x0000_0000; + const PROT_EXEC = 0x0001_0000; + const PROT_WRITE = 0x0002_0000; + const PROT_READ = 0x0004_0000; + + const MAP_SHARED = 0x0001; + const MAP_PRIVATE = 0x0002; + + /// Only accepted for mmap2(2). + const MAP_FIXED = 0x0004; + const MAP_FIXED_NOREPLACE = 0x000C; + } +} + +pub const MODE_TYPE: u16 = 0xF000; +pub const MODE_DIR: u16 = 0x4000; +pub const MODE_FILE: u16 = 0x8000; +pub const MODE_SYMLINK: u16 = 0xA000; +pub const MODE_FIFO: u16 = 0x1000; +pub const MODE_CHR: u16 = 0x2000; + +pub const MODE_PERM: u16 = 0x0FFF; +pub const MODE_SETUID: u16 = 0o4000; +pub const MODE_SETGID: u16 = 0o2000; + +pub const O_RDONLY: usize = 0x0001_0000; +pub const O_WRONLY: usize = 0x0002_0000; +pub const O_RDWR: usize = 0x0003_0000; +pub const O_NONBLOCK: usize = 0x0004_0000; +pub const O_APPEND: usize = 0x0008_0000; +pub const O_SHLOCK: usize = 0x0010_0000; +pub const O_EXLOCK: usize = 0x0020_0000; +pub const O_ASYNC: usize = 0x0040_0000; +pub const O_FSYNC: usize = 0x0080_0000; +pub const O_CLOEXEC: usize = 0x0100_0000; +pub const O_CREAT: usize = 0x0200_0000; +pub const O_TRUNC: usize = 0x0400_0000; +pub const O_EXCL: usize = 0x0800_0000; +pub const O_DIRECTORY: usize = 0x1000_0000; +pub const O_STAT: usize = 0x2000_0000; +pub const O_SYMLINK: usize = 0x4000_0000; +pub const O_NOFOLLOW: usize = 0x8000_0000; +pub const O_ACCMODE: usize = O_RDONLY | O_WRONLY | O_RDWR; + +bitflags! { + pub struct PhysmapFlags: usize { + const PHYSMAP_WRITE = 0x0000_0001; + const PHYSMAP_WRITE_COMBINE = 0x0000_0002; + const PHYSMAP_NO_CACHE = 0x0000_0004; + } +} +bitflags! { + /// Extra flags for [`physalloc2`] or [`physalloc3`]. + /// + /// [`physalloc2`]: ../call/fn.physalloc2.html + /// [`physalloc3`]: ../call/fn.physalloc3.html + pub struct PhysallocFlags: usize { + /// Only allocate memory within the 32-bit physical memory space. This is necessary for + /// some devices may not support 64-bit memory. + const SPACE_32 = 0x0000_0001; + + /// The frame that will be allocated, is going to reside anywhere in 64-bit space. This + /// flag is redundant for the most part, except when overriding some other default. + const SPACE_64 = 0x0000_0002; + + /// Do a "partial allocation", which means that not all of the frames specified in the + /// frame count `size` actually have to be allocated. This means that if the allocator was + /// unable to find a physical memory range large enough, it can instead return whatever + /// range it decides is optimal. Thus, instead of letting one driver get an expensive + /// 128MiB physical memory range when the physical memory has become fragmented, and + /// failing, it can instead be given a more optimal range. If the device supports + /// scatter-gather lists, then the driver only has to allocate more ranges, and the device + /// will do vectored I/O. + /// + /// PARTIAL_ALLOC supports different allocation strategies, refer to + /// [`Optimal`], [`GreatestRange`]. + /// + /// [`Optimal`]: ./enum.PartialAllocStrategy.html + /// [`GreatestRange`]: ./enum.PartialAllocStrategy.html + const PARTIAL_ALLOC = 0x0000_0004; + } +} + +/// The bitmask of the partial allocation strategy. Currently four different strategies are +/// supported. If [`PARTIAL_ALLOC`] is not set, this bitmask is no longer reserved. +pub const PARTIAL_ALLOC_STRATEGY_MASK: usize = 0x0003_0000; + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(usize)] +pub enum PartialAllocStrategy { + /// The allocator decides itself the size of the memory range, based on e.g. free memory ranges + /// and other processes which require large physical memory chunks. + Optimal = 0x0001_0000, + + /// The allocator returns the absolute greatest range it can find. + GreatestRange = 0x0002_0000, + + /// The allocator returns the first range that fits the minimum count, without searching extra. + Greedy = 0x0003_0000, +} +impl Default for PartialAllocStrategy { + fn default() -> Self { + Self::Optimal + } +} + +impl PartialAllocStrategy { + pub fn from_raw(raw: usize) -> Option { + match raw { + 0x0001_0000 => Some(Self::Optimal), + 0x0002_0000 => Some(Self::GreatestRange), + 0x0003_0000 => Some(Self::Greedy), + _ => None, + } + } +} + +// The top 48 bits of PTRACE_* are reserved, for now + +bitflags! { + pub struct PtraceFlags: u64 { + /// Stop before a syscall is handled. Send PTRACE_FLAG_IGNORE to not + /// handle the syscall. + const PTRACE_STOP_PRE_SYSCALL = 0x0000_0000_0000_0001; + /// Stop after a syscall is handled. + const PTRACE_STOP_POST_SYSCALL = 0x0000_0000_0000_0002; + /// Stop after exactly one instruction. TODO: This may not handle + /// fexec/signal boundaries. Should it? + const PTRACE_STOP_SINGLESTEP = 0x0000_0000_0000_0004; + /// Stop before a signal is handled. Send PTRACE_FLAG_IGNORE to not + /// handle signal. + const PTRACE_STOP_SIGNAL = 0x0000_0000_0000_0008; + /// Stop on a software breakpoint, such as the int3 instruction for + /// x86_64. + const PTRACE_STOP_BREAKPOINT = 0x0000_0000_0000_0010; + /// Stop just before exiting for good. + const PTRACE_STOP_EXIT = 0x0000_0000_0000_0020; + + const PTRACE_STOP_MASK = 0x0000_0000_0000_00FF; + + + /// Sent when a child is cloned, giving you the opportunity to trace it. + /// If you don't catch this, the child is started as normal. + const PTRACE_EVENT_CLONE = 0x0000_0000_0000_0100; + + const PTRACE_EVENT_MASK = 0x0000_0000_0000_0F00; + + + /// Special meaning, depending on the event. Usually, when fired before + /// an action, it will skip performing that action. + const PTRACE_FLAG_IGNORE = 0x0000_0000_0000_1000; + + const PTRACE_FLAG_MASK = 0x0000_0000_0000_F000; + } +} +impl Deref for PtraceFlags { + type Target = [u8]; + fn deref(&self) -> &Self::Target { + // Same as to_ne_bytes but in-place + unsafe { + slice::from_raw_parts( + &self.bits as *const _ as *const u8, + mem::size_of::() + ) + } + } +} + +pub const SEEK_SET: usize = 0; +pub const SEEK_CUR: usize = 1; +pub const SEEK_END: usize = 2; + +pub const SIGHUP: usize = 1; +pub const SIGINT: usize = 2; +pub const SIGQUIT: usize = 3; +pub const SIGILL: usize = 4; +pub const SIGTRAP: usize = 5; +pub const SIGABRT: usize = 6; +pub const SIGBUS: usize = 7; +pub const SIGFPE: usize = 8; +pub const SIGKILL: usize = 9; +pub const SIGUSR1: usize = 10; +pub const SIGSEGV: usize = 11; +pub const SIGUSR2: usize = 12; +pub const SIGPIPE: usize = 13; +pub const SIGALRM: usize = 14; +pub const SIGTERM: usize = 15; +pub const SIGSTKFLT: usize= 16; +pub const SIGCHLD: usize = 17; +pub const SIGCONT: usize = 18; +pub const SIGSTOP: usize = 19; +pub const SIGTSTP: usize = 20; +pub const SIGTTIN: usize = 21; +pub const SIGTTOU: usize = 22; +pub const SIGURG: usize = 23; +pub const SIGXCPU: usize = 24; +pub const SIGXFSZ: usize = 25; +pub const SIGVTALRM: usize= 26; +pub const SIGPROF: usize = 27; +pub const SIGWINCH: usize = 28; +pub const SIGIO: usize = 29; +pub const SIGPWR: usize = 30; +pub const SIGSYS: usize = 31; + +pub const SIG_DFL: usize = 0; +pub const SIG_IGN: usize = 1; + +pub const SIG_BLOCK: usize = 0; +pub const SIG_UNBLOCK: usize = 1; +pub const SIG_SETMASK: usize = 2; + +bitflags! { + pub struct SigActionFlags: usize { + const SA_NOCLDSTOP = 0x00000001; + const SA_NOCLDWAIT = 0x00000002; + const SA_SIGINFO = 0x00000004; + const SA_RESTORER = 0x04000000; + const SA_ONSTACK = 0x08000000; + const SA_RESTART = 0x10000000; + const SA_NODEFER = 0x40000000; + const SA_RESETHAND = 0x80000000; + } +} + +// Auxiliery vector types +pub const AT_NULL: usize = 0; +pub const AT_PHDR: usize = 3; +pub const AT_ENTRY: usize = 9; + +bitflags! { + pub struct WaitFlags: usize { + const WNOHANG = 0x01; + const WUNTRACED = 0x02; + const WCONTINUED = 0x08; + } +} + +/// True if status indicates the child is stopped. +pub fn wifstopped(status: usize) -> bool { + (status & 0xff) == 0x7f +} + +/// If wifstopped(status), the signal that stopped the child. +pub fn wstopsig(status: usize) -> usize { + (status >> 8) & 0xff +} + +/// True if status indicates the child continued after a stop. +pub fn wifcontinued(status: usize) -> bool { + status == 0xffff +} + +/// True if STATUS indicates termination by a signal. +pub fn wifsignaled(status: usize) -> bool { + ((status & 0x7f) + 1) as i8 >= 2 +} + +/// If wifsignaled(status), the terminating signal. +pub fn wtermsig(status: usize) -> usize { + status & 0x7f +} + +/// True if status indicates normal termination. +pub fn wifexited(status: usize) -> bool { + wtermsig(status) == 0 +} + +/// If wifexited(status), the exit status. +pub fn wexitstatus(status: usize) -> usize { + (status >> 8) & 0xff +} + +/// True if status indicates a core dump was created. +pub fn wcoredump(status: usize) -> bool { + (status & 0x80) != 0 +} diff --git a/third_party/cargo/vendor/redox_syscall-0.2.5/src/io/dma.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/io/dma.rs new file mode 100644 index 0000000..b356c8a --- /dev/null +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/io/dma.rs @@ -0,0 +1,200 @@ +use core::mem::{self, MaybeUninit}; +use core::ops::{Deref, DerefMut}; +use core::{ptr, slice}; + +use crate::Result; +use crate::{PartialAllocStrategy, PhysallocFlags}; + +/// An RAII guard of a physical memory allocation. Currently all physically allocated memory are +/// page-aligned and take up at least 4k of space (on x86_64). +#[derive(Debug)] +pub struct PhysBox { + address: usize, + size: usize +} + +impl PhysBox { + /// Construct a PhysBox from an address and a size. + /// + /// # Safety + /// This function is unsafe because when dropping, Self has to a valid allocation. + pub unsafe fn from_raw_parts(address: usize, size: usize) -> Self { + Self { + address, + size, + } + } + + /// Retrieve the byte address in physical memory, of this allocation. + pub fn address(&self) -> usize { + self.address + } + + /// Retrieve the size in bytes of the alloc. + pub fn size(&self) -> usize { + self.size + } + + /// Allocate physical memory that must reside in 32-bit space. + pub fn new_in_32bit_space(size: usize) -> Result { + Self::new_with_flags(size, PhysallocFlags::SPACE_32) + } + + pub fn new_with_flags(size: usize, flags: PhysallocFlags) -> Result { + assert!(!flags.contains(PhysallocFlags::PARTIAL_ALLOC)); + + let address = unsafe { crate::physalloc2(size, flags.bits())? }; + Ok(Self { + address, + size, + }) + } + + /// "Partially" allocate physical memory, in the sense that the allocation may be smaller than + /// expected, but still with a minimum limit. This is particularly useful when the physical + /// memory space is fragmented, and a device supports scatter-gather I/O. In that case, the + /// driver can optimistically request e.g. 1 alloc of 1 MiB, with the minimum of 512 KiB. If + /// that first allocation only returns half the size, the driver can do another allocation + /// and then let the device use both buffers. + pub fn new_partial_allocation(size: usize, flags: PhysallocFlags, strategy: Option, mut min: usize) -> Result { + debug_assert!(!(flags.contains(PhysallocFlags::PARTIAL_ALLOC) && strategy.is_none())); + + let address = unsafe { crate::physalloc3(size, flags.bits() | strategy.map(|s| s as usize).unwrap_or(0), &mut min)? }; + Ok(Self { + address, + size: min, + }) + } + + pub fn new(size: usize) -> Result { + let address = unsafe { crate::physalloc(size)? }; + Ok(Self { + address, + size, + }) + } +} + +impl Drop for PhysBox { + fn drop(&mut self) { + let _ = unsafe { crate::physfree(self.address, self.size) }; + } +} + +pub struct Dma { + phys: PhysBox, + virt: *mut T, +} + +impl Dma { + pub fn from_physbox_uninit(phys: PhysBox) -> Result>> { + let virt = unsafe { crate::physmap(phys.address, phys.size, crate::PHYSMAP_WRITE)? } as *mut MaybeUninit; + + Ok(Dma { + phys, + virt, + }) + } + pub fn from_physbox_zeroed(phys: PhysBox) -> Result>> { + let this = Self::from_physbox_uninit(phys)?; + unsafe { ptr::write_bytes(this.virt as *mut MaybeUninit, 0, this.phys.size) } + Ok(this) + } + + pub fn from_physbox(phys: PhysBox, value: T) -> Result { + let this = Self::from_physbox_uninit(phys)?; + + Ok(unsafe { + ptr::write(this.virt, MaybeUninit::new(value)); + this.assume_init() + }) + } + + pub fn new(value: T) -> Result { + let phys = PhysBox::new(mem::size_of::())?; + Self::from_physbox(phys, value) + } + pub fn zeroed() -> Result>> { + let phys = PhysBox::new(mem::size_of::())?; + Self::from_physbox_zeroed(phys) + } +} + +impl Dma> { + pub unsafe fn assume_init(self) -> Dma { + let &Dma { phys: PhysBox { address, size }, virt } = &self; + mem::forget(self); + + Dma { + phys: PhysBox { address, size }, + virt: virt as *mut T, + } + } +} +impl Dma { + pub fn physical(&self) -> usize { + self.phys.address() + } + pub fn size(&self) -> usize { + self.phys.size() + } + pub fn phys(&self) -> &PhysBox { + &self.phys + } +} + +impl Dma<[T]> { + pub fn from_physbox_uninit_unsized(phys: PhysBox, len: usize) -> Result]>> { + let max_len = phys.size() / mem::size_of::(); + assert!(len <= max_len); + + Ok(Dma { + virt: unsafe { slice::from_raw_parts_mut(crate::physmap(phys.address, phys.size, crate::PHYSMAP_WRITE)? as *mut MaybeUninit, len) } as *mut [MaybeUninit], + phys, + }) + } + pub fn from_physbox_zeroed_unsized(phys: PhysBox, len: usize) -> Result]>> { + let this = Self::from_physbox_uninit_unsized(phys, len)?; + unsafe { ptr::write_bytes(this.virt as *mut MaybeUninit, 0, this.phys.size()) } + Ok(this) + } + /// Creates a new DMA buffer with a size only known at runtime. + /// ## Safety + /// * `T` must be properly aligned. + /// * `T` must be valid as zeroed (i.e. no NonNull pointers). + pub unsafe fn zeroed_unsized(count: usize) -> Result { + let phys = PhysBox::new(mem::size_of::() * count)?; + Ok(Self::from_physbox_zeroed_unsized(phys, count)?.assume_init()) + } +} +impl Dma<[MaybeUninit]> { + pub unsafe fn assume_init(self) -> Dma<[T]> { + let &Dma { phys: PhysBox { address, size }, virt } = &self; + mem::forget(self); + + Dma { + phys: PhysBox { address, size }, + virt: virt as *mut [T], + } + } +} + +impl Deref for Dma { + type Target = T; + fn deref(&self) -> &T { + unsafe { &*self.virt } + } +} + +impl DerefMut for Dma { + fn deref_mut(&mut self) -> &mut T { + unsafe { &mut *self.virt } + } +} + +impl Drop for Dma { + fn drop(&mut self) { + unsafe { ptr::drop_in_place(self.virt) } + let _ = unsafe { crate::physunmap(self.virt as *mut u8 as usize) }; + } +} diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/io/io.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/io/io.rs similarity index 100% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/io/io.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/io/io.rs diff --git a/third_party/cargo/vendor/redox_syscall-0.2.5/src/io/mmio.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/io/mmio.rs new file mode 100644 index 0000000..42251ad --- /dev/null +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/io/mmio.rs @@ -0,0 +1,45 @@ +use core::ptr::{read_volatile, write_volatile}; +use core::mem::MaybeUninit; +use core::ops::{BitAnd, BitOr, Not}; + +use super::io::Io; + +#[repr(packed)] +pub struct Mmio { + value: MaybeUninit, +} + +impl Mmio { + /// Create a new Mmio without initializing + #[deprecated = "unsound because it's possible to read even though it's uninitialized"] + pub fn new() -> Self { + unsafe { Self::uninit() } + } + pub unsafe fn zeroed() -> Self { + Self { + value: MaybeUninit::zeroed(), + } + } + pub unsafe fn uninit() -> Self { + Self { + value: MaybeUninit::uninit(), + } + } + pub const fn from(value: T) -> Self { + Self { + value: MaybeUninit::new(value), + } + } +} + +impl Io for Mmio where T: Copy + PartialEq + BitAnd + BitOr + Not { + type Value = T; + + fn read(&self) -> T { + unsafe { read_volatile(self.value.as_ptr()) } + } + + fn write(&mut self, value: T) { + unsafe { write_volatile(self.value.as_mut_ptr(), value) }; + } +} diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/io/mod.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/io/mod.rs similarity index 100% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/io/mod.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/io/mod.rs diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/io/pio.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/io/pio.rs similarity index 100% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/io/pio.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/io/pio.rs diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/lib.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/lib.rs similarity index 65% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/lib.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/lib.rs index a3d0def..fb38239 100644 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/lib.rs +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/lib.rs @@ -1,5 +1,6 @@ +#![feature(asm)] #![feature(llvm_asm)] -#![feature(const_fn)] +#![feature(const_fn)] // see https://github.com/rust-lang/rfcs/pull/2632 #![cfg_attr(not(test), no_std)] #[cfg(test)] @@ -14,23 +15,23 @@ pub use self::io::*; pub use self::number::*; pub use self::scheme::*; -#[cfg(all(target_os = "redox", target_arch = "arm"))] +#[cfg(all(any(target_os = "none", target_os = "redox"), target_arch = "arm"))] #[path="arch/arm.rs"] mod arch; -#[cfg(all(target_os = "redox", target_arch = "aarch64"))] +#[cfg(all(any(target_os = "none", target_os = "redox"), target_arch = "aarch64"))] #[path="arch/aarch64.rs"] mod arch; -#[cfg(all(target_os = "redox", target_arch = "x86"))] +#[cfg(all(any(target_os = "none", target_os = "redox"), target_arch = "x86"))] #[path="arch/x86.rs"] mod arch; -#[cfg(all(target_os = "redox", target_arch = "x86_64"))] +#[cfg(all(any(target_os = "none", target_os = "redox"), target_arch = "x86_64"))] #[path="arch/x86_64.rs"] mod arch; -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "none", target_os = "redox")))] #[path="arch/nonredox.rs"] mod arch; diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/number.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/number.rs similarity index 58% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/number.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/number.rs index ec9acfa..1f037eb 100644 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/number.rs +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/number.rs @@ -16,28 +16,29 @@ pub const SYS_CHMOD: usize = SYS_CLASS_PATH | 15; pub const SYS_RMDIR: usize = SYS_CLASS_PATH | 84; pub const SYS_UNLINK: usize = SYS_CLASS_PATH | 10; -pub const SYS_CLOSE: usize = SYS_CLASS_FILE | 6; -pub const SYS_DUP: usize = SYS_CLASS_FILE | SYS_RET_FILE | 41; -pub const SYS_DUP2: usize = SYS_CLASS_FILE | SYS_RET_FILE | 63; -pub const SYS_READ: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 3; -pub const SYS_WRITE: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 4; -pub const SYS_LSEEK: usize = SYS_CLASS_FILE | 19; -pub const SYS_FCHMOD: usize = SYS_CLASS_FILE | 94; -pub const SYS_FCHOWN: usize = SYS_CLASS_FILE | 207; -pub const SYS_FCNTL: usize = SYS_CLASS_FILE | 55; -pub const SYS_FEVENT: usize = SYS_CLASS_FILE | 927; -pub const SYS_FEXEC: usize = SYS_CLASS_FILE | 11; -pub const SYS_FMAP: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 90; -pub const SYS_FUNMAP: usize = SYS_CLASS_FILE | 91; -pub const SYS_FPATH: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 928; -pub const SYS_FRENAME: usize = SYS_CLASS_FILE | SYS_ARG_PATH | 38; -pub const SYS_FSTAT: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 28; -pub const SYS_FSTATVFS: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 100; -pub const SYS_FSYNC: usize = SYS_CLASS_FILE | 118; -pub const SYS_FTRUNCATE: usize =SYS_CLASS_FILE | 93; -pub const SYS_FUTIMENS: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 320; +pub const SYS_CLOSE: usize = SYS_CLASS_FILE | 6; +pub const SYS_DUP: usize = SYS_CLASS_FILE | SYS_RET_FILE | 41; +pub const SYS_DUP2: usize = SYS_CLASS_FILE | SYS_RET_FILE | 63; +pub const SYS_READ: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 3; +pub const SYS_WRITE: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 4; +pub const SYS_LSEEK: usize = SYS_CLASS_FILE | 19; +pub const SYS_FCHMOD: usize = SYS_CLASS_FILE | 94; +pub const SYS_FCHOWN: usize = SYS_CLASS_FILE | 207; +pub const SYS_FCNTL: usize = SYS_CLASS_FILE | 55; +pub const SYS_FEVENT: usize = SYS_CLASS_FILE | 927; +pub const SYS_FEXEC: usize = SYS_CLASS_FILE | 11; +pub const SYS_FMAP_OLD: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 90; +pub const SYS_FMAP: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 900; +pub const SYS_FUNMAP_OLD: usize = SYS_CLASS_FILE | 91; +pub const SYS_FUNMAP: usize = SYS_CLASS_FILE | 92; +pub const SYS_FPATH: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 928; +pub const SYS_FRENAME: usize = SYS_CLASS_FILE | SYS_ARG_PATH | 38; +pub const SYS_FSTAT: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 28; +pub const SYS_FSTATVFS: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 100; +pub const SYS_FSYNC: usize = SYS_CLASS_FILE | 118; +pub const SYS_FTRUNCATE: usize = SYS_CLASS_FILE | 93; +pub const SYS_FUTIMENS: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 320; -pub const SYS_BRK: usize = 45; pub const SYS_CHDIR: usize = 12; pub const SYS_CLOCK_GETTIME: usize = 265; pub const SYS_CLONE: usize = 120; @@ -59,6 +60,7 @@ pub const SYS_MPROTECT: usize = 125; pub const SYS_MKNS: usize = 984; pub const SYS_NANOSLEEP: usize =162; pub const SYS_PHYSALLOC: usize =945; +pub const SYS_PHYSALLOC3: usize=9453; pub const SYS_PHYSFREE: usize = 946; pub const SYS_PHYSMAP: usize = 947; pub const SYS_PHYSUNMAP: usize =948; diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/generate.sh b/third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/generate.sh similarity index 74% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/generate.sh rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/generate.sh index e5d11ae..a877cda 100755 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/generate.sh +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/generate.sh @@ -11,7 +11,10 @@ echo "Generating SchemeBlock from Scheme" sed 's/trait Scheme/trait SchemeBlock/' scheme.rs \ | sed 's/fn handle(\&self, packet: \&mut Packet)/fn handle(\&self, packet: \&Packet) -> Option/' \ | sed 's/packet.a = Error::mux(res);/res.transpose().map(Error::mux)/' \ -| sed 's/Result/Result>/g' \ +| sed 's/\.map(|f| f\.bits())/\.map(|f| f.map(|f| f.bits()))/' \ +| sed 's/\.map(|o| o as usize)/.map(|o| o.map(|o| o as usize))/' \ +| sed 's/Ok(0)/Ok(Some(0))/g' \ +| sed 's/Result<\([^>]\+\)>/Result>/g' \ > scheme_block.rs echo "Generating SchemeBlockMut from SchemeBlock" diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/mod.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/mod.rs similarity index 50% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/mod.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/mod.rs index 66f8fc7..f65d1e2 100644 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/mod.rs +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/mod.rs @@ -1,9 +1,18 @@ +use core::{slice, str}; + pub use self::scheme::Scheme; pub use self::scheme_mut::SchemeMut; pub use self::scheme_block::SchemeBlock; pub use self::scheme_block_mut::SchemeBlockMut; +pub use self::seek::*; + +unsafe fn str_from_raw_parts(ptr: *const u8, len: usize) -> Option<&'static str> { + let slice = slice::from_raw_parts(ptr, len); + str::from_utf8(slice).ok() +} mod scheme; mod scheme_mut; mod scheme_block; mod scheme_block_mut; +mod seek; diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/scheme.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/scheme.rs similarity index 59% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/scheme.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/scheme.rs index c047e96..249d28c 100644 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/scheme.rs +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/scheme.rs @@ -1,33 +1,61 @@ use core::{mem, slice}; -use data::*; -use error::*; -use number::*; +use crate::data::*; +use crate::error::*; +use crate::flag::*; +use crate::number::*; +use crate::scheme::str_from_raw_parts; pub trait Scheme { fn handle(&self, packet: &mut Packet) { let res = match packet.a { - SYS_OPEN => self.open(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d, packet.uid, packet.gid), - SYS_CHMOD => self.chmod(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d as u16, packet.uid, packet.gid), - SYS_RMDIR => self.rmdir(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), - SYS_UNLINK => self.unlink(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), + SYS_OPEN => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { + self.open(path, packet.d, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, + SYS_CHMOD => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { + self.chmod(path, packet.d as u16, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, + SYS_RMDIR => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { + self.rmdir(path, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, + SYS_UNLINK => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { + self.unlink(path, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, SYS_DUP => self.dup(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), SYS_READ => self.read(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), SYS_WRITE => self.write(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), - SYS_LSEEK => self.seek(packet.b, packet.c, packet.d), + SYS_LSEEK => self.seek(packet.b, packet.c as isize, packet.d).map(|o| o as usize), SYS_FCHMOD => self.fchmod(packet.b, packet.c as u16), SYS_FCHOWN => self.fchown(packet.b, packet.c as u32, packet.d as u32), SYS_FCNTL => self.fcntl(packet.b, packet.c, packet.d), - SYS_FEVENT => self.fevent(packet.b, packet.c), + SYS_FEVENT => self.fevent(packet.b, EventFlags::from_bits_truncate(packet.c)).map(|f| f.bits()), + SYS_FMAP_OLD => if packet.d >= mem::size_of::() { + self.fmap_old(packet.b, unsafe { &*(packet.c as *const OldMap) }) + } else { + Err(Error::new(EFAULT)) + }, SYS_FMAP => if packet.d >= mem::size_of::() { self.fmap(packet.b, unsafe { &*(packet.c as *const Map) }) } else { Err(Error::new(EFAULT)) }, - SYS_FUNMAP => self.funmap(packet.b), + SYS_FUNMAP_OLD => self.funmap_old(packet.b), + SYS_FUNMAP => self.funmap(packet.b, packet.c), SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), - SYS_FRENAME => self.frename(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }, packet.uid, packet.gid), + SYS_FRENAME => if let Some(path) = unsafe { str_from_raw_parts(packet.c as *const u8, packet.d) } { + self.frename(packet.b, path, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, SYS_FSTAT => if packet.d >= mem::size_of::() { self.fstat(packet.b, unsafe { &mut *(packet.c as *mut Stat) }) } else { @@ -55,22 +83,22 @@ pub trait Scheme { /* Scheme operations */ #[allow(unused_variables)] - fn open(&self, path: &[u8], flags: usize, uid: u32, gid: u32) -> Result { + fn open(&self, path: &str, flags: usize, uid: u32, gid: u32) -> Result { Err(Error::new(ENOENT)) } #[allow(unused_variables)] - fn chmod(&self, path: &[u8], mode: u16, uid: u32, gid: u32) -> Result { + fn chmod(&self, path: &str, mode: u16, uid: u32, gid: u32) -> Result { Err(Error::new(ENOENT)) } #[allow(unused_variables)] - fn rmdir(&self, path: &[u8], uid: u32, gid: u32) -> Result { + fn rmdir(&self, path: &str, uid: u32, gid: u32) -> Result { Err(Error::new(ENOENT)) } #[allow(unused_variables)] - fn unlink(&self, path: &[u8], uid: u32, gid: u32) -> Result { + fn unlink(&self, path: &str, uid: u32, gid: u32) -> Result { Err(Error::new(ENOENT)) } @@ -91,7 +119,7 @@ pub trait Scheme { } #[allow(unused_variables)] - fn seek(&self, id: usize, pos: usize, whence: usize) -> Result { + fn seek(&self, id: usize, pos: isize, whence: usize) -> Result { Err(Error::new(EBADF)) } @@ -111,18 +139,34 @@ pub trait Scheme { } #[allow(unused_variables)] - fn fevent(&self, id: usize, flags: usize) -> Result { + fn fevent(&self, id: usize, flags: EventFlags) -> Result { Err(Error::new(EBADF)) } + #[allow(unused_variables)] + fn fmap_old(&self, id: usize, map: &OldMap) -> Result { + Err(Error::new(EBADF)) + } #[allow(unused_variables)] fn fmap(&self, id: usize, map: &Map) -> Result { - Err(Error::new(EBADF)) + if map.flags.contains(MapFlags::MAP_FIXED) { + return Err(Error::new(EINVAL)); + } + self.fmap_old(id, &OldMap { + offset: map.offset, + size: map.size, + flags: map.flags, + }) } #[allow(unused_variables)] - fn funmap(&self, address: usize) -> Result { - Err(Error::new(EBADF)) + fn funmap_old(&self, address: usize) -> Result { + Ok(0) + } + + #[allow(unused_variables)] + fn funmap(&self, address: usize, length: usize) -> Result { + Ok(0) } #[allow(unused_variables)] @@ -131,7 +175,7 @@ pub trait Scheme { } #[allow(unused_variables)] - fn frename(&self, id: usize, path: &[u8], uid: u32, gid: u32) -> Result { + fn frename(&self, id: usize, path: &str, uid: u32, gid: u32) -> Result { Err(Error::new(EBADF)) } diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/scheme_block.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/scheme_block.rs similarity index 59% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/scheme_block.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/scheme_block.rs index 0407dde..e22535e 100644 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/scheme_block.rs +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/scheme_block.rs @@ -1,33 +1,61 @@ use core::{mem, slice}; -use data::*; -use error::*; -use number::*; +use crate::data::*; +use crate::error::*; +use crate::flag::*; +use crate::number::*; +use crate::scheme::str_from_raw_parts; pub trait SchemeBlock { fn handle(&self, packet: &Packet) -> Option { let res = match packet.a { - SYS_OPEN => self.open(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d, packet.uid, packet.gid), - SYS_CHMOD => self.chmod(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d as u16, packet.uid, packet.gid), - SYS_RMDIR => self.rmdir(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), - SYS_UNLINK => self.unlink(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), + SYS_OPEN => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { + self.open(path, packet.d, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, + SYS_CHMOD => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { + self.chmod(path, packet.d as u16, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, + SYS_RMDIR => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { + self.rmdir(path, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, + SYS_UNLINK => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { + self.unlink(path, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, SYS_DUP => self.dup(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), SYS_READ => self.read(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), SYS_WRITE => self.write(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), - SYS_LSEEK => self.seek(packet.b, packet.c, packet.d), + SYS_LSEEK => self.seek(packet.b, packet.c as isize, packet.d).map(|o| o.map(|o| o as usize)), SYS_FCHMOD => self.fchmod(packet.b, packet.c as u16), SYS_FCHOWN => self.fchown(packet.b, packet.c as u32, packet.d as u32), SYS_FCNTL => self.fcntl(packet.b, packet.c, packet.d), - SYS_FEVENT => self.fevent(packet.b, packet.c), + SYS_FEVENT => self.fevent(packet.b, EventFlags::from_bits_truncate(packet.c)).map(|f| f.map(|f| f.bits())), + SYS_FMAP_OLD => if packet.d >= mem::size_of::() { + self.fmap_old(packet.b, unsafe { &*(packet.c as *const OldMap) }) + } else { + Err(Error::new(EFAULT)) + }, SYS_FMAP => if packet.d >= mem::size_of::() { self.fmap(packet.b, unsafe { &*(packet.c as *const Map) }) } else { Err(Error::new(EFAULT)) }, - SYS_FUNMAP => self.funmap(packet.b), + SYS_FUNMAP_OLD => self.funmap_old(packet.b), + SYS_FUNMAP => self.funmap(packet.b, packet.c), SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), - SYS_FRENAME => self.frename(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }, packet.uid, packet.gid), + SYS_FRENAME => if let Some(path) = unsafe { str_from_raw_parts(packet.c as *const u8, packet.d) } { + self.frename(packet.b, path, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, SYS_FSTAT => if packet.d >= mem::size_of::() { self.fstat(packet.b, unsafe { &mut *(packet.c as *mut Stat) }) } else { @@ -55,22 +83,22 @@ pub trait SchemeBlock { /* Scheme operations */ #[allow(unused_variables)] - fn open(&self, path: &[u8], flags: usize, uid: u32, gid: u32) -> Result> { + fn open(&self, path: &str, flags: usize, uid: u32, gid: u32) -> Result> { Err(Error::new(ENOENT)) } #[allow(unused_variables)] - fn chmod(&self, path: &[u8], mode: u16, uid: u32, gid: u32) -> Result> { + fn chmod(&self, path: &str, mode: u16, uid: u32, gid: u32) -> Result> { Err(Error::new(ENOENT)) } #[allow(unused_variables)] - fn rmdir(&self, path: &[u8], uid: u32, gid: u32) -> Result> { + fn rmdir(&self, path: &str, uid: u32, gid: u32) -> Result> { Err(Error::new(ENOENT)) } #[allow(unused_variables)] - fn unlink(&self, path: &[u8], uid: u32, gid: u32) -> Result> { + fn unlink(&self, path: &str, uid: u32, gid: u32) -> Result> { Err(Error::new(ENOENT)) } @@ -91,7 +119,7 @@ pub trait SchemeBlock { } #[allow(unused_variables)] - fn seek(&self, id: usize, pos: usize, whence: usize) -> Result> { + fn seek(&self, id: usize, pos: isize, whence: usize) -> Result> { Err(Error::new(EBADF)) } @@ -111,18 +139,34 @@ pub trait SchemeBlock { } #[allow(unused_variables)] - fn fevent(&self, id: usize, flags: usize) -> Result> { + fn fevent(&self, id: usize, flags: EventFlags) -> Result> { Err(Error::new(EBADF)) } + #[allow(unused_variables)] + fn fmap_old(&self, id: usize, map: &OldMap) -> Result> { + Err(Error::new(EBADF)) + } #[allow(unused_variables)] fn fmap(&self, id: usize, map: &Map) -> Result> { - Err(Error::new(EBADF)) + if map.flags.contains(MapFlags::MAP_FIXED) { + return Err(Error::new(EINVAL)); + } + self.fmap_old(id, &OldMap { + offset: map.offset, + size: map.size, + flags: map.flags, + }) } #[allow(unused_variables)] - fn funmap(&self, address: usize) -> Result> { - Err(Error::new(EBADF)) + fn funmap_old(&self, address: usize) -> Result> { + Ok(Some(0)) + } + + #[allow(unused_variables)] + fn funmap(&self, address: usize, length: usize) -> Result> { + Ok(Some(0)) } #[allow(unused_variables)] @@ -131,7 +175,7 @@ pub trait SchemeBlock { } #[allow(unused_variables)] - fn frename(&self, id: usize, path: &[u8], uid: u32, gid: u32) -> Result> { + fn frename(&self, id: usize, path: &str, uid: u32, gid: u32) -> Result> { Err(Error::new(EBADF)) } diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/scheme_block_mut.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/scheme_block_mut.rs similarity index 59% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/scheme_block_mut.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/scheme_block_mut.rs index 411035f..c1e5435 100644 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/scheme_block_mut.rs +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/scheme_block_mut.rs @@ -1,33 +1,61 @@ use core::{mem, slice}; -use data::*; -use error::*; -use number::*; +use crate::data::*; +use crate::error::*; +use crate::flag::*; +use crate::number::*; +use crate::scheme::str_from_raw_parts; pub trait SchemeBlockMut { fn handle(&mut self, packet: &Packet) -> Option { let res = match packet.a { - SYS_OPEN => self.open(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d, packet.uid, packet.gid), - SYS_CHMOD => self.chmod(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d as u16, packet.uid, packet.gid), - SYS_RMDIR => self.rmdir(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), - SYS_UNLINK => self.unlink(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), + SYS_OPEN => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { + self.open(path, packet.d, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, + SYS_CHMOD => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { + self.chmod(path, packet.d as u16, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, + SYS_RMDIR => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { + self.rmdir(path, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, + SYS_UNLINK => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { + self.unlink(path, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, SYS_DUP => self.dup(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), SYS_READ => self.read(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), SYS_WRITE => self.write(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), - SYS_LSEEK => self.seek(packet.b, packet.c, packet.d), + SYS_LSEEK => self.seek(packet.b, packet.c as isize, packet.d).map(|o| o.map(|o| o as usize)), SYS_FCHMOD => self.fchmod(packet.b, packet.c as u16), SYS_FCHOWN => self.fchown(packet.b, packet.c as u32, packet.d as u32), SYS_FCNTL => self.fcntl(packet.b, packet.c, packet.d), - SYS_FEVENT => self.fevent(packet.b, packet.c), + SYS_FEVENT => self.fevent(packet.b, EventFlags::from_bits_truncate(packet.c)).map(|f| f.map(|f| f.bits())), + SYS_FMAP_OLD => if packet.d >= mem::size_of::() { + self.fmap_old(packet.b, unsafe { &*(packet.c as *const OldMap) }) + } else { + Err(Error::new(EFAULT)) + }, SYS_FMAP => if packet.d >= mem::size_of::() { self.fmap(packet.b, unsafe { &*(packet.c as *const Map) }) } else { Err(Error::new(EFAULT)) }, - SYS_FUNMAP => self.funmap(packet.b), + SYS_FUNMAP_OLD => self.funmap_old(packet.b), + SYS_FUNMAP => self.funmap(packet.b, packet.c), SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), - SYS_FRENAME => self.frename(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }, packet.uid, packet.gid), + SYS_FRENAME => if let Some(path) = unsafe { str_from_raw_parts(packet.c as *const u8, packet.d) } { + self.frename(packet.b, path, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, SYS_FSTAT => if packet.d >= mem::size_of::() { self.fstat(packet.b, unsafe { &mut *(packet.c as *mut Stat) }) } else { @@ -55,22 +83,22 @@ pub trait SchemeBlockMut { /* Scheme operations */ #[allow(unused_variables)] - fn open(&mut self, path: &[u8], flags: usize, uid: u32, gid: u32) -> Result> { + fn open(&mut self, path: &str, flags: usize, uid: u32, gid: u32) -> Result> { Err(Error::new(ENOENT)) } #[allow(unused_variables)] - fn chmod(&mut self, path: &[u8], mode: u16, uid: u32, gid: u32) -> Result> { + fn chmod(&mut self, path: &str, mode: u16, uid: u32, gid: u32) -> Result> { Err(Error::new(ENOENT)) } #[allow(unused_variables)] - fn rmdir(&mut self, path: &[u8], uid: u32, gid: u32) -> Result> { + fn rmdir(&mut self, path: &str, uid: u32, gid: u32) -> Result> { Err(Error::new(ENOENT)) } #[allow(unused_variables)] - fn unlink(&mut self, path: &[u8], uid: u32, gid: u32) -> Result> { + fn unlink(&mut self, path: &str, uid: u32, gid: u32) -> Result> { Err(Error::new(ENOENT)) } @@ -91,7 +119,7 @@ pub trait SchemeBlockMut { } #[allow(unused_variables)] - fn seek(&mut self, id: usize, pos: usize, whence: usize) -> Result> { + fn seek(&mut self, id: usize, pos: isize, whence: usize) -> Result> { Err(Error::new(EBADF)) } @@ -111,18 +139,34 @@ pub trait SchemeBlockMut { } #[allow(unused_variables)] - fn fevent(&mut self, id: usize, flags: usize) -> Result> { + fn fevent(&mut self, id: usize, flags: EventFlags) -> Result> { Err(Error::new(EBADF)) } + #[allow(unused_variables)] + fn fmap_old(&mut self, id: usize, map: &OldMap) -> Result> { + Err(Error::new(EBADF)) + } #[allow(unused_variables)] fn fmap(&mut self, id: usize, map: &Map) -> Result> { - Err(Error::new(EBADF)) + if map.flags.contains(MapFlags::MAP_FIXED) { + return Err(Error::new(EINVAL)); + } + self.fmap_old(id, &OldMap { + offset: map.offset, + size: map.size, + flags: map.flags, + }) } #[allow(unused_variables)] - fn funmap(&mut self, address: usize) -> Result> { - Err(Error::new(EBADF)) + fn funmap_old(&mut self, address: usize) -> Result> { + Ok(Some(0)) + } + + #[allow(unused_variables)] + fn funmap(&mut self, address: usize, length: usize) -> Result> { + Ok(Some(0)) } #[allow(unused_variables)] @@ -131,7 +175,7 @@ pub trait SchemeBlockMut { } #[allow(unused_variables)] - fn frename(&mut self, id: usize, path: &[u8], uid: u32, gid: u32) -> Result> { + fn frename(&mut self, id: usize, path: &str, uid: u32, gid: u32) -> Result> { Err(Error::new(EBADF)) } diff --git a/third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/scheme_mut.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/scheme_mut.rs similarity index 59% rename from third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/scheme_mut.rs rename to third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/scheme_mut.rs index abd2e88..deb1483 100644 --- a/third_party/cargo/vendor/redox_syscall-0.1.57/src/scheme/scheme_mut.rs +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/scheme_mut.rs @@ -1,33 +1,61 @@ use core::{mem, slice}; -use data::*; -use error::*; -use number::*; +use crate::data::*; +use crate::error::*; +use crate::flag::*; +use crate::number::*; +use crate::scheme::str_from_raw_parts; pub trait SchemeMut { fn handle(&mut self, packet: &mut Packet) { let res = match packet.a { - SYS_OPEN => self.open(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d, packet.uid, packet.gid), - SYS_CHMOD => self.chmod(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d as u16, packet.uid, packet.gid), - SYS_RMDIR => self.rmdir(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), - SYS_UNLINK => self.unlink(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), + SYS_OPEN => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { + self.open(path, packet.d, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, + SYS_CHMOD => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { + self.chmod(path, packet.d as u16, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, + SYS_RMDIR => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { + self.rmdir(path, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, + SYS_UNLINK => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } { + self.unlink(path, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, SYS_DUP => self.dup(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), SYS_READ => self.read(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), SYS_WRITE => self.write(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), - SYS_LSEEK => self.seek(packet.b, packet.c, packet.d), + SYS_LSEEK => self.seek(packet.b, packet.c as isize, packet.d).map(|o| o as usize), SYS_FCHMOD => self.fchmod(packet.b, packet.c as u16), SYS_FCHOWN => self.fchown(packet.b, packet.c as u32, packet.d as u32), SYS_FCNTL => self.fcntl(packet.b, packet.c, packet.d), - SYS_FEVENT => self.fevent(packet.b, packet.c), + SYS_FEVENT => self.fevent(packet.b, EventFlags::from_bits_truncate(packet.c)).map(|f| f.bits()), + SYS_FMAP_OLD => if packet.d >= mem::size_of::() { + self.fmap_old(packet.b, unsafe { &*(packet.c as *const OldMap) }) + } else { + Err(Error::new(EFAULT)) + }, SYS_FMAP => if packet.d >= mem::size_of::() { self.fmap(packet.b, unsafe { &*(packet.c as *const Map) }) } else { Err(Error::new(EFAULT)) }, - SYS_FUNMAP => self.funmap(packet.b), + SYS_FUNMAP_OLD => self.funmap_old(packet.b), + SYS_FUNMAP => self.funmap(packet.b, packet.c), SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), - SYS_FRENAME => self.frename(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }, packet.uid, packet.gid), + SYS_FRENAME => if let Some(path) = unsafe { str_from_raw_parts(packet.c as *const u8, packet.d) } { + self.frename(packet.b, path, packet.uid, packet.gid) + } else { + Err(Error::new(EINVAL)) + }, SYS_FSTAT => if packet.d >= mem::size_of::() { self.fstat(packet.b, unsafe { &mut *(packet.c as *mut Stat) }) } else { @@ -55,22 +83,22 @@ pub trait SchemeMut { /* Scheme operations */ #[allow(unused_variables)] - fn open(&mut self, path: &[u8], flags: usize, uid: u32, gid: u32) -> Result { + fn open(&mut self, path: &str, flags: usize, uid: u32, gid: u32) -> Result { Err(Error::new(ENOENT)) } #[allow(unused_variables)] - fn chmod(&mut self, path: &[u8], mode: u16, uid: u32, gid: u32) -> Result { + fn chmod(&mut self, path: &str, mode: u16, uid: u32, gid: u32) -> Result { Err(Error::new(ENOENT)) } #[allow(unused_variables)] - fn rmdir(&mut self, path: &[u8], uid: u32, gid: u32) -> Result { + fn rmdir(&mut self, path: &str, uid: u32, gid: u32) -> Result { Err(Error::new(ENOENT)) } #[allow(unused_variables)] - fn unlink(&mut self, path: &[u8], uid: u32, gid: u32) -> Result { + fn unlink(&mut self, path: &str, uid: u32, gid: u32) -> Result { Err(Error::new(ENOENT)) } @@ -91,7 +119,7 @@ pub trait SchemeMut { } #[allow(unused_variables)] - fn seek(&mut self, id: usize, pos: usize, whence: usize) -> Result { + fn seek(&mut self, id: usize, pos: isize, whence: usize) -> Result { Err(Error::new(EBADF)) } @@ -111,18 +139,34 @@ pub trait SchemeMut { } #[allow(unused_variables)] - fn fevent(&mut self, id: usize, flags: usize) -> Result { + fn fevent(&mut self, id: usize, flags: EventFlags) -> Result { Err(Error::new(EBADF)) } + #[allow(unused_variables)] + fn fmap_old(&mut self, id: usize, map: &OldMap) -> Result { + Err(Error::new(EBADF)) + } #[allow(unused_variables)] fn fmap(&mut self, id: usize, map: &Map) -> Result { - Err(Error::new(EBADF)) + if map.flags.contains(MapFlags::MAP_FIXED) { + return Err(Error::new(EINVAL)); + } + self.fmap_old(id, &OldMap { + offset: map.offset, + size: map.size, + flags: map.flags, + }) } #[allow(unused_variables)] - fn funmap(&mut self, address: usize) -> Result { - Err(Error::new(EBADF)) + fn funmap_old(&mut self, address: usize) -> Result { + Ok(0) + } + + #[allow(unused_variables)] + fn funmap(&mut self, address: usize, length: usize) -> Result { + Ok(0) } #[allow(unused_variables)] @@ -131,7 +175,7 @@ pub trait SchemeMut { } #[allow(unused_variables)] - fn frename(&mut self, id: usize, path: &[u8], uid: u32, gid: u32) -> Result { + fn frename(&mut self, id: usize, path: &str, uid: u32, gid: u32) -> Result { Err(Error::new(EBADF)) } diff --git a/third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/seek.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/seek.rs new file mode 100644 index 0000000..09a4518 --- /dev/null +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/scheme/seek.rs @@ -0,0 +1,33 @@ +use core::cmp; +use core::convert::TryFrom; +use crate::error::*; +use crate::flag::*; + +/// Helper for seek calls +/// In most cases it's easier to use a usize to track the offset and buffer size internally, +/// but the seek interface uses isize. This wrapper ensures EOVERFLOW errors are returned +/// as appropriate if the value in the usize can't fit in the isize. +pub fn calc_seek_offset_usize(cur_offset: usize, pos: isize, whence: usize, buf_len: usize) -> Result { + let cur_offset = isize::try_from(cur_offset).or_else(|_| Err(Error::new(EOVERFLOW)))?; + let buf_len = isize::try_from(buf_len).or_else(|_| Err(Error::new(EOVERFLOW)))?; + calc_seek_offset_isize(cur_offset, pos, whence, buf_len) +} + +/// Helper for seek calls +/// Result is guaranteed to be positive. +/// EOVERFLOW returned if the arguments would cause an overflow. +/// EINVAL returned if the new offset is out of bounds. +pub fn calc_seek_offset_isize(cur_offset: isize, pos: isize, whence: usize, buf_len: isize) -> Result { + let new_offset = match whence { + SEEK_CUR => pos.checked_add(cur_offset), + SEEK_END => pos.checked_add(buf_len), + SEEK_SET => Some(pos), + _ => None, + }; + + match new_offset { + Some(new_offset) if new_offset < 0 => Err(Error::new(EINVAL)), + Some(new_offset) => Ok(cmp::min(new_offset, buf_len)), + None => Err(Error::new(EOVERFLOW)) + } +} \ No newline at end of file diff --git a/third_party/cargo/vendor/redox_syscall-0.2.5/src/tests.rs b/third_party/cargo/vendor/redox_syscall-0.2.5/src/tests.rs new file mode 100644 index 0000000..49a5f1b --- /dev/null +++ b/third_party/cargo/vendor/redox_syscall-0.2.5/src/tests.rs @@ -0,0 +1,467 @@ +#[test] +fn chdir() { + use std::str; + + let mut current_buf = [0; 4096]; + let current_count = dbg!(crate::getcwd(&mut current_buf)).unwrap(); + let current = dbg!(str::from_utf8(¤t_buf[..current_count])).unwrap(); + + let new = "file:"; + assert_eq!(dbg!(crate::chdir(dbg!(new))), Ok(0)); + { + let mut buf = [0; 4096]; + let count = dbg!(crate::getcwd(&mut buf)).unwrap(); + assert_eq!(dbg!(str::from_utf8(&buf[..count])), Ok(new)); + } + + assert_eq!(dbg!(crate::chdir(current)), Ok(0)); + { + let mut buf = [0; 4096]; + let count = dbg!(crate::getcwd(&mut buf)).unwrap(); + assert_eq!(dbg!(str::from_utf8(&buf[..count])), Ok(current)); + } +} + +//TODO: chmod + +#[test] +fn clone() { + let expected_status = 42; + let pid_res = unsafe { crate::clone(crate::CloneFlags::empty()) }; + if pid_res == Ok(0) { + crate::exit(expected_status).unwrap(); + panic!("failed to exit"); + } else { + let pid = dbg!(pid_res).unwrap(); + let mut status = 0; + assert_eq!(dbg!(crate::waitpid(pid, &mut status, crate::WaitFlags::empty())), Ok(pid)); + assert_eq!(dbg!(crate::wifexited(status)), true); + assert_eq!(dbg!(crate::wexitstatus(status)), expected_status); + } +} + +//TODO: close + +#[test] +fn clock_gettime() { + let mut tp = crate::TimeSpec::default(); + assert_eq!(dbg!( + crate::clock_gettime(crate::CLOCK_MONOTONIC, &mut tp) + ), Ok(0)); + assert_ne!(dbg!(tp), crate::TimeSpec::default()); + + tp = crate::TimeSpec::default(); + assert_eq!(dbg!( + crate::clock_gettime(crate::CLOCK_REALTIME, &mut tp) + ), Ok(0)); + assert_ne!(dbg!(tp), crate::TimeSpec::default()); +} + +//TODO: dup + +//TODO: dup2 + +//TODO: exit (handled by clone?) + +//TODO: fchmod + +//TODO: fcntl + +#[test] +fn fexec() { + let name = "file:/bin/ls"; + + let fd = dbg!( + crate::open(name, crate::O_RDONLY | crate::O_CLOEXEC) + ).unwrap(); + + let args = &[ + [name.as_ptr() as usize, name.len()] + ]; + + let vars = &[]; + + let pid_res = unsafe { crate::clone(crate::CloneFlags::empty()) }; + if pid_res == Ok(0) { + crate::fexec(fd, args, vars).unwrap(); + panic!("failed to fexec"); + } else { + assert_eq!(dbg!(crate::close(fd)), Ok(0)); + + let pid = dbg!(pid_res).unwrap(); + let mut status = 0; + assert_eq!(dbg!(crate::waitpid(pid, &mut status, crate::WaitFlags::empty())), Ok(pid)); + assert_eq!(dbg!(crate::wifexited(status)), true); + assert_eq!(dbg!(crate::wexitstatus(status)), 0); + } +} + +#[test] +fn fmap() { + use std::slice; + + let fd = dbg!( + crate::open( + "file:/tmp/syscall-tests-fmap", + crate::O_CREAT | crate::O_RDWR | crate::O_CLOEXEC + ) + ).unwrap(); + + let map = unsafe { + slice::from_raw_parts_mut( + dbg!( + crate::fmap(fd, &crate::Map { + offset: 0, + size: 128, + flags: crate::PROT_READ | crate::PROT_WRITE + }) + ).unwrap() as *mut u8, + 128 + ) + }; + + // Maps should be available after closing + assert_eq!(dbg!(crate::close(fd)), Ok(0)); + + for i in 0..128 { + map[i as usize] = i; + assert_eq!(map[i as usize], i); + } + + //TODO: add msync + unsafe { + assert_eq!(dbg!( + crate::funmap(map.as_mut_ptr() as usize) + ), Ok(0)); + } +} + +// funmap tested by fmap + +#[test] +fn fpath() { + use std::str; + + let path = "file:/tmp/syscall-tests-fpath"; + let fd = dbg!( + crate::open( + dbg!(path), + crate::O_CREAT | crate::O_RDWR | crate::O_CLOEXEC + ) + ).unwrap(); + + let mut buf = [0; 4096]; + let count = dbg!( + crate::fpath(fd, &mut buf) + ).unwrap(); + + assert_eq!(dbg!(str::from_utf8(&buf[..count])), Ok(path)); + + assert_eq!(dbg!(crate::close(fd)), Ok(0)); +} + +//TODO: frename + +#[test] +fn fstat() { + let path = "file:/tmp/syscall-tests-fstat"; + let fd = dbg!( + crate::open( + dbg!(path), + crate::O_CREAT | crate::O_RDWR | crate::O_CLOEXEC + ) + ).unwrap(); + + let mut stat = crate::Stat::default(); + assert_eq!(dbg!(crate::fstat(fd, &mut stat)), Ok(0)); + assert_ne!(dbg!(stat), crate::Stat::default()); + + assert_eq!(dbg!(crate::close(fd)), Ok(0)); +} + +#[test] +fn fstatvfs() { + let path = "file:/tmp/syscall-tests-fstatvfs"; + let fd = dbg!( + crate::open( + dbg!(path), + crate::O_CREAT | crate::O_RDWR | crate::O_CLOEXEC + ) + ).unwrap(); + + let mut statvfs = crate::StatVfs::default(); + assert_eq!(dbg!(crate::fstatvfs(fd, &mut statvfs)), Ok(0)); + assert_ne!(dbg!(statvfs), crate::StatVfs::default()); + + assert_eq!(dbg!(crate::close(fd)), Ok(0)); +} + +//TODO: fsync + +//TODO: ftruncate + +//TODO: futimens + +//TODO: futex + +// getcwd tested by chdir + +#[test] +fn getegid() { + assert_eq!(crate::getegid(), Ok(0)); +} + +#[test] +fn getens() { + assert_eq!(crate::getens(), Ok(1)); +} + +#[test] +fn geteuid() { + assert_eq!(crate::geteuid(), Ok(0)); +} + +#[test] +fn getgid() { + assert_eq!(crate::getgid(), Ok(0)); +} + +#[test] +fn getns() { + assert_eq!(crate::getns(), Ok(1)); +} + +//TODO: getpid + +//TODO: getpgid + +//TODO: getppid + +#[test] +fn getuid() { + assert_eq!(crate::getuid(), Ok(0)); +} + +//TODO: iopl + +//TODO: kill + +//TODO: link (probably will not work) + +#[test] +fn lseek() { + let path = "file:/tmp/syscall-tests-lseek"; + let fd = dbg!( + crate::open( + dbg!(path), + crate::O_CREAT | crate::O_RDWR | crate::O_CLOEXEC + ) + ).unwrap(); + + { + let mut buf = [0; 256]; + for i in 0..buf.len() { + buf[i] = i as u8; + } + assert_eq!(dbg!(crate::write(fd, &buf)), Ok(buf.len())); + + assert_eq!(dbg!(crate::lseek(fd, 0, crate::SEEK_CUR)), Ok(buf.len())); + assert_eq!(dbg!(crate::lseek(fd, 0, crate::SEEK_SET)), Ok(0)); + assert_eq!(dbg!(crate::lseek(fd, 0, crate::SEEK_END)), Ok(buf.len())); + assert_eq!(dbg!(crate::lseek(fd, 0, crate::SEEK_SET)), Ok(0)); + } + + { + let mut buf = [0; 256]; + assert_eq!(dbg!(crate::read(fd, &mut buf)), Ok(buf.len())); + for i in 0..buf.len() { + assert_eq!(buf[i], i as u8); + } + + assert_eq!(dbg!(crate::lseek(fd, 0, crate::SEEK_CUR)), Ok(buf.len())); + assert_eq!(dbg!(crate::lseek(fd, 0, crate::SEEK_SET)), Ok(0)); + assert_eq!(dbg!(crate::lseek(fd, 0, crate::SEEK_END)), Ok(buf.len())); + assert_eq!(dbg!(crate::lseek(fd, 0, crate::SEEK_SET)), Ok(0)); + } + + assert_eq!(dbg!(crate::close(fd)), Ok(0)); +} + +//TODO: mkns + +//TODO: mprotect + +#[test] +fn nanosleep() { + let req = crate::TimeSpec { + tv_sec: 0, + tv_nsec: 0, + }; + let mut rem = crate::TimeSpec::default(); + assert_eq!(crate::nanosleep(&req, &mut rem), Ok(0)); + assert_eq!(rem, crate::TimeSpec::default()); +} + +//TODO: open + +//TODO: physalloc + +//TODO: physfree + +//TODO: physmap + +//TODO: physunmap + +#[test] +fn pipe2() { + let mut fds = [0, 0]; + assert_eq!(dbg!(crate::pipe2(&mut fds, crate::O_CLOEXEC)), Ok(0)); + assert_ne!(dbg!(fds), [0, 0]); + + { + let mut buf = [0; 256]; + for i in 0..buf.len() { + buf[i] = i as u8; + } + assert_eq!(dbg!(crate::write(fds[1], &buf)), Ok(buf.len())); + } + + { + let mut buf = [0; 256]; + assert_eq!(dbg!(crate::read(fds[0], &mut buf)), Ok(buf.len())); + for i in 0..buf.len() { + assert_eq!(buf[i], i as u8); + } + } + + assert_eq!(dbg!(crate::close(fds[0])), Ok(0)); + assert_eq!(dbg!(crate::close(fds[1])), Ok(0)); +} + +//TODO: read + +#[test] +fn rmdir() { + let path = "file:/tmp/syscall-tests-rmdir"; + let fd = dbg!( + crate::open( + dbg!(path), + crate::O_CREAT | crate::O_DIRECTORY | crate::O_CLOEXEC + ) + ).unwrap(); + + assert_eq!(dbg!(crate::close(fd)), Ok(0)); + + assert_eq!(dbg!(crate::rmdir(path)), Ok(0)); +} + +//TODO: setpgid + +//TODO: setregid + +//TODO: setrens + +//TODO: setreuid + +//TODO: sigaction + +//TODO: sigprocmask + +//TODO: sigreturn + +#[test] +fn umask() { + let old = dbg!(crate::umask(0o244)).unwrap(); + assert_eq!(dbg!(crate::umask(old)), Ok(0o244)); +} + +#[test] +fn unlink() { + let path = "file:/tmp/syscall-tests-unlink"; + let fd = dbg!( + crate::open( + dbg!(path), + crate::O_CREAT | crate::O_RDWR | crate::O_CLOEXEC + ) + ).unwrap(); + + assert_eq!(dbg!(crate::close(fd)), Ok(0)); + + assert_eq!(dbg!(crate::unlink(path)), Ok(0)); +} + +//TODO: virttophys + +// waitpid tested by clone + +//TODO: write + +#[test] +fn sched_yield() { + assert_eq!(dbg!(crate::sched_yield()), Ok(0)); +} + +#[test] +fn sigaction() { + use std::{ + mem, + sync::atomic::{AtomicBool, Ordering} + }; + + static SA_HANDLER_WAS_RAN: AtomicBool = AtomicBool::new(false); + static SA_HANDLER_2_WAS_IGNORED: AtomicBool = AtomicBool::new(false); + + let child = unsafe { crate::clone(crate::CLONE_VM).unwrap() }; + + if child == 0 { + let pid = crate::getpid().unwrap(); + + extern "C" fn hello_im_a_signal_handler(signal: usize) { + assert_eq!(signal, crate::SIGUSR1); + SA_HANDLER_WAS_RAN.store(true, Ordering::SeqCst); + } + + let my_signal_handler = crate::SigAction { + sa_handler: Some(hello_im_a_signal_handler), + ..Default::default() + }; + crate::sigaction(crate::SIGUSR1, Some(&my_signal_handler), None).unwrap(); + + crate::kill(pid, crate::SIGUSR1).unwrap(); // calls handler + + let mut old_signal_handler = crate::SigAction::default(); + crate::sigaction( + crate::SIGUSR1, + Some(&crate::SigAction { + sa_handler: unsafe { mem::transmute::>(crate::SIG_IGN) }, + ..Default::default() + }), + Some(&mut old_signal_handler) + ).unwrap(); + assert_eq!(my_signal_handler, old_signal_handler); + + crate::kill(pid, crate::SIGUSR1).unwrap(); // does nothing + + SA_HANDLER_2_WAS_IGNORED.store(true, Ordering::SeqCst); + + crate::sigaction( + crate::SIGUSR1, + Some(&crate::SigAction { + sa_handler: unsafe { mem::transmute::>(crate::SIG_DFL) }, + ..Default::default() + }), + Some(&mut old_signal_handler) + ).unwrap(); + + crate::kill(pid, crate::SIGUSR1).unwrap(); // actually exits + } else { + let mut status = 0; + dbg!(crate::waitpid(child, &mut status, crate::WaitFlags::empty())).unwrap(); + + assert!(crate::wifsignaled(status)); + assert_eq!(crate::wtermsig(status), crate::SIGUSR1); + + assert!(SA_HANDLER_WAS_RAN.load(Ordering::SeqCst)); + assert!(SA_HANDLER_2_WAS_IGNORED.load(Ordering::SeqCst)); + } +} diff --git a/third_party/cargo/vendor/regex-1.4.2/.cargo-checksum.json b/third_party/cargo/vendor/regex-1.4.2/.cargo-checksum.json deleted file mode 100644 index cc004dd..0000000 --- a/third_party/cargo/vendor/regex-1.4.2/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"CHANGELOG.md":"3948880aff74f1a7025e8372cb7589e1228a910812ee226b9d31f0f2948b3387","Cargo.lock":"60f88c04a7090af68208fa7db066ce6858dfa76a59015bf92cd9bc979bd419fc","Cargo.toml":"7596370d3bb9123d29fc15f7d60bf3da24a94d5f3cbc4448da1861d23ccdaf25","HACKING.md":"17818f7a17723608f6bdbe6388ad0a913d4f96f76a16649aaf4e274b1fa0ea97","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","PERFORMANCE.md":"c776b18758b6dc8f2f9d37e9a95261f75c5f744925e8ddf216b83953bf7467b7","README.md":"ea639f8259ae4ff721ea3792d3d0529975e7d5ca80d67d0a27bd82ef464f5d0a","UNICODE.md":"27be97e94d0819ae18ae71029559c3de21c8ffd343d4a791959d0fc22b06dfe6","examples/regexdna-input.txt":"156a49710bb3e1ed4bc2bbb0af0f383b747b3d0281453cfff39c296124c598f8","examples/regexdna-output.txt":"35e85b19b70a893d752fd43e54e1e9da08bac43559191cea85b33387c24c4cc1","examples/shootout-regex-dna-bytes.rs":"e4f0d94e6d9cd4c7f6e340ed51b163f3331ce616dba4539d09f40919548d81d3","examples/shootout-regex-dna-cheat.rs":"bd5f4832c9a2e6f175d79064b2c4ee28dcae4b971f9618586664f99963bd0f8e","examples/shootout-regex-dna-replace.rs":"056e9ee51327a1cf9bd1da007e8c0af9c80a3e7fc2b3a3f63d0cf1b6b244ac74","examples/shootout-regex-dna-single-cheat.rs":"0beeb210972597db3a5c41901c78d78635681a833eba059064b28902e41d6f86","examples/shootout-regex-dna-single.rs":"a5d1ad8ebcfe9dd58bddc0d1ad838112cbce780f8f93c46892a70a1e25fd7c7f","examples/shootout-regex-dna.rs":"7724deec3d94cc5b55077380f7b9664edb5a49eaaa4cc7ba8356579c2ade7129","rustfmt.toml":"1ca600239a27401c4a43f363cf3f38183a212affc1f31bff3ae93234bbaec228","src/backtrack.rs":"bb24a32bc0d2f2f1c94439d8d0879ad8d15c910d4b9ab86c2833d93945cb088c","src/cache.rs":"df7b83b4f7278705ad1ecdf1284b962cc3b145797f1676c9a59e32c5944c848c","src/compile.rs":"81cf0b44924be2c0d66cbba92ee5649ff6403acbf8355d70e54acd977dc14cb4","src/dfa.rs":"50decee8c2460fa66276ecbf968223b242dd17f02ab731539911c5d261524d11","src/error.rs":"4d03ca3205e373125a0c9a4270fc1c5aa7b5a661b11db3508b563945a0827301","src/exec.rs":"a27ed0cb907dab6540fdf8cc785c799d7ea17f15f1236b80341934586874cd58","src/expand.rs":"6a1e012e84658f54ecefd6142173f1ca14eeeac52f4181a85ccc49eb94e5cd81","src/find_byte.rs":"b387247b77e3269f057c3399aefe5a815032c3af918c876f80eb4b282e4eb95e","src/freqs.rs":"255555f3d95b08a5bb3bc2f38d5a06cc100a39c0f0127fe4f50c33afa1cadc65","src/input.rs":"0bb20717cb630803f78b921260c96984a38a57685f07d9aee16b12deaa1d233b","src/lib.rs":"996120b528d88f27c3fc761a2f6e781236bb9cf48e25d576ba9b9ee8d31782b4","src/literal/imp.rs":"f242b29261423342e8cd941bdeb26b95eed73357fc313f8a019032374b77e056","src/literal/mod.rs":"46739643baa0cd5d1b8fc4521df3d727815c61e583af2ffca8b7b63bad3fa50e","src/pattern.rs":"e6124b403c18344675aa341faf9ae2f592193ef89f1c4a5e1cee135b8b34dd21","src/pikevm.rs":"3dd5794eecfe4ec80bee96d163025a417432c489732e84e125e51a4bc75d0235","src/prog.rs":"f47ac3accf7bd3456bd20902c6315f4063bbb6d9570c9b2f8309a0a1566d6323","src/re_builder.rs":"3ee35fa798c824be941c03e40e5dbeef47c96c2d19aeac2e2f7ca59727ff213b","src/re_bytes.rs":"c462d056c3d9f1b37c25d69ac352923e668fed40e5051c56b989023318c06d56","src/re_set.rs":"288d763014f428d0fed9aed9765688dfedce83e65174ae3648cb58548d5eea24","src/re_trait.rs":"e1964a8c601a692d41206f518709c26e9da81d389fcd6bdb6af99021b12e01d9","src/re_unicode.rs":"c26db778afde074d087c02768a93db952da0472a6d8244816e4482515248a480","src/sparse.rs":"43a0ad1c058228121523a2392bb20126b36760228845db157c8819f835e9bfde","src/testdata/LICENSE":"58cf078acc03da3e280a938c2bd9943f554fc9b6ced89ad93ba35ca436872899","src/testdata/README":"45f869e37f798905c773bfbe0ef19a5fb7e585cbf0b7c21b5b5a784e8cec3c14","src/testdata/basic.dat":"b5b33aa89d48a61cd67cb1fbfd8f70e62c83e30b86256f9f915a5190dd38ff06","src/testdata/nullsubexpr.dat":"496ac0278eec3b6d9170faace14554569032dd3d909618364d9326156de39ecf","src/testdata/repetition.dat":"1f7959063015b284b18a4a2c1c8b416d438a2d6c4b1a362da43406b865f50e69","src/utf8.rs":"708615a4859110cc9766b342a9c1da6c5c4a8a04ad239046b2725385db977efe","test":"bd7ca64a788d1f622ae10c5ac77160b10fc5f0d6adb7f3ba1828637f0ca68c81","tests/api.rs":"7b2a0ef75e99b9776094967bd66e9cdeaa8e11359f5f0a12bd08ef0e8d0c11fc","tests/api_str.rs":"2ae38c04e7e8fac008b609a820d0b1561ba75f39b0edc0987d6d3d06132da77f","tests/bytes.rs":"edc50f526c5fee43df89d639ef18b237e4eb91e9d533bfc43f3cbab7417d38ba","tests/consistent.rs":"8dadc60727306de8a539325d1d2af84172e5da2cbf50a71bb0c53eafe8039912","tests/crates_regex.rs":"91a59d470e0700b4bcb3ff735d06799f3107b8ef4875a2e9904607b164be0326","tests/crazy.rs":"d18ebe88bfe0f61df2761710a5f2362187f071bc952b4c0c898e5a8bfb58cce6","tests/flags.rs":"05caace2c81a99d2168037f3a38035d4dffe9f85ef3ebd7ef18b1bc6612f1ea8","tests/fowler.rs":"d78cf914de40b1e125cc92b65ccb444d462586bd07b5e05de4e4a1b5de16aa76","tests/macros.rs":"6db70c16fc90df13e6b30d2b606f8b6dd4dc976697967f6ee001b15aab6d0b19","tests/macros_bytes.rs":"73e2979f60acb009066c3a9a6c5809a0069a60c67fff7db675ea4e59299a7292","tests/macros_str.rs":"4c79ff4f2f5c379503794dd7e4116b3e7d4ac7679e47b81959fa054110a76c1a","tests/misc.rs":"395f52793fa022e4cdda78675b6a6fba1a3106b4b99c834c39f7801574054bd1","tests/multiline.rs":"1b1a3326ed976437c1357f01d81833ece7ea244f38826246eab55cacd5d0862a","tests/noparse.rs":"12b6be0eff3d80779d33c6459396c74c0f6ebf4ddc9f1d33c3e747ea9e3bf268","tests/regression.rs":"4d4aecf57ce5accf73fe8818267e8d45c9a15896d40093a5b5e1a09007a121a1","tests/regression_fuzz.rs":"f57b63e5fcc602d4ca6997411af4a706a6cf307f24ab0b5340a08fd4721bf373","tests/replace.rs":"fb3dd97c2877b71973065a74916cdef40d65a19a92c1ecfc117edfcd9eab3ced","tests/searcher.rs":"ce35e47b0a276a7e8c9060c6a0b225ffba163aebc61fbc15555a6897fa0e552c","tests/set.rs":"f1e2af6baeeaed3cc99ed347ff516fe7b2eb0027ef64b891502e1486598eaf8a","tests/shortest_match.rs":"a2c94390c0d61bc24796b4c1288c924e90c8c9c6156fdebb858175177a194a42","tests/suffix_reverse.rs":"b95f89397404871227d9efe6df23b9ded147f183db81597e608f693955c668b5","tests/test_backtrack.rs":"1e286679d643887f7b78ef5a74f5392ff27fa462b99891ce31938db1eacb3842","tests/test_backtrack_bytes.rs":"f66f2ed407795e92ae66eaa3b4b946acfe00d9ea422944c86353dd28812df5bb","tests/test_backtrack_utf8bytes.rs":"9d8c236fbdfa5092230f19ca4d2a7d647f68811d9ffa0813899d924e11d8fc0b","tests/test_crates_regex.rs":"b385d7ca10ed308b8d57074adb9525e18d3faadb5aa883e831dfa4f6669ba58d","tests/test_default.rs":"bb8a7a61fdf05dc52f65cad9ec80c95807f5911c6a1e9fa67fbe6538653a7f01","tests/test_default_bytes.rs":"fb3310fc315f7282358dcd98d156c31d66ca2432199afe012cf8921f459167a2","tests/test_nfa.rs":"97266c5edb15e5cde1496049a3ad0be4de33352dc32492f086d5351411ebe1ab","tests/test_nfa_bytes.rs":"9aa510e9583f847467c26ce902bd7e1c66cdd610cd50da4a1c1379afa35d4a53","tests/test_nfa_utf8bytes.rs":"2c22e16fa75edb5dbd278f2b8619404404a95b0792b31c440c9751c4aa2f7086","tests/unicode.rs":"4bf85f5c3d547fa8b5623194a09b6413067499dfbe7c1d29d8b50bf1cddacf6b","tests/word_boundary.rs":"7081317ddcec1e82dd4a2090a571c6abf2ff4bbfa8cd10395e1eb3f386157fae","tests/word_boundary_ascii.rs":"cd0be5b5b485de0ba7994b42e2864585556c3d2d8bf5eab05b58931d9aaf4b87","tests/word_boundary_unicode.rs":"75dbcc35d3abc0f9795c2ea99e216dc227b0a5b58e9ca5eef767815ff0513921"},"package":"38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c"} \ No newline at end of file diff --git a/third_party/cargo/vendor/regex-1.4.2/src/cache.rs b/third_party/cargo/vendor/regex-1.4.2/src/cache.rs deleted file mode 100644 index dbb7e64..0000000 --- a/third_party/cargo/vendor/regex-1.4.2/src/cache.rs +++ /dev/null @@ -1,100 +0,0 @@ -// This module defines a common API for caching internal runtime state. -// The `thread_local` crate provides an extremely optimized version of this. -// However, if the perf-cache feature is disabled, then we drop the -// thread_local dependency and instead use a pretty naive caching mechanism -// with a mutex. -// -// Strictly speaking, the CachedGuard isn't necessary for the much more -// flexible thread_local API, but implementing thread_local's API doesn't -// seem possible in purely safe code. - -pub use self::imp::{Cached, CachedGuard}; - -#[cfg(feature = "perf-cache")] -mod imp { - use thread_local::CachedThreadLocal; - - #[derive(Debug)] - pub struct Cached(CachedThreadLocal); - - #[derive(Debug)] - pub struct CachedGuard<'a, T: 'a>(&'a T); - - impl Cached { - pub fn new() -> Cached { - Cached(CachedThreadLocal::new()) - } - - pub fn get_or(&self, create: impl FnOnce() -> T) -> CachedGuard { - CachedGuard(self.0.get_or(|| create())) - } - } - - impl<'a, T: Send> CachedGuard<'a, T> { - pub fn value(&self) -> &T { - self.0 - } - } -} - -#[cfg(not(feature = "perf-cache"))] -mod imp { - use std::marker::PhantomData; - use std::panic::UnwindSafe; - use std::sync::Mutex; - - #[derive(Debug)] - pub struct Cached { - stack: Mutex>, - /// When perf-cache is enabled, the thread_local crate is used, and - /// its CachedThreadLocal impls Send, Sync and UnwindSafe, but NOT - /// RefUnwindSafe. However, a Mutex impls RefUnwindSafe. So in order - /// to keep the APIs consistent regardless of whether perf-cache is - /// enabled, we force this type to NOT impl RefUnwindSafe too. - /// - /// Ideally, we should always impl RefUnwindSafe, but it seems a little - /// tricky to do that right now. - /// - /// See also: https://github.com/rust-lang/regex/issues/576 - _phantom: PhantomData>, - } - - #[derive(Debug)] - pub struct CachedGuard<'a, T: 'a + Send> { - cache: &'a Cached, - value: Option, - } - - impl Cached { - pub fn new() -> Cached { - Cached { stack: Mutex::new(vec![]), _phantom: PhantomData } - } - - pub fn get_or(&self, create: impl FnOnce() -> T) -> CachedGuard { - let mut stack = self.stack.lock().unwrap(); - match stack.pop() { - None => CachedGuard { cache: self, value: Some(create()) }, - Some(value) => CachedGuard { cache: self, value: Some(value) }, - } - } - - fn put(&self, value: T) { - let mut stack = self.stack.lock().unwrap(); - stack.push(value); - } - } - - impl<'a, T: Send> CachedGuard<'a, T> { - pub fn value(&self) -> &T { - self.value.as_ref().unwrap() - } - } - - impl<'a, T: Send> Drop for CachedGuard<'a, T> { - fn drop(&mut self) { - if let Some(value) = self.value.take() { - self.cache.put(value); - } - } - } -} diff --git a/third_party/cargo/vendor/regex-1.4.5/.cargo-checksum.json b/third_party/cargo/vendor/regex-1.4.5/.cargo-checksum.json new file mode 100644 index 0000000..ab78172 --- /dev/null +++ b/third_party/cargo/vendor/regex-1.4.5/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"04628b6519bbb7d3d5a36683626f523d74c23c63121061dc3621933f497629c7","Cargo.lock":"e73c78bab60928f36156c9c731d883715ff6fc0972a530731e88c9d9ffc3abc1","Cargo.toml":"2412b81f4d83957eaea2dcfb402ee6bcc591b94f8c729d3395c89192825f6143","HACKING.md":"17818f7a17723608f6bdbe6388ad0a913d4f96f76a16649aaf4e274b1fa0ea97","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","PERFORMANCE.md":"c776b18758b6dc8f2f9d37e9a95261f75c5f744925e8ddf216b83953bf7467b7","README.md":"05b8c25fbad8075308fbf1a20d4b0d2eb5825b7847a297b77e5453247885bd0f","UNICODE.md":"a8a8399540eed000d19420135a527f400247a04572e44d124c786b870f518776","examples/regexdna-input.txt":"156a49710bb3e1ed4bc2bbb0af0f383b747b3d0281453cfff39c296124c598f8","examples/regexdna-output.txt":"35e85b19b70a893d752fd43e54e1e9da08bac43559191cea85b33387c24c4cc1","examples/shootout-regex-dna-bytes.rs":"bfbb5b0751768d2914f3839b2f434e18c3df5a1db333b6c09c15d4c9f36e2362","examples/shootout-regex-dna-cheat.rs":"31153b19d6153e10a505bcefeaffc6ae5ec15c5b9e602ec1bdf1c008c71ac0fb","examples/shootout-regex-dna-replace.rs":"056e9ee51327a1cf9bd1da007e8c0af9c80a3e7fc2b3a3f63d0cf1b6b244ac74","examples/shootout-regex-dna-single-cheat.rs":"00d97b70df23236692d30d207d956e61896f6dba18fea0f6344bec6902a3490a","examples/shootout-regex-dna-single.rs":"81690e774c42899e6ab160580b30053531ec49678f088e1bc54cedf64e437b6c","examples/shootout-regex-dna.rs":"25c1c468238f0d45df1ff64748b1305ba2408b4102b8215a4e1a983e90221aef","rustfmt.toml":"1ca600239a27401c4a43f363cf3f38183a212affc1f31bff3ae93234bbaec228","src/backtrack.rs":"581820b2c08839832489d1ebb5beda637ca21c50bc0eabe6658a0aebbd73eebc","src/compile.rs":"881e813fa99837d457e96bee18ec2f30965be2a12106700584829147f3b0036c","src/dfa.rs":"c53c6d4f67f4dbe0577a310f155c12cf144a01b3a9e773158217892e8a9dc6b6","src/error.rs":"4d03ca3205e373125a0c9a4270fc1c5aa7b5a661b11db3508b563945a0827301","src/exec.rs":"ae8b553b0b5fabcafcbedabd610f81baa7b7451839eab18085cb580efaeddc4b","src/expand.rs":"07480cf505c2ac948a0520eaac11537f18d8afa9d3565e1e63f3dd9bbcfcde6e","src/find_byte.rs":"b387247b77e3269f057c3399aefe5a815032c3af918c876f80eb4b282e4eb95e","src/freqs.rs":"255555f3d95b08a5bb3bc2f38d5a06cc100a39c0f0127fe4f50c33afa1cadc65","src/input.rs":"0bb20717cb630803f78b921260c96984a38a57685f07d9aee16b12deaa1d233b","src/lib.rs":"06569d8daee7dc736e80fa8c5dfeb5ee39f47ec59c38157f8b86d609e8f19d66","src/literal/imp.rs":"db492e69b088cab9d25b65163f38a61684c5c86546266a81f556aea646a08342","src/literal/mod.rs":"46739643baa0cd5d1b8fc4521df3d727815c61e583af2ffca8b7b63bad3fa50e","src/pattern.rs":"e6124b403c18344675aa341faf9ae2f592193ef89f1c4a5e1cee135b8b34dd21","src/pikevm.rs":"3dd5794eecfe4ec80bee96d163025a417432c489732e84e125e51a4bc75d0235","src/pool.rs":"7d3408351f9c4cce491511c9636906f2827642a6483afc0dda32ca6287c2f69e","src/prog.rs":"f47ac3accf7bd3456bd20902c6315f4063bbb6d9570c9b2f8309a0a1566d6323","src/re_builder.rs":"94ffcf23b009ff67f526dceede829fd02e7f5bf78bfc8ee1195ea571540b7a28","src/re_bytes.rs":"48b0c449bf4864289f5f2250f4993ec26b328a3200743df32549e8f0e28f1888","src/re_set.rs":"bbb1c40725b3fe8533e0c693ac9dc985d03334def67d463604a9a23d610cbc2d","src/re_trait.rs":"49b027ac3f1b981f41bba1ea243e74aa94692837f7c2c10229c7cbd3277e03b4","src/re_unicode.rs":"efd0acf21b1253779ab1f3e6d34709eb1dd109ff93cb3e42d1152870ef390289","src/sparse.rs":"66845b4e8c1a6cb92bcd7973a5bd04d6873b6d669d6737b71bc4f9f04740b85b","src/testdata/LICENSE":"58cf078acc03da3e280a938c2bd9943f554fc9b6ced89ad93ba35ca436872899","src/testdata/README":"45f869e37f798905c773bfbe0ef19a5fb7e585cbf0b7c21b5b5a784e8cec3c14","src/testdata/basic.dat":"b5b33aa89d48a61cd67cb1fbfd8f70e62c83e30b86256f9f915a5190dd38ff06","src/testdata/nullsubexpr.dat":"496ac0278eec3b6d9170faace14554569032dd3d909618364d9326156de39ecf","src/testdata/repetition.dat":"1f7959063015b284b18a4a2c1c8b416d438a2d6c4b1a362da43406b865f50e69","src/utf8.rs":"708615a4859110cc9766b342a9c1da6c5c4a8a04ad239046b2725385db977efe","test":"bd7ca64a788d1f622ae10c5ac77160b10fc5f0d6adb7f3ba1828637f0ca68c81","tests/api.rs":"7b2a0ef75e99b9776094967bd66e9cdeaa8e11359f5f0a12bd08ef0e8d0c11fc","tests/api_str.rs":"2ae38c04e7e8fac008b609a820d0b1561ba75f39b0edc0987d6d3d06132da77f","tests/bytes.rs":"edc50f526c5fee43df89d639ef18b237e4eb91e9d533bfc43f3cbab7417d38ba","tests/consistent.rs":"d69435154c09478076497216e43081a835ac65147181a4fbddad7bff469605b2","tests/crates_regex.rs":"91a59d470e0700b4bcb3ff735d06799f3107b8ef4875a2e9904607b164be0326","tests/crazy.rs":"c0d56380dff19bdd5d7a3eb731d0e2dc564e169a1b73c81e1879b1e87f5f5f77","tests/flags.rs":"05caace2c81a99d2168037f3a38035d4dffe9f85ef3ebd7ef18b1bc6612f1ea8","tests/fowler.rs":"d78cf914de40b1e125cc92b65ccb444d462586bd07b5e05de4e4a1b5de16aa76","tests/macros.rs":"6db70c16fc90df13e6b30d2b606f8b6dd4dc976697967f6ee001b15aab6d0b19","tests/macros_bytes.rs":"a049f528a93173a1bb176cd46932dce1880679f4a1752e099be920f0e4546fd0","tests/macros_str.rs":"e585b1461374c45a2eca44ca045bc3c1fe984b2b4212e432b0c695b420e708b7","tests/misc.rs":"395f52793fa022e4cdda78675b6a6fba1a3106b4b99c834c39f7801574054bd1","tests/multiline.rs":"1b1a3326ed976437c1357f01d81833ece7ea244f38826246eab55cacd5d0862a","tests/noparse.rs":"12b6be0eff3d80779d33c6459396c74c0f6ebf4ddc9f1d33c3e747ea9e3bf268","tests/regression.rs":"4d4aecf57ce5accf73fe8818267e8d45c9a15896d40093a5b5e1a09007a121a1","tests/regression_fuzz.rs":"f57b63e5fcc602d4ca6997411af4a706a6cf307f24ab0b5340a08fd4721bf373","tests/replace.rs":"16ae4485901bde78c044225e0ff01560c11c765a8768ce43b9ce841a98a8eddc","tests/searcher.rs":"ce35e47b0a276a7e8c9060c6a0b225ffba163aebc61fbc15555a6897fa0e552c","tests/set.rs":"f1e2af6baeeaed3cc99ed347ff516fe7b2eb0027ef64b891502e1486598eaf8a","tests/shortest_match.rs":"a2c94390c0d61bc24796b4c1288c924e90c8c9c6156fdebb858175177a194a42","tests/suffix_reverse.rs":"b95f89397404871227d9efe6df23b9ded147f183db81597e608f693955c668b5","tests/test_backtrack.rs":"1e286679d643887f7b78ef5a74f5392ff27fa462b99891ce31938db1eacb3842","tests/test_backtrack_bytes.rs":"f66f2ed407795e92ae66eaa3b4b946acfe00d9ea422944c86353dd28812df5bb","tests/test_backtrack_utf8bytes.rs":"9d8c236fbdfa5092230f19ca4d2a7d647f68811d9ffa0813899d924e11d8fc0b","tests/test_crates_regex.rs":"b385d7ca10ed308b8d57074adb9525e18d3faadb5aa883e831dfa4f6669ba58d","tests/test_default.rs":"048640025e537fd74252e68a534a6fb43d7cf457998c05e7acda4fe511907de5","tests/test_default_bytes.rs":"fb3310fc315f7282358dcd98d156c31d66ca2432199afe012cf8921f459167a2","tests/test_nfa.rs":"97266c5edb15e5cde1496049a3ad0be4de33352dc32492f086d5351411ebe1ab","tests/test_nfa_bytes.rs":"9aa510e9583f847467c26ce902bd7e1c66cdd610cd50da4a1c1379afa35d4a53","tests/test_nfa_utf8bytes.rs":"2c22e16fa75edb5dbd278f2b8619404404a95b0792b31c440c9751c4aa2f7086","tests/unicode.rs":"4bf85f5c3d547fa8b5623194a09b6413067499dfbe7c1d29d8b50bf1cddacf6b","tests/word_boundary.rs":"7081317ddcec1e82dd4a2090a571c6abf2ff4bbfa8cd10395e1eb3f386157fae","tests/word_boundary_ascii.rs":"cd0be5b5b485de0ba7994b42e2864585556c3d2d8bf5eab05b58931d9aaf4b87","tests/word_boundary_unicode.rs":"75dbcc35d3abc0f9795c2ea99e216dc227b0a5b58e9ca5eef767815ff0513921"},"package":"957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19"} \ No newline at end of file diff --git a/third_party/cargo/vendor/regex-1.4.2/BUILD.bazel b/third_party/cargo/vendor/regex-1.4.5/BUILD.bazel similarity index 93% rename from third_party/cargo/vendor/regex-1.4.2/BUILD.bazel rename to third_party/cargo/vendor/regex-1.4.5/BUILD.bazel index f34e29d..2bc0cef 100644 --- a/third_party/cargo/vendor/regex-1.4.2/BUILD.bazel +++ b/third_party/cargo/vendor/regex-1.4.5/BUILD.bazel @@ -55,7 +55,6 @@ rust_library( "perf-inline", "perf-literal", "std", - "thread_local", "unicode", "unicode-age", "unicode-bool", @@ -76,13 +75,12 @@ rust_library( "cargo-raze", "manual", ], - version = "1.4.2", + version = "1.4.5", # buildifier: leave-alone deps = [ "//third_party/cargo/vendor/aho-corasick-0.7.15:aho_corasick", "//third_party/cargo/vendor/memchr-2.3.4:memchr", - "//third_party/cargo/vendor/regex-syntax-0.6.21:regex_syntax", - "//third_party/cargo/vendor/thread_local-1.1.0:thread_local", + "//third_party/cargo/vendor/regex-syntax-0.6.23:regex_syntax", ], ) diff --git a/third_party/cargo/vendor/regex-1.4.2/CHANGELOG.md b/third_party/cargo/vendor/regex-1.4.5/CHANGELOG.md similarity index 95% rename from third_party/cargo/vendor/regex-1.4.2/CHANGELOG.md rename to third_party/cargo/vendor/regex-1.4.5/CHANGELOG.md index 9dfe497..f294972 100644 --- a/third_party/cargo/vendor/regex-1.4.2/CHANGELOG.md +++ b/third_party/cargo/vendor/regex-1.4.5/CHANGELOG.md @@ -1,3 +1,45 @@ +1.4.5 (2021-03-14) +================== +This is a small patch release that fixes a regression in the size of a `Regex` +in the 1.4.4 release. Prior to 1.4.4, a `Regex` was 552 bytes. In the 1.4.4 +release, it was 856 bytes due to internal changes. In this release, a `Regex` +is now 16 bytes. In general, the size of a `Regex` was never something that was +on my radar, but this increased size in the 1.4.4 release seems to have crossed +a threshold and resulted in stack overflows in some programs. + +* [BUG #750](https://github.com/rust-lang/regex/pull/750): + Fixes stack overflows seemingly caused by a large `Regex` size by decreasing + its size. + + +1.4.4 (2021-03-11) +================== +This is a small patch release that contains some bug fixes. Notably, it also +drops the `thread_local` (and `lazy_static`, via transitivity) dependencies. + +Bug fixes: + +* [BUG #362](https://github.com/rust-lang/regex/pull/362): + Memory leaks caused by an internal caching strategy should now be fixed. +* [BUG #576](https://github.com/rust-lang/regex/pull/576): + All regex types now implement `UnwindSafe` and `RefUnwindSafe`. +* [BUG #728](https://github.com/rust-lang/regex/pull/749): + Add missing `Replacer` impls for `Vec`, `String`, `Cow`, etc. + + +1.4.3 (2021-01-08) +================== +This is a small patch release that adds some missing standard trait +implementations for some types in the public API. + +Bug fixes: + +* [BUG #734](https://github.com/rust-lang/regex/pull/734): + Add `FusedIterator` and `ExactSizeIterator` impls to iterator types. +* [BUG #735](https://github.com/rust-lang/regex/pull/735): + Add missing `Debug` impls to public API types. + + 1.4.2 (2020-11-01) ================== This is a small bug fix release that bans `\P{any}`. We previously banned empty diff --git a/third_party/cargo/vendor/regex-1.4.5/Cargo.lock b/third_party/cargo/vendor/regex-1.4.5/Cargo.lock new file mode 100644 index 0000000..2ea6afb --- /dev/null +++ b/third_party/cargo/vendor/regex-1.4.5/Cargo.lock @@ -0,0 +1,98 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b476ce7103678b0c6d3d395dbbae31d48ff910bd28be979ba5d48c6351131d0d" +dependencies = [ + "memchr", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[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.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614" + +[[package]] +name = "memchr" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" + +[[package]] +name = "quickcheck" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6" +dependencies = [ + "rand", +] + +[[package]] +name = "rand" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "regex" +version = "1.4.5" +dependencies = [ + "aho-corasick", + "lazy_static", + "memchr", + "quickcheck", + "rand", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/third_party/cargo/vendor/regex-1.4.2/Cargo.toml b/third_party/cargo/vendor/regex-1.4.5/Cargo.toml similarity index 94% rename from third_party/cargo/vendor/regex-1.4.2/Cargo.toml rename to third_party/cargo/vendor/regex-1.4.5/Cargo.toml index b6213ea..6f8ef4e 100644 --- a/third_party/cargo/vendor/regex-1.4.2/Cargo.toml +++ b/third_party/cargo/vendor/regex-1.4.5/Cargo.toml @@ -12,7 +12,7 @@ [package] name = "regex" -version = "1.4.2" +version = "1.4.5" authors = ["The Rust Project Developers"] exclude = ["/scripts/*", "/.github/*"] autotests = false @@ -80,27 +80,25 @@ version = "2.2.1" optional = true [dependencies.regex-syntax] -version = "0.6.21" +version = "0.6.22" default-features = false - -[dependencies.thread_local] -version = "1" -optional = true [dev-dependencies.lazy_static] version = "1" [dev-dependencies.quickcheck] -version = "0.8" +version = "1.0.3" default-features = false [dev-dependencies.rand] -version = "0.6.5" +version = "0.8.3" +features = ["getrandom", "small_rng"] +default-features = false [features] default = ["std", "perf", "unicode", "regex-syntax/default"] pattern = [] perf = ["perf-cache", "perf-dfa", "perf-inline", "perf-literal"] -perf-cache = ["thread_local"] +perf-cache = [] perf-dfa = [] perf-inline = [] perf-literal = ["aho-corasick", "memchr"] diff --git a/third_party/cargo/vendor/regex-1.4.2/HACKING.md b/third_party/cargo/vendor/regex-1.4.5/HACKING.md similarity index 100% rename from third_party/cargo/vendor/regex-1.4.2/HACKING.md rename to third_party/cargo/vendor/regex-1.4.5/HACKING.md diff --git a/third_party/cargo/vendor/regex-1.4.2/LICENSE-APACHE b/third_party/cargo/vendor/regex-1.4.5/LICENSE-APACHE similarity index 100% rename from third_party/cargo/vendor/regex-1.4.2/LICENSE-APACHE rename to third_party/cargo/vendor/regex-1.4.5/LICENSE-APACHE diff --git a/third_party/cargo/vendor/regex-1.4.2/LICENSE-MIT b/third_party/cargo/vendor/regex-1.4.5/LICENSE-MIT similarity index 100% rename from third_party/cargo/vendor/regex-1.4.2/LICENSE-MIT rename to third_party/cargo/vendor/regex-1.4.5/LICENSE-MIT diff --git a/third_party/cargo/vendor/regex-1.4.2/PERFORMANCE.md b/third_party/cargo/vendor/regex-1.4.5/PERFORMANCE.md similarity index 100% rename from third_party/cargo/vendor/regex-1.4.2/PERFORMANCE.md rename to third_party/cargo/vendor/regex-1.4.5/PERFORMANCE.md diff --git a/third_party/cargo/vendor/regex-1.4.2/README.md b/third_party/cargo/vendor/regex-1.4.5/README.md similarity index 98% rename from third_party/cargo/vendor/regex-1.4.2/README.md rename to third_party/cargo/vendor/regex-1.4.5/README.md index 8c05a90..f7a2554 100644 --- a/third_party/cargo/vendor/regex-1.4.2/README.md +++ b/third_party/cargo/vendor/regex-1.4.5/README.md @@ -245,12 +245,12 @@ supported version of Rust. 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) + https://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or - http://opensource.org/licenses/MIT) + https://opensource.org/licenses/MIT) at your option. The data in `regex-syntax/src/unicode_tables/` is licensed under the Unicode License Agreement -([LICENSE-UNICODE](http://www.unicode.org/copyright.html#License)). +([LICENSE-UNICODE](https://www.unicode.org/copyright.html#License)). diff --git a/third_party/cargo/vendor/regex-1.4.2/UNICODE.md b/third_party/cargo/vendor/regex-1.4.5/UNICODE.md similarity index 87% rename from third_party/cargo/vendor/regex-1.4.2/UNICODE.md rename to third_party/cargo/vendor/regex-1.4.5/UNICODE.md index 18fa9b1..df7d21e 100644 --- a/third_party/cargo/vendor/regex-1.4.2/UNICODE.md +++ b/third_party/cargo/vendor/regex-1.4.5/UNICODE.md @@ -1,7 +1,7 @@ # Unicode conformance This document describes the regex crate's conformance to Unicode's -[UTS#18](http://unicode.org/reports/tr18/) +[UTS#18](https://unicode.org/reports/tr18/) report, which lays out 3 levels of support: Basic, Extended and Tailored. Full support for Level 1 ("Basic Unicode Support") is provided with two @@ -10,7 +10,7 @@ exceptions: 1. Line boundaries are not Unicode aware. Namely, only the `\n` (`END OF LINE`) character is recognized as a line boundary. 2. The compatibility properties specified by - [RL1.2a](http://unicode.org/reports/tr18/#RL1.2a) + [RL1.2a](https://unicode.org/reports/tr18/#RL1.2a) are ASCII-only definitions. Little to no support is provided for either Level 2 or Level 3. For the most @@ -61,18 +61,18 @@ provide a convenient way to construct character classes of groups of code points specified by Unicode. The regex crate does not provide exhaustive support, but covers a useful subset. In particular: -* [General categories](http://unicode.org/reports/tr18/#General_Category_Property) -* [Scripts and Script Extensions](http://unicode.org/reports/tr18/#Script_Property) -* [Age](http://unicode.org/reports/tr18/#Age) +* [General categories](https://unicode.org/reports/tr18/#General_Category_Property) +* [Scripts and Script Extensions](https://unicode.org/reports/tr18/#Script_Property) +* [Age](https://unicode.org/reports/tr18/#Age) * A smattering of boolean properties, including all of those specified by - [RL1.2](http://unicode.org/reports/tr18/#RL1.2) explicitly. + [RL1.2](https://unicode.org/reports/tr18/#RL1.2) explicitly. In all cases, property name and value abbreviations are supported, and all names/values are matched loosely without regard for case, whitespace or underscores. Property name aliases can be found in Unicode's -[`PropertyAliases.txt`](http://www.unicode.org/Public/UCD/latest/ucd/PropertyAliases.txt) +[`PropertyAliases.txt`](https://www.unicode.org/Public/UCD/latest/ucd/PropertyAliases.txt) file, while property value aliases can be found in Unicode's -[`PropertyValueAliases.txt`](http://www.unicode.org/Public/UCD/latest/ucd/PropertyValueAliases.txt) +[`PropertyValueAliases.txt`](https://www.unicode.org/Public/UCD/latest/ucd/PropertyValueAliases.txt) file. The syntax supported is also consistent with the UTS#18 recommendation: @@ -149,10 +149,10 @@ properties correspond to properties required by RL1.2): ## RL1.2a Compatibility Properties -[UTS#18 RL1.2a](http://unicode.org/reports/tr18/#RL1.2a) +[UTS#18 RL1.2a](https://unicode.org/reports/tr18/#RL1.2a) The regex crate only provides ASCII definitions of the -[compatibility properties documented in UTS#18 Annex C](http://unicode.org/reports/tr18/#Compatibility_Properties) +[compatibility properties documented in UTS#18 Annex C](https://unicode.org/reports/tr18/#Compatibility_Properties) (sans the `\X` class, for matching grapheme clusters, which isn't provided at all). This is because it seems to be consistent with most other regular expression engines, and in particular, because these are often referred to as @@ -165,7 +165,7 @@ Their traditional ASCII definition can be used by disabling Unicode. That is, ## RL1.3 Subtraction and Intersection -[UTS#18 RL1.3](http://unicode.org/reports/tr18/#Subtraction_and_Intersection) +[UTS#18 RL1.3](https://unicode.org/reports/tr18/#Subtraction_and_Intersection) The regex crate provides full support for nested character classes, along with union, intersection (`&&`), difference (`--`) and symmetric difference (`~~`) @@ -178,7 +178,7 @@ For example, to match all non-ASCII letters, you could use either ## RL1.4 Simple Word Boundaries -[UTS#18 RL1.4](http://unicode.org/reports/tr18/#Simple_Word_Boundaries) +[UTS#18 RL1.4](https://unicode.org/reports/tr18/#Simple_Word_Boundaries) The regex crate provides basic Unicode aware word boundary assertions. A word boundary assertion can be written as `\b`, or `\B` as its negation. A word @@ -196,9 +196,9 @@ the following classes: * `\p{gc:Connector_Punctuation}` In particular, this differs slightly from the -[prescription given in RL1.4](http://unicode.org/reports/tr18/#Simple_Word_Boundaries) +[prescription given in RL1.4](https://unicode.org/reports/tr18/#Simple_Word_Boundaries) but is permissible according to -[UTS#18 Annex C](http://unicode.org/reports/tr18/#Compatibility_Properties). +[UTS#18 Annex C](https://unicode.org/reports/tr18/#Compatibility_Properties). Namely, it is convenient and simpler to have `\w` and `\b` be in sync with one another. @@ -211,7 +211,7 @@ boundaries is currently sub-optimal on non-ASCII text. ## RL1.5 Simple Loose Matches -[UTS#18 RL1.5](http://unicode.org/reports/tr18/#Simple_Loose_Matches) +[UTS#18 RL1.5](https://unicode.org/reports/tr18/#Simple_Loose_Matches) The regex crate provides full support for case insensitive matching in accordance with RL1.5. That is, it uses the "simple" case folding mapping. The @@ -226,7 +226,7 @@ then all characters classes are case folded as well. ## RL1.6 Line Boundaries -[UTS#18 RL1.6](http://unicode.org/reports/tr18/#Line_Boundaries) +[UTS#18 RL1.6](https://unicode.org/reports/tr18/#Line_Boundaries) The regex crate only provides support for recognizing the `\n` (`END OF LINE`) character as a line boundary. This choice was made mostly for implementation @@ -239,7 +239,7 @@ well, and in theory, this could be done efficiently. ## RL1.7 Code Points -[UTS#18 RL1.7](http://unicode.org/reports/tr18/#Supplementary_Characters) +[UTS#18 RL1.7](https://unicode.org/reports/tr18/#Supplementary_Characters) The regex crate provides full support for Unicode code point matching. Namely, the fundamental atom of any match is always a single code point. diff --git a/third_party/cargo/vendor/regex-1.4.2/examples/regexdna-input.txt b/third_party/cargo/vendor/regex-1.4.5/examples/regexdna-input.txt similarity index 100% rename from third_party/cargo/vendor/regex-1.4.2/examples/regexdna-input.txt rename to third_party/cargo/vendor/regex-1.4.5/examples/regexdna-input.txt diff --git a/third_party/cargo/vendor/regex-1.4.2/examples/regexdna-output.txt b/third_party/cargo/vendor/regex-1.4.5/examples/regexdna-output.txt similarity index 100% rename from third_party/cargo/vendor/regex-1.4.2/examples/regexdna-output.txt rename to third_party/cargo/vendor/regex-1.4.5/examples/regexdna-output.txt diff --git a/third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna-bytes.rs b/third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna-bytes.rs similarity index 96% rename from third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna-bytes.rs rename to third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna-bytes.rs index a763385..ac4c115 100644 --- a/third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna-bytes.rs +++ b/third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna-bytes.rs @@ -1,5 +1,5 @@ // The Computer Language Benchmarks Game -// http://benchmarksgame.alioth.debian.org/ +// https://benchmarksgame-team.pages.debian.net/benchmarksgame/ // // contributed by the Rust Project Developers // contributed by TeXitoi diff --git a/third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna-cheat.rs b/third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna-cheat.rs similarity index 97% rename from third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna-cheat.rs rename to third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna-cheat.rs index 27c5308..c7395b7 100644 --- a/third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna-cheat.rs +++ b/third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna-cheat.rs @@ -1,5 +1,5 @@ // The Computer Language Benchmarks Game -// http://benchmarksgame.alioth.debian.org/ +// https://benchmarksgame-team.pages.debian.net/benchmarksgame/ // // contributed by the Rust Project Developers // contributed by TeXitoi diff --git a/third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna-replace.rs b/third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna-replace.rs similarity index 100% rename from third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna-replace.rs rename to third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna-replace.rs diff --git a/third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna-single-cheat.rs b/third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna-single-cheat.rs similarity index 97% rename from third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna-single-cheat.rs rename to third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna-single-cheat.rs index ec444b4..04ed05a 100644 --- a/third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna-single-cheat.rs +++ b/third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna-single-cheat.rs @@ -1,5 +1,5 @@ // The Computer Language Benchmarks Game -// http://benchmarksgame.alioth.debian.org/ +// https://benchmarksgame-team.pages.debian.net/benchmarksgame/ // // contributed by the Rust Project Developers // contributed by TeXitoi diff --git a/third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna-single.rs b/third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna-single.rs similarity index 96% rename from third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna-single.rs rename to third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna-single.rs index ab34107..a70c711 100644 --- a/third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna-single.rs +++ b/third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna-single.rs @@ -1,5 +1,5 @@ // The Computer Language Benchmarks Game -// http://benchmarksgame.alioth.debian.org/ +// https://benchmarksgame-team.pages.debian.net/benchmarksgame/ // // contributed by the Rust Project Developers // contributed by TeXitoi diff --git a/third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna.rs b/third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna.rs similarity index 96% rename from third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna.rs rename to third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna.rs index ece7ca5..4527422 100644 --- a/third_party/cargo/vendor/regex-1.4.2/examples/shootout-regex-dna.rs +++ b/third_party/cargo/vendor/regex-1.4.5/examples/shootout-regex-dna.rs @@ -1,5 +1,5 @@ // The Computer Language Benchmarks Game -// http://benchmarksgame.alioth.debian.org/ +// https://benchmarksgame-team.pages.debian.net/benchmarksgame/ // // contributed by the Rust Project Developers // contributed by TeXitoi diff --git a/third_party/cargo/vendor/walkdir-2.3.1/rustfmt.toml b/third_party/cargo/vendor/regex-1.4.5/rustfmt.toml similarity index 100% rename from third_party/cargo/vendor/walkdir-2.3.1/rustfmt.toml rename to third_party/cargo/vendor/regex-1.4.5/rustfmt.toml diff --git a/third_party/cargo/vendor/regex-1.4.2/src/backtrack.rs b/third_party/cargo/vendor/regex-1.4.5/src/backtrack.rs similarity index 98% rename from third_party/cargo/vendor/regex-1.4.2/src/backtrack.rs rename to third_party/cargo/vendor/regex-1.4.5/src/backtrack.rs index 2eaeb72..6100c17 100644 --- a/third_party/cargo/vendor/regex-1.4.2/src/backtrack.rs +++ b/third_party/cargo/vendor/regex-1.4.5/src/backtrack.rs @@ -115,8 +115,8 @@ impl<'a, 'm, 'r, 's, I: Input> Bounded<'a, 'm, 'r, 's, I> { // Then we reset all existing allocated space to 0. // Finally, we request more space if we need it. // - // This is all a little circuitous, but doing this unsafely - // doesn't seem to have a measurable impact on performance. + // This is all a little circuitous, but doing this using unchecked + // operations doesn't seem to have a measurable impact on performance. // (Probably because backtracking is limited to such small // inputs/regexes in the first place.) let visited_len = diff --git a/third_party/cargo/vendor/regex-1.4.2/src/compile.rs b/third_party/cargo/vendor/regex-1.4.5/src/compile.rs similarity index 99% rename from third_party/cargo/vendor/regex-1.4.2/src/compile.rs rename to third_party/cargo/vendor/regex-1.4.5/src/compile.rs index cdc583c..9ffd347 100644 --- a/third_party/cargo/vendor/regex-1.4.2/src/compile.rs +++ b/third_party/cargo/vendor/regex-1.4.5/src/compile.rs @@ -1,4 +1,5 @@ use std::collections::HashMap; +use std::fmt; use std::iter; use std::result; use std::sync::Arc; @@ -25,6 +26,9 @@ struct Patch { /// A compiler translates a regular expression AST to a sequence of /// instructions. The sequence of instructions represents an NFA. +// `Compiler` is only public via the `internal` module, so avoid deriving +// `Debug`. +#[allow(missing_debug_implementations)] pub struct Compiler { insts: Vec, compiled: Program, @@ -1051,6 +1055,7 @@ impl<'a, 'b> CompileClass<'a, 'b> { /// This uses similar idea to [`SparseSet`](../sparse/struct.SparseSet.html), /// except it uses hashes as original indices and then compares full keys for /// validation against `dense` array. +#[derive(Debug)] struct SuffixCache { sparse: Box<[usize]>, dense: Vec, @@ -1159,6 +1164,12 @@ impl ByteClassSet { } } +impl fmt::Debug for ByteClassSet { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_tuple("ByteClassSet").field(&&self.0[..]).finish() + } +} + fn u32_to_usize(n: u32) -> usize { // In case usize is less than 32 bits, we need to guard against overflow. // On most platforms this compiles to nothing. diff --git a/third_party/cargo/vendor/regex-1.4.2/src/dfa.rs b/third_party/cargo/vendor/regex-1.4.5/src/dfa.rs similarity index 99% rename from third_party/cargo/vendor/regex-1.4.2/src/dfa.rs rename to third_party/cargo/vendor/regex-1.4.5/src/dfa.rs index 2a365ee..9ac0c2c 100644 --- a/third_party/cargo/vendor/regex-1.4.2/src/dfa.rs +++ b/third_party/cargo/vendor/regex-1.4.5/src/dfa.rs @@ -848,7 +848,7 @@ impl<'a> Fsm<'a> { /// next_si transitions to the next state, where the transition input /// corresponds to text[i]. /// - /// This elides bounds checks, and is therefore unsafe. + /// This elides bounds checks, and is therefore not safe. #[cfg_attr(feature = "perf-inline", inline(always))] unsafe fn next_si(&self, si: StatePtr, text: &[u8], i: usize) -> StatePtr { // What is the argument for safety here? @@ -1688,7 +1688,7 @@ impl Transitions { self.num_byte_classes * mem::size_of::() } - /// Like `next`, but uses unchecked access and is therefore unsafe. + /// Like `next`, but uses unchecked access and is therefore not safe. unsafe fn next_unchecked(&self, si: StatePtr, cls: usize) -> StatePtr { debug_assert!((si as usize) < self.table.len()); debug_assert!(cls < self.num_byte_classes); @@ -1895,12 +1895,22 @@ mod tests { push_inst_ptr, read_vari32, read_varu32, write_vari32, write_varu32, State, StateFlags, }; - use quickcheck::{quickcheck, QuickCheck, StdGen}; + use quickcheck::{quickcheck, Gen, QuickCheck}; use std::sync::Arc; #[test] fn prop_state_encode_decode() { - fn p(ips: Vec, flags: u8) -> bool { + fn p(mut ips: Vec, flags: u8) -> bool { + // It looks like our encoding scheme can't handle instruction + // pointers at or above 2**31. We should fix that, but it seems + // unlikely to occur in real code due to the amount of memory + // required for such a state machine. So for now, we just clamp + // our test data. + for ip in &mut ips { + if *ip >= 1 << 31 { + *ip = (1 << 31) - 1; + } + } let mut data = vec![flags]; let mut prev = 0; for &ip in ips.iter() { @@ -1914,7 +1924,7 @@ mod tests { expected == got && state.flags() == StateFlags(flags) } QuickCheck::new() - .gen(StdGen::new(self::rand::thread_rng(), 10_000)) + .gen(Gen::new(10_000)) .quickcheck(p as fn(Vec, u8) -> bool); } diff --git a/third_party/cargo/vendor/regex-1.4.2/src/error.rs b/third_party/cargo/vendor/regex-1.4.5/src/error.rs similarity index 100% rename from third_party/cargo/vendor/regex-1.4.2/src/error.rs rename to third_party/cargo/vendor/regex-1.4.5/src/error.rs diff --git a/third_party/cargo/vendor/regex-1.4.2/src/exec.rs b/third_party/cargo/vendor/regex-1.4.5/src/exec.rs similarity index 97% rename from third_party/cargo/vendor/regex-1.4.2/src/exec.rs rename to third_party/cargo/vendor/regex-1.4.5/src/exec.rs index acca2dc..3d5a52b 100644 --- a/third_party/cargo/vendor/regex-1.4.2/src/exec.rs +++ b/third_party/cargo/vendor/regex-1.4.5/src/exec.rs @@ -1,5 +1,6 @@ use std::cell::RefCell; use std::collections::HashMap; +use std::panic::AssertUnwindSafe; use std::sync::Arc; #[cfg(feature = "perf-literal")] @@ -9,7 +10,6 @@ use syntax::hir::Hir; use syntax::ParserBuilder; use backtrack; -use cache::{Cached, CachedGuard}; use compile::Compiler; #[cfg(feature = "perf-dfa")] use dfa; @@ -17,6 +17,7 @@ use error::Error; use input::{ByteInput, CharInput}; use literal::LiteralSearcher; use pikevm; +use pool::{Pool, PoolGuard}; use prog::Program; use re_builder::RegexOptions; use re_bytes; @@ -30,11 +31,19 @@ use utf8::next_utf8; /// In particular, this manages the various compiled forms of a single regular /// expression and the choice of which matching engine to use to execute a /// regular expression. +#[derive(Debug)] pub struct Exec { /// All read only state. ro: Arc, - /// Caches for the various matching engines. - cache: Cached, + /// A pool of reusable values for the various matching engines. + /// + /// Note that boxing this value is not strictly necessary, but it is an + /// easy way to ensure that T does not bloat the stack sized used by a pool + /// in the case where T is big. And this turns out to be the case at the + /// time of writing for regex's use of this pool. At the time of writing, + /// the size of a Regex on the stack is 856 bytes. Boxing this value + /// reduces that size to 16 bytes. + pool: Box>, } /// `ExecNoSync` is like `Exec`, except it embeds a reference to a cache. This @@ -45,10 +54,11 @@ pub struct ExecNoSync<'c> { /// All read only state. ro: &'c Arc, /// Caches for the various matching engines. - cache: CachedGuard<'c, ProgramCache>, + cache: PoolGuard<'c, ProgramCache>, } /// `ExecNoSyncStr` is like `ExecNoSync`, but matches on &str instead of &[u8]. +#[derive(Debug)] pub struct ExecNoSyncStr<'c>(ExecNoSync<'c>); /// `ExecReadOnly` comprises all read only state for a regex. Namely, all such @@ -97,6 +107,9 @@ struct ExecReadOnly { /// Facilitates the construction of an executor by exposing various knobs /// to control how a regex is executed and what kinds of resources it's /// permitted to use. +// `ExecBuilder` is only public via the `internal` module, so avoid deriving +// `Debug`. +#[allow(missing_debug_implementations)] pub struct ExecBuilder { options: RegexOptions, match_type: Option, @@ -297,7 +310,8 @@ impl ExecBuilder { ac: None, match_type: MatchType::Nothing, }); - return Ok(Exec { ro: ro, cache: Cached::new() }); + let pool = ExecReadOnly::new_pool(&ro); + return Ok(Exec { ro: ro, pool }); } let parsed = self.parse()?; let mut nfa = Compiler::new() @@ -337,7 +351,8 @@ impl ExecBuilder { ro.match_type = ro.choose_match_type(self.match_type); let ro = Arc::new(ro); - Ok(Exec { ro: ro, cache: Cached::new() }) + let pool = ExecReadOnly::new_pool(&ro); + Ok(Exec { ro, pool }) } #[cfg(feature = "perf-literal")] @@ -1249,10 +1264,9 @@ impl Exec { /// Get a searcher that isn't Sync. #[cfg_attr(feature = "perf-inline", inline(always))] pub fn searcher(&self) -> ExecNoSync { - let create = || RefCell::new(ProgramCacheInner::new(&self.ro)); ExecNoSync { ro: &self.ro, // a clone is too expensive here! (and not needed) - cache: self.cache.get_or(create), + cache: self.pool.get(), } } @@ -1304,7 +1318,8 @@ impl Exec { impl Clone for Exec { fn clone(&self) -> Exec { - Exec { ro: self.ro.clone(), cache: Cached::new() } + let pool = ExecReadOnly::new_pool(&self.ro); + Exec { ro: self.ro.clone(), pool } } } @@ -1437,6 +1452,13 @@ impl ExecReadOnly { let lcs_len = self.suffixes.lcs().char_len(); lcs_len >= 3 && lcs_len > self.dfa.prefixes.lcp().char_len() } + + fn new_pool(ro: &Arc) -> Box> { + let ro = ro.clone(); + Box::new(Pool::new(Box::new(move || { + AssertUnwindSafe(RefCell::new(ProgramCacheInner::new(&ro))) + }))) + } } #[derive(Clone, Copy, Debug)] @@ -1495,7 +1517,11 @@ enum MatchNfaType { /// `ProgramCache` maintains reusable allocations for each matching engine /// available to a particular program. -pub type ProgramCache = RefCell; +/// +/// We declare this as unwind safe since it's a cache that's only used for +/// performance purposes. If a panic occurs, it is (or should be) always safe +/// to continue using the same regex object. +pub type ProgramCache = AssertUnwindSafe>; #[derive(Debug)] pub struct ProgramCacheInner { diff --git a/third_party/cargo/vendor/regex-1.4.2/src/expand.rs b/third_party/cargo/vendor/regex-1.4.5/src/expand.rs similarity index 98% rename from third_party/cargo/vendor/regex-1.4.2/src/expand.rs rename to third_party/cargo/vendor/regex-1.4.5/src/expand.rs index fd2ab03..70dbf91 100644 --- a/third_party/cargo/vendor/regex-1.4.2/src/expand.rs +++ b/third_party/cargo/vendor/regex-1.4.5/src/expand.rs @@ -144,7 +144,8 @@ fn find_cap_ref(replacement: &[u8]) -> Option { } // We just verified that the range 0..cap_end is valid ASCII, so it must // therefore be valid UTF-8. If we really cared, we could avoid this UTF-8 - // check with either unsafe or by parsing the number straight from &[u8]. + // check via an unchecked conversion or by parsing the number straight from + // &[u8]. let cap = str::from_utf8(&rep[i..cap_end]).expect("valid UTF-8 capture name"); Some(CaptureRef { diff --git a/third_party/cargo/vendor/regex-1.4.2/src/find_byte.rs b/third_party/cargo/vendor/regex-1.4.5/src/find_byte.rs similarity index 100% rename from third_party/cargo/vendor/regex-1.4.2/src/find_byte.rs rename to third_party/cargo/vendor/regex-1.4.5/src/find_byte.rs diff --git a/third_party/cargo/vendor/regex-1.4.2/src/freqs.rs b/third_party/cargo/vendor/regex-1.4.5/src/freqs.rs similarity index 100% rename from third_party/cargo/vendor/regex-1.4.2/src/freqs.rs rename to third_party/cargo/vendor/regex-1.4.5/src/freqs.rs diff --git a/third_party/cargo/vendor/regex-1.4.2/src/input.rs b/third_party/cargo/vendor/regex-1.4.5/src/input.rs similarity index 100% rename from third_party/cargo/vendor/regex-1.4.2/src/input.rs rename to third_party/cargo/vendor/regex-1.4.5/src/input.rs diff --git a/third_party/cargo/vendor/regex-1.4.2/src/lib.rs b/third_party/cargo/vendor/regex-1.4.5/src/lib.rs similarity index 98% rename from third_party/cargo/vendor/regex-1.4.2/src/lib.rs rename to third_party/cargo/vendor/regex-1.4.5/src/lib.rs index bdcebd4..357ac0d 100644 --- a/third_party/cargo/vendor/regex-1.4.2/src/lib.rs +++ b/third_party/cargo/vendor/regex-1.4.5/src/lib.rs @@ -253,7 +253,7 @@ assert_eq!((mat.start(), mat.end()), (3, 23)); ``` For a more detailed breakdown of Unicode support with respect to -[UTS#18](http://unicode.org/reports/tr18/), +[UTS#18](https://unicode.org/reports/tr18/), please see the [UNICODE](https://github.com/rust-lang/regex/blob/master/UNICODE.md) document in the root of the regex repository. @@ -455,7 +455,7 @@ assert_eq!(&cap[0], "abc"); ## Perl character classes (Unicode friendly) These classes are based on the definitions provided in -[UTS#18](http://www.unicode.org/reports/tr18/#Compatibility_Properties): +[UTS#18](https://www.unicode.org/reports/tr18/#Compatibility_Properties):
 \d     digit (\p{Nd})
@@ -523,11 +523,6 @@ All features below are enabled by default.
   Enables all performance related features. This feature is enabled by default
   and will always cover all features that improve performance, even if more
   are added in the future.
-* **perf-cache** -
-  Enables the use of very fast thread safe caching for internal match state.
-  When this is disabled, caching is still used, but with a slower and simpler
-  implementation. Disabling this drops the `thread_local` and `lazy_static`
-  dependencies.
 * **perf-dfa** -
   Enables the use of a lazy DFA for matching. The lazy DFA is used to compile
   portions of a regex to a very fast DFA on an as-needed basis. This can
@@ -542,6 +537,11 @@ All features below are enabled by default.
   Enables the use of literal optimizations for speeding up matches. In some
   cases, literal optimizations can result in speedups of _several_ orders of
   magnitude. Disabling this drops the `aho-corasick` and `memchr` dependencies.
+* **perf-cache** -
+  This feature used to enable a faster internal cache at the cost of using
+  additional dependencies, but this is no longer an option. A fast internal
+  cache is now used unconditionally with no additional dependencies. This may
+  change in the future.
 
 ### Unicode features
 
@@ -616,6 +616,7 @@ another matching engine with fixed memory requirements.
 #![deny(missing_docs)]
 #![cfg_attr(test, deny(warnings))]
 #![cfg_attr(feature = "pattern", feature(pattern))]
+#![warn(missing_debug_implementations)]
 
 #[cfg(not(feature = "std"))]
 compile_error!("`std` feature is currently required to build this crate");
@@ -630,8 +631,6 @@ extern crate memchr;
 #[cfg_attr(feature = "perf-literal", macro_use)]
 extern crate quickcheck;
 extern crate regex_syntax as syntax;
-#[cfg(feature = "perf-cache")]
-extern crate thread_local;
 
 // #[cfg(doctest)]
 // doc_comment::doctest!("../README.md");
@@ -748,7 +747,6 @@ pub mod bytes {
 }
 
 mod backtrack;
-mod cache;
 mod compile;
 #[cfg(feature = "perf-dfa")]
 mod dfa;
@@ -763,6 +761,7 @@ mod literal;
 #[cfg(feature = "pattern")]
 mod pattern;
 mod pikevm;
+mod pool;
 mod prog;
 mod re_builder;
 mod re_bytes;
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/literal/imp.rs b/third_party/cargo/vendor/regex-1.4.5/src/literal/imp.rs
similarity index 99%
rename from third_party/cargo/vendor/regex-1.4.2/src/literal/imp.rs
rename to third_party/cargo/vendor/regex-1.4.5/src/literal/imp.rs
index fe07ffc..e4d04ed 100644
--- a/third_party/cargo/vendor/regex-1.4.2/src/literal/imp.rs
+++ b/third_party/cargo/vendor/regex-1.4.5/src/literal/imp.rs
@@ -72,7 +72,7 @@ impl LiteralSearcher {
     /// Returns true if all matches comprise the entire regular expression.
     ///
     /// This does not necessarily mean that a literal match implies a match
-    /// of the regular expression. For example, the regular expresison `^a`
+    /// of the regular expression. For example, the regular expression `^a`
     /// is comprised of a single complete literal `a`, but the regular
     /// expression demands that it only match at the beginning of a string.
     pub fn complete(&self) -> bool {
@@ -232,6 +232,7 @@ impl Matcher {
     }
 }
 
+#[derive(Debug)]
 pub enum LiteralIter<'a> {
     Empty,
     Bytes(&'a [u8]),
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/literal/mod.rs b/third_party/cargo/vendor/regex-1.4.5/src/literal/mod.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/src/literal/mod.rs
rename to third_party/cargo/vendor/regex-1.4.5/src/literal/mod.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/pattern.rs b/third_party/cargo/vendor/regex-1.4.5/src/pattern.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/src/pattern.rs
rename to third_party/cargo/vendor/regex-1.4.5/src/pattern.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/pikevm.rs b/third_party/cargo/vendor/regex-1.4.5/src/pikevm.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/src/pikevm.rs
rename to third_party/cargo/vendor/regex-1.4.5/src/pikevm.rs
diff --git a/third_party/cargo/vendor/regex-1.4.5/src/pool.rs b/third_party/cargo/vendor/regex-1.4.5/src/pool.rs
new file mode 100644
index 0000000..a506ee9
--- /dev/null
+++ b/third_party/cargo/vendor/regex-1.4.5/src/pool.rs
@@ -0,0 +1,333 @@
+// This module provides a relatively simple thread-safe pool of reusable
+// objects. For the most part, it's implemented by a stack represented by a
+// Mutex>. It has one small trick: because unlocking a mutex is somewhat
+// costly, in the case where a pool is accessed by the first thread that tried
+// to get a value, we bypass the mutex. Here are some benchmarks showing the
+// difference.
+//
+// 1) misc::anchored_literal_long_non_match    21 (18571 MB/s)
+// 2) misc::anchored_literal_long_non_match   107 (3644 MB/s)
+// 3) misc::anchored_literal_long_non_match    45 (8666 MB/s)
+// 4) misc::anchored_literal_long_non_match    19 (20526 MB/s)
+//
+// (1) represents our baseline: the master branch at the time of writing when
+// using the 'thread_local' crate to implement the pool below.
+//
+// (2) represents a naive pool implemented completely via Mutex>. There
+// is no special trick for bypassing the mutex.
+//
+// (3) is the same as (2), except it uses Mutex>>. It is twice as
+// fast because a Box is much smaller than the T we use with a Pool in this
+// crate. So pushing and popping a Box from a Vec is quite a bit faster
+// than for T.
+//
+// (4) is the same as (3), but with the trick for bypassing the mutex in the
+// case of the first-to-get thread.
+//
+// Why move off of thread_local? Even though (4) is a hair faster than (1)
+// above, this was not the main goal. The main goal was to move off of
+// thread_local and find a way to *simply* re-capture some of its speed for
+// regex's specific case. So again, why move off of it? The *primary* reason is
+// because of memory leaks. See https://github.com/rust-lang/regex/issues/362
+// for example. (Why do I want it to be simple? Well, I suppose what I mean is,
+// "use as much safe code as possible to minimize risk and be as sure as I can
+// be that it is correct.")
+//
+// My guess is that the thread_local design is probably not appropriate for
+// regex since its memory usage scales to the number of active threads that
+// have used a regex, where as the pool below scales to the number of threads
+// that simultaneously use a regex. While neither case permits contraction,
+// since we own the pool data structure below, we can add contraction if a
+// clear use case pops up in the wild. More pressingly though, it seems that
+// there are at least some use case patterns where one might have many threads
+// sitting around that might have used a regex at one point. While thread_local
+// does try to reuse space previously used by a thread that has since stopped,
+// its maximal memory usage still scales with the total number of active
+// threads. In contrast, the pool below scales with the total number of threads
+// *simultaneously* using the pool. The hope is that this uses less memory
+// overall. And if it doesn't, we can hopefully tune it somehow.
+//
+// It seems that these sort of conditions happen frequently
+// in FFI inside of other more "managed" languages. This was
+// mentioned in the issue linked above, and also mentioned here:
+// https://github.com/BurntSushi/rure-go/issues/3. And in particular, users
+// confirm that disabling the use of thread_local resolves the leak.
+//
+// There were other weaker reasons for moving off of thread_local as well.
+// Namely, at the time, I was looking to reduce dependencies. And for something
+// like regex, maintenance can be simpler when we own the full dependency tree.
+
+use std::panic::{RefUnwindSafe, UnwindSafe};
+use std::sync::atomic::{AtomicUsize, Ordering};
+use std::sync::Mutex;
+
+/// An atomic counter used to allocate thread IDs.
+static COUNTER: AtomicUsize = AtomicUsize::new(1);
+
+thread_local!(
+    /// A thread local used to assign an ID to a thread.
+    static THREAD_ID: usize = {
+        let next = COUNTER.fetch_add(1, Ordering::Relaxed);
+        // SAFETY: We cannot permit the reuse of thread IDs since reusing a
+        // thread ID might result in more than one thread "owning" a pool,
+        // and thus, permit accessing a mutable value from multiple threads
+        // simultaneously without synchronization. The intent of this panic is
+        // to be a sanity check. It is not expected that the thread ID space
+        // will actually be exhausted in practice.
+        //
+        // This checks that the counter never wraps around, since atomic
+        // addition wraps around on overflow.
+        if next == 0 {
+            panic!("regex: thread ID allocation space exhausted");
+        }
+        next
+    };
+);
+
+/// The type of the function used to create values in a pool when the pool is
+/// empty and the caller requests one.
+type CreateFn =
+    Box T + Send + Sync + UnwindSafe + RefUnwindSafe + 'static>;
+
+/// A simple thread safe pool for reusing values.
+///
+/// Getting a value out comes with a guard. When that guard is dropped, the
+/// value is automatically put back in the pool.
+///
+/// A Pool impls Sync when T is Send (even if it's not Sync). This means
+/// that T can use interior mutability. This is possible because a pool is
+/// guaranteed to provide a value to exactly one thread at any time.
+///
+/// Currently, a pool never contracts in size. Its size is proportional to the
+/// number of simultaneous uses.
+pub struct Pool {
+    /// A stack of T values to hand out. These are used when a Pool is
+    /// accessed by a thread that didn't create it.
+    stack: Mutex>>,
+    /// A function to create more T values when stack is empty and a caller
+    /// has requested a T.
+    create: CreateFn,
+    /// The ID of the thread that owns this pool. The owner is the thread
+    /// that makes the first call to 'get'. When the owner calls 'get', it
+    /// gets 'owner_val' directly instead of returning a T from 'stack'.
+    /// See comments elsewhere for details, but this is intended to be an
+    /// optimization for the common case that makes getting a T faster.
+    ///
+    /// It is initialized to a value of zero (an impossible thread ID) as a
+    /// sentinel to indicate that it is unowned.
+    owner: AtomicUsize,
+    /// A value to return when the caller is in the same thread that created
+    /// the Pool.
+    owner_val: T,
+}
+
+// SAFETY: Since we want to use a Pool from multiple threads simultaneously
+// behind an Arc, we need for it to be Sync. In cases where T is sync, Pool
+// would be Sync. However, since we use a Pool to store mutable scratch space,
+// we wind up using a T that has interior mutability and is thus itself not
+// Sync. So what we *really* want is for our Pool to by Sync even when T is
+// not Sync (but is at least Send).
+//
+// The only non-sync aspect of a Pool is its 'owner_val' field, which is used
+// to implement faster access to a pool value in the common case of a pool
+// being accessed in the same thread in which it was created. The 'stack' field
+// is also shared, but a Mutex where T: Send is already Sync. So we only
+// need to worry about 'owner_val'.
+//
+// The key is to guarantee that 'owner_val' can only ever be accessed from one
+// thread. In our implementation below, we guarantee this by only returning the
+// 'owner_val' when the ID of the current thread matches the ID of the thread
+// that created the Pool. Since this can only ever be one thread, it follows
+// that only one thread can access 'owner_val' at any point in time. Thus, it
+// is safe to declare that Pool is Sync when T is Send.
+//
+// NOTE: It would also be possible to make the owning thread be the *first*
+// thread that tries to get a value out of a Pool. However, the current
+// implementation is a little simpler and it's not clear if making the first
+// thread (rather than the creating thread) is meaningfully better.
+//
+// If there is a way to achieve our performance goals using safe code, then
+// I would very much welcome a patch. As it stands, the implementation below
+// tries to balance safety with performance. The case where a Regex is used
+// from multiple threads simultaneously will suffer a bit since getting a cache
+// will require unlocking a mutex.
+unsafe impl Sync for Pool {}
+
+impl ::std::fmt::Debug for Pool {
+    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
+        f.debug_struct("Pool")
+            .field("stack", &self.stack)
+            .field("owner", &self.owner)
+            .field("owner_val", &self.owner_val)
+            .finish()
+    }
+}
+
+/// A guard that is returned when a caller requests a value from the pool.
+///
+/// The purpose of the guard is to use RAII to automatically put the value back
+/// in the pool once it's dropped.
+#[derive(Debug)]
+pub struct PoolGuard<'a, T: 'a + Send> {
+    /// The pool that this guard is attached to.
+    pool: &'a Pool,
+    /// This is None when the guard represents the special "owned" value. In
+    /// which case, the value is retrieved from 'pool.owner_val'.
+    value: Option>,
+}
+
+impl Pool {
+    /// Create a new pool. The given closure is used to create values in the
+    /// pool when necessary.
+    pub fn new(create: CreateFn) -> Pool {
+        let owner = AtomicUsize::new(0);
+        let owner_val = create();
+        Pool { stack: Mutex::new(vec![]), create, owner, owner_val }
+    }
+
+    /// Get a value from the pool. The caller is guaranteed to have exclusive
+    /// access to the given value.
+    ///
+    /// Note that there is no guarantee provided about which value in the
+    /// pool is returned. That is, calling get, dropping the guard (causing
+    /// the value to go back into the pool) and then calling get again is NOT
+    /// guaranteed to return the same value received in the first get call.
+    #[cfg_attr(feature = "perf-inline", inline(always))]
+    pub fn get(&self) -> PoolGuard {
+        // Our fast path checks if the caller is the thread that "owns" this
+        // pool. Or stated differently, whether it is the first thread that
+        // tried to extract a value from the pool. If it is, then we can return
+        // a T to the caller without going through a mutex.
+        //
+        // SAFETY: We must guarantee that only one thread gets access to this
+        // value. Since a thread is uniquely identified by the THREAD_ID thread
+        // local, it follows that is the caller's thread ID is equal to the
+        // owner, then only one thread may receive this value.
+        let caller = THREAD_ID.with(|id| *id);
+        let owner = self.owner.load(Ordering::Relaxed);
+        if caller == owner {
+            return self.guard_owned();
+        }
+        self.get_slow(caller, owner)
+    }
+
+    /// This is the "slow" version that goes through a mutex to pop an
+    /// allocated value off a stack to return to the caller. (Or, if the stack
+    /// is empty, a new value is created.)
+    ///
+    /// If the pool has no owner, then this will set the owner.
+    #[cold]
+    fn get_slow(&self, caller: usize, owner: usize) -> PoolGuard {
+        use std::sync::atomic::Ordering::Relaxed;
+
+        if owner == 0 {
+            // The sentinel 0 value means this pool is not yet owned. We
+            // try to atomically set the owner. If we do, then this thread
+            // becomes the owner and we can return a guard that represents
+            // the special T for the owner.
+            let res = self.owner.compare_exchange(0, caller, Relaxed, Relaxed);
+            if res.is_ok() {
+                return self.guard_owned();
+            }
+        }
+        let mut stack = self.stack.lock().unwrap();
+        let value = match stack.pop() {
+            None => Box::new((self.create)()),
+            Some(value) => value,
+        };
+        self.guard_stack(value)
+    }
+
+    /// Puts a value back into the pool. Callers don't need to call this. Once
+    /// the guard that's returned by 'get' is dropped, it is put back into the
+    /// pool automatically.
+    fn put(&self, value: Box) {
+        let mut stack = self.stack.lock().unwrap();
+        stack.push(value);
+    }
+
+    /// Create a guard that represents the special owned T.
+    fn guard_owned(&self) -> PoolGuard<'_, T> {
+        PoolGuard { pool: self, value: None }
+    }
+
+    /// Create a guard that contains a value from the pool's stack.
+    fn guard_stack(&self, value: Box) -> PoolGuard<'_, T> {
+        PoolGuard { pool: self, value: Some(value) }
+    }
+}
+
+impl<'a, T: Send> PoolGuard<'a, T> {
+    /// Return the underlying value.
+    pub fn value(&self) -> &T {
+        match self.value {
+            None => &self.pool.owner_val,
+            Some(ref v) => &**v,
+        }
+    }
+}
+
+impl<'a, T: Send> Drop for PoolGuard<'a, T> {
+    #[cfg_attr(feature = "perf-inline", inline(always))]
+    fn drop(&mut self) {
+        if let Some(value) = self.value.take() {
+            self.pool.put(value);
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use std::panic::{RefUnwindSafe, UnwindSafe};
+
+    use super::*;
+
+    #[test]
+    fn oibits() {
+        use exec::ProgramCache;
+
+        fn has_oibits() {}
+        has_oibits::>();
+    }
+
+    // Tests that Pool implements the "single owner" optimization. That is, the
+    // thread that first accesses the pool gets its own copy, while all other
+    // threads get distinct copies.
+    #[test]
+    fn thread_owner_optimization() {
+        use std::cell::RefCell;
+        use std::sync::Arc;
+
+        let pool: Arc>>> =
+            Arc::new(Pool::new(Box::new(|| RefCell::new(vec!['a']))));
+        pool.get().value().borrow_mut().push('x');
+
+        let pool1 = pool.clone();
+        let t1 = std::thread::spawn(move || {
+            let guard = pool1.get();
+            let v = guard.value();
+            v.borrow_mut().push('y');
+        });
+
+        let pool2 = pool.clone();
+        let t2 = std::thread::spawn(move || {
+            let guard = pool2.get();
+            let v = guard.value();
+            v.borrow_mut().push('z');
+        });
+
+        t1.join().unwrap();
+        t2.join().unwrap();
+
+        // If we didn't implement the single owner optimization, then one of
+        // the threads above is likely to have mutated the [a, x] vec that
+        // we stuffed in the pool before spawning the threads. But since
+        // neither thread was first to access the pool, and because of the
+        // optimization, we should be guaranteed that neither thread mutates
+        // the special owned pool value.
+        //
+        // (Technically this is an implementation detail and not a contract of
+        // Pool's API.)
+        assert_eq!(vec!['a', 'x'], *pool.get().value().borrow());
+    }
+}
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/prog.rs b/third_party/cargo/vendor/regex-1.4.5/src/prog.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/src/prog.rs
rename to third_party/cargo/vendor/regex-1.4.5/src/prog.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/re_builder.rs b/third_party/cargo/vendor/regex-1.4.5/src/re_builder.rs
similarity index 99%
rename from third_party/cargo/vendor/regex-1.4.2/src/re_builder.rs
rename to third_party/cargo/vendor/regex-1.4.5/src/re_builder.rs
index 3fef99d..fc140f8 100644
--- a/third_party/cargo/vendor/regex-1.4.2/src/re_builder.rs
+++ b/third_party/cargo/vendor/regex-1.4.5/src/re_builder.rs
@@ -47,6 +47,7 @@ macro_rules! define_builder {
             /// A builder can be used to configure how the regex is built, for example, by
             /// setting the default flags (which can be overridden in the expression
             /// itself) or setting various limits.
+            #[derive(Debug)]
             pub struct RegexBuilder(RegexOptions);
 
             impl RegexBuilder {
@@ -244,6 +245,7 @@ macro_rules! define_set_builder {
             /// A builder can be used to configure how the regexes are built, for example,
             /// by setting the default flags (which can be overridden in the expression
             /// itself) or setting various limits.
+            #[derive(Debug)]
             pub struct RegexSetBuilder(RegexOptions);
 
             impl RegexSetBuilder {
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/re_bytes.rs b/third_party/cargo/vendor/regex-1.4.5/src/re_bytes.rs
similarity index 95%
rename from third_party/cargo/vendor/regex-1.4.2/src/re_bytes.rs
rename to third_party/cargo/vendor/regex-1.4.5/src/re_bytes.rs
index ca01e0e..204a70a 100644
--- a/third_party/cargo/vendor/regex-1.4.2/src/re_bytes.rs
+++ b/third_party/cargo/vendor/regex-1.4.5/src/re_bytes.rs
@@ -1,6 +1,7 @@
 use std::borrow::Cow;
 use std::collections::HashMap;
 use std::fmt;
+use std::iter::FusedIterator;
 use std::ops::{Index, Range};
 use std::str::FromStr;
 use std::sync::Arc;
@@ -690,6 +691,7 @@ impl Regex {
 ///
 /// `'r` is the lifetime of the compiled regular expression and `'t` is the
 /// lifetime of the matched byte string.
+#[derive(Debug)]
 pub struct Matches<'r, 't>(re_trait::Matches<'t, ExecNoSync<'r>>);
 
 impl<'r, 't> Iterator for Matches<'r, 't> {
@@ -701,6 +703,8 @@ impl<'r, 't> Iterator for Matches<'r, 't> {
     }
 }
 
+impl<'r, 't> FusedIterator for Matches<'r, 't> {}
+
 /// An iterator that yields all non-overlapping capture groups matching a
 /// particular regular expression.
 ///
@@ -708,6 +712,7 @@ impl<'r, 't> Iterator for Matches<'r, 't> {
 ///
 /// `'r` is the lifetime of the compiled regular expression and `'t` is the
 /// lifetime of the matched byte string.
+#[derive(Debug)]
 pub struct CaptureMatches<'r, 't>(
     re_trait::CaptureMatches<'t, ExecNoSync<'r>>,
 );
@@ -724,10 +729,13 @@ impl<'r, 't> Iterator for CaptureMatches<'r, 't> {
     }
 }
 
+impl<'r, 't> FusedIterator for CaptureMatches<'r, 't> {}
+
 /// Yields all substrings delimited by a regular expression match.
 ///
 /// `'r` is the lifetime of the compiled regular expression and `'t` is the
 /// lifetime of the byte string being split.
+#[derive(Debug)]
 pub struct Split<'r, 't> {
     finder: Matches<'r, 't>,
     last: usize,
@@ -757,12 +765,15 @@ impl<'r, 't> Iterator for Split<'r, 't> {
     }
 }
 
+impl<'r, 't> FusedIterator for Split<'r, 't> {}
+
 /// Yields at most `N` substrings delimited by a regular expression match.
 ///
 /// The last substring will be whatever remains after splitting.
 ///
 /// `'r` is the lifetime of the compiled regular expression and `'t` is the
 /// lifetime of the byte string being split.
+#[derive(Debug)]
 pub struct SplitN<'r, 't> {
     splits: Split<'r, 't>,
     n: usize,
@@ -790,14 +801,21 @@ impl<'r, 't> Iterator for SplitN<'r, 't> {
             Some(&text[self.splits.last..])
         }
     }
+
+    fn size_hint(&self) -> (usize, Option) {
+        (0, Some(self.n))
+    }
 }
 
+impl<'r, 't> FusedIterator for SplitN<'r, 't> {}
+
 /// An iterator over the names of all possible captures.
 ///
 /// `None` indicates an unnamed capture; the first element (capture 0, the
 /// whole matched region) is always unnamed.
 ///
 /// `'r` is the lifetime of the compiled regular expression.
+#[derive(Clone, Debug)]
 pub struct CaptureNames<'r>(::std::slice::Iter<'r, Option>);
 
 impl<'r> Iterator for CaptureNames<'r> {
@@ -813,8 +831,16 @@ impl<'r> Iterator for CaptureNames<'r> {
     fn size_hint(&self) -> (usize, Option) {
         self.0.size_hint()
     }
+
+    fn count(self) -> usize {
+        self.0.count()
+    }
 }
 
+impl<'r> ExactSizeIterator for CaptureNames<'r> {}
+
+impl<'r> FusedIterator for CaptureNames<'r> {}
+
 /// CaptureLocations is a low level representation of the raw offsets of each
 /// submatch.
 ///
@@ -1057,7 +1083,7 @@ impl<'t, 'i> Index<&'i str> for Captures<'t> {
 ///
 /// The lifetime `'c` corresponds to the lifetime of the `Captures` value, and
 /// the lifetime `'t` corresponds to the originally matched text.
-#[derive(Clone)]
+#[derive(Clone, Debug)]
 pub struct SubCaptureMatches<'c, 't: 'c> {
     caps: &'c Captures<'t>,
     it: SubCapturesPosIter<'c>,
@@ -1073,13 +1099,15 @@ impl<'c, 't> Iterator for SubCaptureMatches<'c, 't> {
     }
 }
 
+impl<'c, 't> FusedIterator for SubCaptureMatches<'c, 't> {}
+
 /// Replacer describes types that can be used to replace matches in a byte
 /// string.
 ///
 /// In general, users of this crate shouldn't need to implement this trait,
-/// since implementations are already provided for `&[u8]` and
-/// `FnMut(&Captures) -> Vec` (or any `FnMut(&Captures) -> T`
-/// where `T: AsRef<[u8]>`), which covers most use cases.
+/// since implementations are already provided for `&[u8]` along with other
+/// variants of bytes types and `FnMut(&Captures) -> Vec` (or any
+/// `FnMut(&Captures) -> T` where `T: AsRef<[u8]>`), which covers most use cases.
 pub trait Replacer {
     /// Appends text to `dst` to replace the current match.
     ///
@@ -1148,10 +1176,55 @@ impl<'a> Replacer for &'a [u8] {
     }
 
     fn no_expansion(&mut self) -> Option> {
-        match find_byte(b'$', *self) {
-            Some(_) => None,
-            None => Some(Cow::Borrowed(*self)),
-        }
+        no_expansion(self)
+    }
+}
+
+impl<'a> Replacer for &'a Vec {
+    fn replace_append(&mut self, caps: &Captures, dst: &mut Vec) {
+        caps.expand(*self, dst);
+    }
+
+    fn no_expansion(&mut self) -> Option> {
+        no_expansion(self)
+    }
+}
+
+impl Replacer for Vec {
+    fn replace_append(&mut self, caps: &Captures, dst: &mut Vec) {
+        caps.expand(self, dst);
+    }
+
+    fn no_expansion(&mut self) -> Option> {
+        no_expansion(self)
+    }
+}
+
+impl<'a> Replacer for Cow<'a, [u8]> {
+    fn replace_append(&mut self, caps: &Captures, dst: &mut Vec) {
+        caps.expand(self.as_ref(), dst);
+    }
+
+    fn no_expansion(&mut self) -> Option> {
+        no_expansion(self)
+    }
+}
+
+impl<'a> Replacer for &'a Cow<'a, [u8]> {
+    fn replace_append(&mut self, caps: &Captures, dst: &mut Vec) {
+        caps.expand(self.as_ref(), dst);
+    }
+
+    fn no_expansion(&mut self) -> Option> {
+        no_expansion(self)
+    }
+}
+
+fn no_expansion>(t: &T) -> Option> {
+    let s = t.as_ref();
+    match find_byte(b'$', s) {
+        Some(_) => None,
+        None => Some(Cow::Borrowed(s)),
     }
 }
 
@@ -1173,6 +1246,7 @@ where
 /// and performant (since capture groups don't need to be found).
 ///
 /// `'t` is the lifetime of the literal text.
+#[derive(Clone, Debug)]
 pub struct NoExpand<'t>(pub &'t [u8]);
 
 impl<'t> Replacer for NoExpand<'t> {
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/re_set.rs b/third_party/cargo/vendor/regex-1.4.5/src/re_set.rs
similarity index 98%
rename from third_party/cargo/vendor/regex-1.4.2/src/re_set.rs
rename to third_party/cargo/vendor/regex-1.4.5/src/re_set.rs
index b8954be..5cb47ad 100644
--- a/third_party/cargo/vendor/regex-1.4.2/src/re_set.rs
+++ b/third_party/cargo/vendor/regex-1.4.5/src/re_set.rs
@@ -43,7 +43,7 @@ $(#[$doc_regexset_example])*
 /// Note that it would be possible to adapt the above example to using `Regex`
 /// with an expression like:
 ///
-/// ```ignore
+/// ```text
 /// (?P[a-z]+@(?P[a-z]+[.](com|org|net)))|(?P[a-z]+[.](com|org|net))
 /// ```
 ///
@@ -320,6 +320,7 @@ impl<'a> IntoIterator for &'a SetMatches {
 /// This will always produces matches in ascending order of index, where the
 /// index corresponds to the index of the regex that matched with respect to
 /// its position when initially building the set.
+#[derive(Debug)]
 pub struct SetMatchesIntoIter(iter::Enumerate>);
 
 impl Iterator for SetMatchesIntoIter {
@@ -352,6 +353,8 @@ impl DoubleEndedIterator for SetMatchesIntoIter {
     }
 }
 
+impl iter::FusedIterator for SetMatchesIntoIter {}
+
 /// A borrowed iterator over the set of matches from a regex set.
 ///
 /// The lifetime `'a` refers to the lifetime of a `SetMatches` value.
@@ -359,7 +362,7 @@ impl DoubleEndedIterator for SetMatchesIntoIter {
 /// This will always produces matches in ascending order of index, where the
 /// index corresponds to the index of the regex that matched with respect to
 /// its position when initially building the set.
-#[derive(Clone)]
+#[derive(Clone, Debug)]
 pub struct SetMatchesIter<'a>(iter::Enumerate>);
 
 impl<'a> Iterator for SetMatchesIter<'a> {
@@ -392,6 +395,8 @@ impl<'a> DoubleEndedIterator for SetMatchesIter<'a> {
     }
 }
 
+impl<'a> iter::FusedIterator for SetMatchesIter<'a> {}
+
 #[doc(hidden)]
 impl From for RegexSet {
     fn from(exec: Exec) -> Self {
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/re_trait.rs b/third_party/cargo/vendor/regex-1.4.5/src/re_trait.rs
similarity index 94%
rename from third_party/cargo/vendor/regex-1.4.2/src/re_trait.rs
rename to third_party/cargo/vendor/regex-1.4.5/src/re_trait.rs
index d14a9f7..ea6be9c 100644
--- a/third_party/cargo/vendor/regex-1.4.2/src/re_trait.rs
+++ b/third_party/cargo/vendor/regex-1.4.5/src/re_trait.rs
@@ -1,3 +1,6 @@
+use std::fmt;
+use std::iter::FusedIterator;
+
 /// Slot is a single saved capture location. Note that there are two slots for
 /// every capture in a regular expression (one slot each for the start and end
 /// of the capture).
@@ -51,7 +54,7 @@ impl Locations {
 /// Positions are byte indices in terms of the original string matched.
 ///
 /// `'c` is the lifetime of the captures.
-#[derive(Clone)]
+#[derive(Clone, Debug)]
 pub struct SubCapturesPosIter<'c> {
     idx: usize,
     locs: &'c Locations,
@@ -73,6 +76,8 @@ impl<'c> Iterator for SubCapturesPosIter<'c> {
     }
 }
 
+impl<'c> FusedIterator for SubCapturesPosIter<'c> {}
+
 /// `RegularExpression` describes types that can implement regex searching.
 ///
 /// This trait is my attempt at reducing code duplication and to standardize
@@ -85,9 +90,9 @@ impl<'c> Iterator for SubCapturesPosIter<'c> {
 /// somewhat reasonable. One particular thing this trait would expose would be
 /// the ability to start the search of a regex anywhere in a haystack, which
 /// isn't possible in the current public API.
-pub trait RegularExpression: Sized {
+pub trait RegularExpression: Sized + fmt::Debug {
     /// The type of the haystack.
-    type Text: ?Sized;
+    type Text: ?Sized + fmt::Debug;
 
     /// The number of capture slots in the compiled regular expression. This is
     /// always two times the number of capture groups (two slots per group).
@@ -145,6 +150,7 @@ pub trait RegularExpression: Sized {
 }
 
 /// An iterator over all non-overlapping successive leftmost-first matches.
+#[derive(Debug)]
 pub struct Matches<'t, R>
 where
     R: RegularExpression,
@@ -205,8 +211,16 @@ where
     }
 }
 
+impl<'t, R> FusedIterator for Matches<'t, R>
+where
+    R: RegularExpression,
+    R::Text: 't + AsRef<[u8]>,
+{
+}
+
 /// An iterator over all non-overlapping successive leftmost-first matches with
 /// captures.
+#[derive(Debug)]
 pub struct CaptureMatches<'t, R>(Matches<'t, R>)
 where
     R: RegularExpression,
@@ -260,3 +274,10 @@ where
         Some(locs)
     }
 }
+
+impl<'t, R> FusedIterator for CaptureMatches<'t, R>
+where
+    R: RegularExpression,
+    R::Text: 't + AsRef<[u8]>,
+{
+}
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/re_unicode.rs b/third_party/cargo/vendor/regex-1.4.5/src/re_unicode.rs
similarity index 95%
rename from third_party/cargo/vendor/regex-1.4.2/src/re_unicode.rs
rename to third_party/cargo/vendor/regex-1.4.5/src/re_unicode.rs
index ea95c1b..1b478cd 100644
--- a/third_party/cargo/vendor/regex-1.4.2/src/re_unicode.rs
+++ b/third_party/cargo/vendor/regex-1.4.5/src/re_unicode.rs
@@ -1,6 +1,7 @@
 use std::borrow::Cow;
 use std::collections::HashMap;
 use std::fmt;
+use std::iter::FusedIterator;
 use std::ops::{Index, Range};
 use std::str::FromStr;
 use std::sync::Arc;
@@ -747,6 +748,7 @@ impl Regex {
 /// whole matched region) is always unnamed.
 ///
 /// `'r` is the lifetime of the compiled regular expression.
+#[derive(Clone, Debug)]
 pub struct CaptureNames<'r>(::std::slice::Iter<'r, Option>);
 
 impl<'r> Iterator for CaptureNames<'r> {
@@ -762,12 +764,21 @@ impl<'r> Iterator for CaptureNames<'r> {
     fn size_hint(&self) -> (usize, Option) {
         self.0.size_hint()
     }
+
+    fn count(self) -> usize {
+        self.0.count()
+    }
 }
 
+impl<'r> ExactSizeIterator for CaptureNames<'r> {}
+
+impl<'r> FusedIterator for CaptureNames<'r> {}
+
 /// Yields all substrings delimited by a regular expression match.
 ///
 /// `'r` is the lifetime of the compiled regular expression and `'t` is the
 /// lifetime of the string being split.
+#[derive(Debug)]
 pub struct Split<'r, 't> {
     finder: Matches<'r, 't>,
     last: usize,
@@ -797,12 +808,15 @@ impl<'r, 't> Iterator for Split<'r, 't> {
     }
 }
 
+impl<'r, 't> FusedIterator for Split<'r, 't> {}
+
 /// Yields at most `N` substrings delimited by a regular expression match.
 ///
 /// The last substring will be whatever remains after splitting.
 ///
 /// `'r` is the lifetime of the compiled regular expression and `'t` is the
 /// lifetime of the string being split.
+#[derive(Debug)]
 pub struct SplitN<'r, 't> {
     splits: Split<'r, 't>,
     n: usize,
@@ -830,8 +844,14 @@ impl<'r, 't> Iterator for SplitN<'r, 't> {
             Some(&text[self.splits.last..])
         }
     }
+
+    fn size_hint(&self) -> (usize, Option) {
+        (0, Some(self.n))
+    }
 }
 
+impl<'r, 't> FusedIterator for SplitN<'r, 't> {}
+
 /// CaptureLocations is a low level representation of the raw offsets of each
 /// submatch.
 ///
@@ -1059,7 +1079,7 @@ impl<'t, 'i> Index<&'i str> for Captures<'t> {
 ///
 /// The lifetime `'c` corresponds to the lifetime of the `Captures` value, and
 /// the lifetime `'t` corresponds to the originally matched text.
-#[derive(Clone)]
+#[derive(Clone, Debug)]
 pub struct SubCaptureMatches<'c, 't: 'c> {
     caps: &'c Captures<'t>,
     it: SubCapturesPosIter<'c>,
@@ -1075,6 +1095,8 @@ impl<'c, 't> Iterator for SubCaptureMatches<'c, 't> {
     }
 }
 
+impl<'c, 't> FusedIterator for SubCaptureMatches<'c, 't> {}
+
 /// An iterator that yields all non-overlapping capture groups matching a
 /// particular regular expression.
 ///
@@ -1082,6 +1104,7 @@ impl<'c, 't> Iterator for SubCaptureMatches<'c, 't> {
 ///
 /// `'r` is the lifetime of the compiled regular expression and `'t` is the
 /// lifetime of the matched string.
+#[derive(Debug)]
 pub struct CaptureMatches<'r, 't>(
     re_trait::CaptureMatches<'t, ExecNoSyncStr<'r>>,
 );
@@ -1098,6 +1121,8 @@ impl<'r, 't> Iterator for CaptureMatches<'r, 't> {
     }
 }
 
+impl<'r, 't> FusedIterator for CaptureMatches<'r, 't> {}
+
 /// An iterator over all non-overlapping matches for a particular string.
 ///
 /// The iterator yields a `Match` value. The iterator stops when no more
@@ -1105,6 +1130,7 @@ impl<'r, 't> Iterator for CaptureMatches<'r, 't> {
 ///
 /// `'r` is the lifetime of the compiled regular expression and `'t` is the
 /// lifetime of the matched string.
+#[derive(Debug)]
 pub struct Matches<'r, 't>(re_trait::Matches<'t, ExecNoSyncStr<'r>>);
 
 impl<'r, 't> Iterator for Matches<'r, 't> {
@@ -1116,12 +1142,14 @@ impl<'r, 't> Iterator for Matches<'r, 't> {
     }
 }
 
+impl<'r, 't> FusedIterator for Matches<'r, 't> {}
+
 /// Replacer describes types that can be used to replace matches in a string.
 ///
 /// In general, users of this crate shouldn't need to implement this trait,
-/// since implementations are already provided for `&str` and
-/// `FnMut(&Captures) -> String` (or any `FnMut(&Captures) -> T`
-/// where `T: AsRef`), which covers most use cases.
+/// since implementations are already provided for `&str` along with other
+/// variants of string types and `FnMut(&Captures) -> String` (or any
+/// `FnMut(&Captures) -> T` where `T: AsRef`), which covers most use cases.
 pub trait Replacer {
     /// Appends text to `dst` to replace the current match.
     ///
@@ -1190,10 +1218,55 @@ impl<'a> Replacer for &'a str {
     }
 
     fn no_expansion(&mut self) -> Option> {
-        match find_byte(b'$', self.as_bytes()) {
-            Some(_) => None,
-            None => Some(Cow::Borrowed(*self)),
-        }
+        no_expansion(self)
+    }
+}
+
+impl<'a> Replacer for &'a String {
+    fn replace_append(&mut self, caps: &Captures, dst: &mut String) {
+        self.as_str().replace_append(caps, dst)
+    }
+
+    fn no_expansion(&mut self) -> Option> {
+        no_expansion(self)
+    }
+}
+
+impl Replacer for String {
+    fn replace_append(&mut self, caps: &Captures, dst: &mut String) {
+        self.as_str().replace_append(caps, dst)
+    }
+
+    fn no_expansion(&mut self) -> Option> {
+        no_expansion(self)
+    }
+}
+
+impl<'a> Replacer for Cow<'a, str> {
+    fn replace_append(&mut self, caps: &Captures, dst: &mut String) {
+        self.as_ref().replace_append(caps, dst)
+    }
+
+    fn no_expansion(&mut self) -> Option> {
+        no_expansion(self)
+    }
+}
+
+impl<'a> Replacer for &'a Cow<'a, str> {
+    fn replace_append(&mut self, caps: &Captures, dst: &mut String) {
+        self.as_ref().replace_append(caps, dst)
+    }
+
+    fn no_expansion(&mut self) -> Option> {
+        no_expansion(self)
+    }
+}
+
+fn no_expansion>(t: &T) -> Option> {
+    let s = t.as_ref();
+    match find_byte(b'$', s.as_bytes()) {
+        Some(_) => None,
+        None => Some(Cow::Borrowed(s)),
     }
 }
 
@@ -1215,6 +1288,7 @@ where
 /// and performant (since capture groups don't need to be found).
 ///
 /// `'t` is the lifetime of the literal text.
+#[derive(Clone, Debug)]
 pub struct NoExpand<'t>(pub &'t str);
 
 impl<'t> Replacer for NoExpand<'t> {
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/sparse.rs b/third_party/cargo/vendor/regex-1.4.5/src/sparse.rs
similarity index 96%
rename from third_party/cargo/vendor/regex-1.4.2/src/sparse.rs
rename to third_party/cargo/vendor/regex-1.4.5/src/sparse.rs
index bc1b2b5..421d6b6 100644
--- a/third_party/cargo/vendor/regex-1.4.2/src/sparse.rs
+++ b/third_party/cargo/vendor/regex-1.4.5/src/sparse.rs
@@ -8,7 +8,7 @@ use std::slice;
 /// entire set can also be done in constant time. Iteration yields elements
 /// in the order in which they were inserted.
 ///
-/// The data structure is based on: http://research.swtch.com/sparse
+/// The data structure is based on: https://research.swtch.com/sparse
 /// Note though that we don't actually use uninitialized memory. We generally
 /// reuse allocations, so the initial allocation cost is bareable. However,
 /// its other properties listed above are extremely useful.
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/testdata/LICENSE b/third_party/cargo/vendor/regex-1.4.5/src/testdata/LICENSE
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/src/testdata/LICENSE
rename to third_party/cargo/vendor/regex-1.4.5/src/testdata/LICENSE
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/testdata/README b/third_party/cargo/vendor/regex-1.4.5/src/testdata/README
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/src/testdata/README
rename to third_party/cargo/vendor/regex-1.4.5/src/testdata/README
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/testdata/basic.dat b/third_party/cargo/vendor/regex-1.4.5/src/testdata/basic.dat
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/src/testdata/basic.dat
rename to third_party/cargo/vendor/regex-1.4.5/src/testdata/basic.dat
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/testdata/nullsubexpr.dat b/third_party/cargo/vendor/regex-1.4.5/src/testdata/nullsubexpr.dat
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/src/testdata/nullsubexpr.dat
rename to third_party/cargo/vendor/regex-1.4.5/src/testdata/nullsubexpr.dat
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/testdata/repetition.dat b/third_party/cargo/vendor/regex-1.4.5/src/testdata/repetition.dat
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/src/testdata/repetition.dat
rename to third_party/cargo/vendor/regex-1.4.5/src/testdata/repetition.dat
diff --git a/third_party/cargo/vendor/regex-1.4.2/src/utf8.rs b/third_party/cargo/vendor/regex-1.4.5/src/utf8.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/src/utf8.rs
rename to third_party/cargo/vendor/regex-1.4.5/src/utf8.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/test b/third_party/cargo/vendor/regex-1.4.5/test
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/test
rename to third_party/cargo/vendor/regex-1.4.5/test
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/api.rs b/third_party/cargo/vendor/regex-1.4.5/tests/api.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/api.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/api.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/api_str.rs b/third_party/cargo/vendor/regex-1.4.5/tests/api_str.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/api_str.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/api_str.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/bytes.rs b/third_party/cargo/vendor/regex-1.4.5/tests/bytes.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/bytes.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/bytes.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/consistent.rs b/third_party/cargo/vendor/regex-1.4.5/tests/consistent.rs
similarity index 98%
rename from third_party/cargo/vendor/regex-1.4.2/tests/consistent.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/consistent.rs
index 0f9ea53..722f2a5 100644
--- a/third_party/cargo/vendor/regex-1.4.2/tests/consistent.rs
+++ b/third_party/cargo/vendor/regex-1.4.5/tests/consistent.rs
@@ -157,10 +157,7 @@ macro_rules! checker {
             }
 
             impl quickcheck::Testable for RegexEqualityTest {
-                fn result(
-                    &self,
-                    gen: &mut G,
-                ) -> TestResult {
+                fn result(&self, gen: &mut quickcheck::Gen) -> TestResult {
                     let input = $mk_input(gen);
                     let input = &input;
 
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/crates_regex.rs b/third_party/cargo/vendor/regex-1.4.5/tests/crates_regex.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/crates_regex.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/crates_regex.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/crazy.rs b/third_party/cargo/vendor/regex-1.4.5/tests/crazy.rs
similarity index 98%
rename from third_party/cargo/vendor/regex-1.4.2/tests/crazy.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/crazy.rs
index 56f6cad..293ac1a 100644
--- a/third_party/cargo/vendor/regex-1.4.2/tests/crazy.rs
+++ b/third_party/cargo/vendor/regex-1.4.5/tests/crazy.rs
@@ -137,9 +137,10 @@ matiter!(match_empty23, r"a(?:)|b", "abc", (0, 1), (1, 2));
 #[test]
 fn dfa_handles_pathological_case() {
     fn ones_and_zeroes(count: usize) -> String {
-        use rand::{thread_rng, Rng};
+        use rand::rngs::SmallRng;
+        use rand::{Rng, SeedableRng};
 
-        let mut rng = thread_rng();
+        let mut rng = SmallRng::from_entropy();
         let mut s = String::new();
         for _ in 0..count {
             if rng.gen() {
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/flags.rs b/third_party/cargo/vendor/regex-1.4.5/tests/flags.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/flags.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/flags.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/fowler.rs b/third_party/cargo/vendor/regex-1.4.5/tests/fowler.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/fowler.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/fowler.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/macros.rs b/third_party/cargo/vendor/regex-1.4.5/tests/macros.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/macros.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/macros.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/macros_bytes.rs b/third_party/cargo/vendor/regex-1.4.5/tests/macros_bytes.rs
similarity index 99%
rename from third_party/cargo/vendor/regex-1.4.2/tests/macros_bytes.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/macros_bytes.rs
index 03c370d..3d6c8c3 100644
--- a/third_party/cargo/vendor/regex-1.4.2/tests/macros_bytes.rs
+++ b/third_party/cargo/vendor/regex-1.4.5/tests/macros_bytes.rs
@@ -4,7 +4,6 @@ macro_rules! t { ($re:expr) => { text!($re) } }
 macro_rules! match_text { ($text:expr) => { $text.as_bytes() } }
 macro_rules! use_ { ($($path: tt)*) => { use regex::bytes::$($path)*; } }
 macro_rules! empty_vec { () => { >::new() } }
-
 macro_rules! bytes { ($text:expr) => { $text } }
 
 macro_rules! no_expand {
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/macros_str.rs b/third_party/cargo/vendor/regex-1.4.5/tests/macros_str.rs
similarity index 93%
rename from third_party/cargo/vendor/regex-1.4.2/tests/macros_str.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/macros_str.rs
index 9b996b3..7b7eb11 100644
--- a/third_party/cargo/vendor/regex-1.4.2/tests/macros_str.rs
+++ b/third_party/cargo/vendor/regex-1.4.5/tests/macros_str.rs
@@ -4,6 +4,7 @@ macro_rules! t { ($text:expr) => { text!($text) } }
 macro_rules! match_text { ($text:expr) => { $text.as_str() } }
 macro_rules! use_ { ($($path: tt)*) => { use regex::$($path)*; } }
 macro_rules! empty_vec { () => { >::new() } }
+macro_rules! bytes { ($text:expr) => { std::str::from_utf8($text.as_ref()).unwrap() } }
 
 macro_rules! no_expand {
     ($text:expr) => {{
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/misc.rs b/third_party/cargo/vendor/regex-1.4.5/tests/misc.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/misc.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/misc.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/multiline.rs b/third_party/cargo/vendor/regex-1.4.5/tests/multiline.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/multiline.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/multiline.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/noparse.rs b/third_party/cargo/vendor/regex-1.4.5/tests/noparse.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/noparse.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/noparse.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/regression.rs b/third_party/cargo/vendor/regex-1.4.5/tests/regression.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/regression.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/regression.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/regression_fuzz.rs b/third_party/cargo/vendor/regex-1.4.5/tests/regression_fuzz.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/regression_fuzz.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/regression_fuzz.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/replace.rs b/third_party/cargo/vendor/regex-1.4.5/tests/replace.rs
similarity index 60%
rename from third_party/cargo/vendor/regex-1.4.2/tests/replace.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/replace.rs
index c156a39..700aff2 100644
--- a/third_party/cargo/vendor/regex-1.4.2/tests/replace.rs
+++ b/third_party/cargo/vendor/regex-1.4.5/tests/replace.rs
@@ -130,3 +130,101 @@ replace!(
     t!("${1}a $1a"),
     "ba "
 );
+
+replace!(
+    impl_string,
+    replace,
+    r"[0-9]",
+    "age: 26",
+    t!("Z".to_string()),
+    "age: Z6"
+);
+replace!(
+    impl_string_ref,
+    replace,
+    r"[0-9]",
+    "age: 26",
+    t!(&"Z".to_string()),
+    "age: Z6"
+);
+replace!(
+    impl_cow_str_borrowed,
+    replace,
+    r"[0-9]",
+    "age: 26",
+    t!(std::borrow::Cow::<'_, str>::Borrowed("Z")),
+    "age: Z6"
+);
+replace!(
+    impl_cow_str_borrowed_ref,
+    replace,
+    r"[0-9]",
+    "age: 26",
+    t!(&std::borrow::Cow::<'_, str>::Borrowed("Z")),
+    "age: Z6"
+);
+replace!(
+    impl_cow_str_owned,
+    replace,
+    r"[0-9]",
+    "age: 26",
+    t!(std::borrow::Cow::<'_, str>::Owned("Z".to_string())),
+    "age: Z6"
+);
+replace!(
+    impl_cow_str_owned_ref,
+    replace,
+    r"[0-9]",
+    "age: 26",
+    t!(&std::borrow::Cow::<'_, str>::Owned("Z".to_string())),
+    "age: Z6"
+);
+
+replace!(
+    impl_vec_u8,
+    replace,
+    r"[0-9]",
+    "age: 26",
+    bytes!(vec![b'Z']),
+    "age: Z6"
+);
+replace!(
+    impl_vec_u8_ref,
+    replace,
+    r"[0-9]",
+    "age: 26",
+    bytes!(&vec![b'Z']),
+    "age: Z6"
+);
+replace!(
+    impl_cow_slice_borrowed,
+    replace,
+    r"[0-9]",
+    "age: 26",
+    bytes!(std::borrow::Cow::<'_, [u8]>::Borrowed(&[b'Z'])),
+    "age: Z6"
+);
+replace!(
+    impl_cow_slice_borrowed_ref,
+    replace,
+    r"[0-9]",
+    "age: 26",
+    bytes!(&std::borrow::Cow::<'_, [u8]>::Borrowed(&[b'Z'])),
+    "age: Z6"
+);
+replace!(
+    impl_cow_slice_owned,
+    replace,
+    r"[0-9]",
+    "age: 26",
+    bytes!(std::borrow::Cow::<'_, [u8]>::Owned(vec![b'Z'])),
+    "age: Z6"
+);
+replace!(
+    impl_cow_slice_owned_ref,
+    replace,
+    r"[0-9]",
+    "age: 26",
+    bytes!(&std::borrow::Cow::<'_, [u8]>::Owned(vec![b'Z'])),
+    "age: Z6"
+);
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/searcher.rs b/third_party/cargo/vendor/regex-1.4.5/tests/searcher.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/searcher.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/searcher.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/set.rs b/third_party/cargo/vendor/regex-1.4.5/tests/set.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/set.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/set.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/shortest_match.rs b/third_party/cargo/vendor/regex-1.4.5/tests/shortest_match.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/shortest_match.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/shortest_match.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/suffix_reverse.rs b/third_party/cargo/vendor/regex-1.4.5/tests/suffix_reverse.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/suffix_reverse.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/suffix_reverse.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/test_backtrack.rs b/third_party/cargo/vendor/regex-1.4.5/tests/test_backtrack.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/test_backtrack.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/test_backtrack.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/test_backtrack_bytes.rs b/third_party/cargo/vendor/regex-1.4.5/tests/test_backtrack_bytes.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/test_backtrack_bytes.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/test_backtrack_bytes.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/test_backtrack_utf8bytes.rs b/third_party/cargo/vendor/regex-1.4.5/tests/test_backtrack_utf8bytes.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/test_backtrack_utf8bytes.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/test_backtrack_utf8bytes.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/test_crates_regex.rs b/third_party/cargo/vendor/regex-1.4.5/tests/test_crates_regex.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/test_crates_regex.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/test_crates_regex.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/test_default.rs b/third_party/cargo/vendor/regex-1.4.5/tests/test_default.rs
similarity index 64%
rename from third_party/cargo/vendor/regex-1.4.2/tests/test_default.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/test_default.rs
index 241e580..af634a0 100644
--- a/third_party/cargo/vendor/regex-1.4.2/tests/test_default.rs
+++ b/third_party/cargo/vendor/regex-1.4.5/tests/test_default.rs
@@ -83,26 +83,49 @@ fn allow_octal() {
 #[test]
 fn oibits() {
     use regex::bytes;
-    use regex::{Regex, RegexBuilder};
-    use std::panic::UnwindSafe;
+    use regex::{Regex, RegexBuilder, RegexSet, RegexSetBuilder};
+    use std::panic::{RefUnwindSafe, UnwindSafe};
 
     fn assert_send() {}
     fn assert_sync() {}
     fn assert_unwind_safe() {}
+    fn assert_ref_unwind_safe() {}
 
     assert_send::();
     assert_sync::();
     assert_unwind_safe::();
+    assert_ref_unwind_safe::();
     assert_send::();
     assert_sync::();
     assert_unwind_safe::();
+    assert_ref_unwind_safe::();
 
     assert_send::();
     assert_sync::();
     assert_unwind_safe::();
+    assert_ref_unwind_safe::();
     assert_send::();
     assert_sync::();
     assert_unwind_safe::();
+    assert_ref_unwind_safe::();
+
+    assert_send::();
+    assert_sync::();
+    assert_unwind_safe::();
+    assert_ref_unwind_safe::();
+    assert_send::();
+    assert_sync::();
+    assert_unwind_safe::();
+    assert_ref_unwind_safe::();
+
+    assert_send::();
+    assert_sync::();
+    assert_unwind_safe::();
+    assert_ref_unwind_safe::();
+    assert_send::();
+    assert_sync::();
+    assert_unwind_safe::();
+    assert_ref_unwind_safe::();
 }
 
 // See: https://github.com/rust-lang/regex/issues/568
@@ -113,3 +136,18 @@ fn oibits_regression() {
 
     let _ = panic::catch_unwind(|| Regex::new("a").unwrap());
 }
+
+// See: https://github.com/rust-lang/regex/issues/750
+#[test]
+#[cfg(target_pointer_width = "64")]
+fn regex_is_reasonably_small() {
+    use std::mem::size_of;
+
+    use regex::bytes;
+    use regex::{Regex, RegexSet};
+
+    assert_eq!(16, size_of::());
+    assert_eq!(16, size_of::());
+    assert_eq!(16, size_of::());
+    assert_eq!(16, size_of::());
+}
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/test_default_bytes.rs b/third_party/cargo/vendor/regex-1.4.5/tests/test_default_bytes.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/test_default_bytes.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/test_default_bytes.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/test_nfa.rs b/third_party/cargo/vendor/regex-1.4.5/tests/test_nfa.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/test_nfa.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/test_nfa.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/test_nfa_bytes.rs b/third_party/cargo/vendor/regex-1.4.5/tests/test_nfa_bytes.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/test_nfa_bytes.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/test_nfa_bytes.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/test_nfa_utf8bytes.rs b/third_party/cargo/vendor/regex-1.4.5/tests/test_nfa_utf8bytes.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/test_nfa_utf8bytes.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/test_nfa_utf8bytes.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/unicode.rs b/third_party/cargo/vendor/regex-1.4.5/tests/unicode.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/unicode.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/unicode.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/word_boundary.rs b/third_party/cargo/vendor/regex-1.4.5/tests/word_boundary.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/word_boundary.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/word_boundary.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/word_boundary_ascii.rs b/third_party/cargo/vendor/regex-1.4.5/tests/word_boundary_ascii.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/word_boundary_ascii.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/word_boundary_ascii.rs
diff --git a/third_party/cargo/vendor/regex-1.4.2/tests/word_boundary_unicode.rs b/third_party/cargo/vendor/regex-1.4.5/tests/word_boundary_unicode.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-1.4.2/tests/word_boundary_unicode.rs
rename to third_party/cargo/vendor/regex-1.4.5/tests/word_boundary_unicode.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/.cargo-checksum.json b/third_party/cargo/vendor/regex-syntax-0.6.23/.cargo-checksum.json
similarity index 85%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/.cargo-checksum.json
rename to third_party/cargo/vendor/regex-syntax-0.6.23/.cargo-checksum.json
index 57be138..1afbd74 100644
--- a/third_party/cargo/vendor/regex-syntax-0.6.21/.cargo-checksum.json
+++ b/third_party/cargo/vendor/regex-syntax-0.6.23/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"Cargo.toml":"091a447127dacf249fff9aa782dc438ee42d6a4333a71efe4ba5195e1d35d9d9","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"7e9a134c72b09540e6f81f02133c5ae7d35067ea6fec44a94a1ebd20af47b151","benches/bench.rs":"f04160a876ee69bc9938bf51227513d6dbf3608643bc8ae422200f7ffc5ca85f","src/ast/mod.rs":"ff7e81186be4f7dea848363622bcd13cd8bf5b0826ea0fd7784a46547d9cf7c0","src/ast/parse.rs":"39fae33ce40c051086811861cec4df912da91c40b74f09e478592e770cf2edee","src/ast/print.rs":"b075392a6d5b48713e09aa510199bb7380aca2cf09fa4bc0efb5c49782630dda","src/ast/visitor.rs":"fb1489ed5ce019091dde244acd8b027e391be442aef3a9033c785c81a4c251fb","src/either.rs":"1758e3edd056884eccadd995708d1e374ba9aa65846bd0e13b1aae852607c560","src/error.rs":"dd937a59d5caed6ca430b884ca4d26116a57ba4c74e4f11797b255d1ac6ace51","src/hir/interval.rs":"fcd0babe3bddbe411e04adff7f4d8855db1d6aaa7d8e2180bba819abad576736","src/hir/literal/mod.rs":"b0a01a3d7e524277ada88d5b58efcced498a53addfac69355fcc368c4c4dfb0f","src/hir/mod.rs":"384d44974c90b3520f0ce1426749e6b3abaf29d7031504fd57e22a3c2e7ab3d0","src/hir/print.rs":"1bd12a70e5876d85eb2188d83c4b71c9533dc6fff0c1ab5c2b0e4701de7e7a90","src/hir/translate.rs":"1cf3f0822faeb45134e31d7dfa70ef873a92febfeabd64b694ae7c64c839ddb2","src/hir/visitor.rs":"203dbe93e4a8cde395c6ff5a0eb98c9c3737bc5ea11fe7163f5e7bf1babc1f69","src/lib.rs":"2b99d3e94a82a7ab3e1c54b262cb081b82ec0ba1eb77571a56ecbe3393c3b8f7","src/parser.rs":"10cc145d79c275c7e19b8cc9078754f23fc1da9a2c3a2e56041a8616d5f85dea","src/unicode.rs":"f1cd662a1df564be951a1df80560f1486dfe471ee9ea04d713fc6c5faf310642","src/unicode_tables/LICENSE-UNICODE":"74db5baf44a41b1000312c673544b3374e4198af5605c7f9080a402cec42cfa3","src/unicode_tables/age.rs":"b0932a020d3386478dd2f4839c59e30c525e8591735052b9e791e1ce3a2e2b72","src/unicode_tables/case_folding_simple.rs":"6d1f3d095132639228faf4806d05308c70ce2baa68cce69dca01ea159c4eaa15","src/unicode_tables/general_category.rs":"d21877600d387b8a0c5fbb0942458d0330c69aad6565e28134b8a1a371d2f4f4","src/unicode_tables/grapheme_cluster_break.rs":"f03a8be4a00265b568ca2a41d99f66a5d0f5fb423cb4113494153423a1123cda","src/unicode_tables/mod.rs":"26c837099cd934c8062e24bc9a0aaecf15fe1de03f9c6da3f3e1e5ac3ca24bee","src/unicode_tables/perl_decimal.rs":"e39a5934b504eb3282ccb26bbf50ecd764e720120eb7cf6c43662a2321665ab5","src/unicode_tables/perl_space.rs":"014e5d92b66730557e408c2d5c9b2f46d3d288aa85400ab9193c218c7b98ad21","src/unicode_tables/perl_word.rs":"ddf126f39171776ef83151d7a0dbc41da8dd09186723211fb966c4b304247a5e","src/unicode_tables/property_bool.rs":"21f72bd9f3955e3443549ef6609418817ae6df3c81fb5be90a0ceee9d7d3002d","src/unicode_tables/property_names.rs":"504ea44604cd15a7e827a89066bb81a847dd5c57cef360d9f4a914cf22afcf36","src/unicode_tables/property_values.rs":"4d793ad1b664c1913db146897c8eb4fa29d181b821f096de90dc889b738edb88","src/unicode_tables/script.rs":"5a7d2a958b93056081b8b2eb87c3a5609579ad791ad5b0c42959362ce6ea5b31","src/unicode_tables/script_extension.rs":"1d5f1985f7dcae833e78c3858231666b535bf60e032cfacc09d014c22bda6690","src/unicode_tables/sentence_break.rs":"cd5f0eb7ab6b0ec1c1fb4d78496dfecd691d0d0b76495538b9f376645a753deb","src/unicode_tables/word_break.rs":"eabeacfde7558cfe7b1556b0221f09c65f049de0b08c7cd464c1669040610a6b","src/utf8.rs":"f3e9564a0346be55356dfadac20e737c299900193c7fef5d7b4a4fc8ac2537a7","test":"9d0bc68616c249f317e783e5083102d2645a6ade3de735e8d8a414e97eaa76d0"},"package":"3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189"}
\ No newline at end of file
+{"files":{"Cargo.toml":"bef24f541acc980aee14f67481d0ec8e5d7eee82341841c394d2c9a83db1743f","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"7e9a134c72b09540e6f81f02133c5ae7d35067ea6fec44a94a1ebd20af47b151","benches/bench.rs":"f04160a876ee69bc9938bf51227513d6dbf3608643bc8ae422200f7ffc5ca85f","src/ast/mod.rs":"ff7e81186be4f7dea848363622bcd13cd8bf5b0826ea0fd7784a46547d9cf7c0","src/ast/parse.rs":"39fae33ce40c051086811861cec4df912da91c40b74f09e478592e770cf2edee","src/ast/print.rs":"b075392a6d5b48713e09aa510199bb7380aca2cf09fa4bc0efb5c49782630dda","src/ast/visitor.rs":"fb1489ed5ce019091dde244acd8b027e391be442aef3a9033c785c81a4c251fb","src/either.rs":"1758e3edd056884eccadd995708d1e374ba9aa65846bd0e13b1aae852607c560","src/error.rs":"dd937a59d5caed6ca430b884ca4d26116a57ba4c74e4f11797b255d1ac6ace51","src/hir/interval.rs":"fcd0babe3bddbe411e04adff7f4d8855db1d6aaa7d8e2180bba819abad576736","src/hir/literal/mod.rs":"b0a01a3d7e524277ada88d5b58efcced498a53addfac69355fcc368c4c4dfb0f","src/hir/mod.rs":"384d44974c90b3520f0ce1426749e6b3abaf29d7031504fd57e22a3c2e7ab3d0","src/hir/print.rs":"1bd12a70e5876d85eb2188d83c4b71c9533dc6fff0c1ab5c2b0e4701de7e7a90","src/hir/translate.rs":"1cf3f0822faeb45134e31d7dfa70ef873a92febfeabd64b694ae7c64c839ddb2","src/hir/visitor.rs":"203dbe93e4a8cde395c6ff5a0eb98c9c3737bc5ea11fe7163f5e7bf1babc1f69","src/lib.rs":"92d0173c5b36354724b356786523416bc652cbb02dbcdd62ecb8e4b3381e2c5d","src/parser.rs":"10cc145d79c275c7e19b8cc9078754f23fc1da9a2c3a2e56041a8616d5f85dea","src/unicode.rs":"22e52c7548a59283ef46b4ce27d35aa91d018c9d6f04ccf16ab88d3afd3a41d3","src/unicode_tables/LICENSE-UNICODE":"74db5baf44a41b1000312c673544b3374e4198af5605c7f9080a402cec42cfa3","src/unicode_tables/age.rs":"b0932a020d3386478dd2f4839c59e30c525e8591735052b9e791e1ce3a2e2b72","src/unicode_tables/case_folding_simple.rs":"6d1f3d095132639228faf4806d05308c70ce2baa68cce69dca01ea159c4eaa15","src/unicode_tables/general_category.rs":"d21877600d387b8a0c5fbb0942458d0330c69aad6565e28134b8a1a371d2f4f4","src/unicode_tables/grapheme_cluster_break.rs":"f03a8be4a00265b568ca2a41d99f66a5d0f5fb423cb4113494153423a1123cda","src/unicode_tables/mod.rs":"26c837099cd934c8062e24bc9a0aaecf15fe1de03f9c6da3f3e1e5ac3ca24bee","src/unicode_tables/perl_decimal.rs":"e39a5934b504eb3282ccb26bbf50ecd764e720120eb7cf6c43662a2321665ab5","src/unicode_tables/perl_space.rs":"014e5d92b66730557e408c2d5c9b2f46d3d288aa85400ab9193c218c7b98ad21","src/unicode_tables/perl_word.rs":"ddf126f39171776ef83151d7a0dbc41da8dd09186723211fb966c4b304247a5e","src/unicode_tables/property_bool.rs":"21f72bd9f3955e3443549ef6609418817ae6df3c81fb5be90a0ceee9d7d3002d","src/unicode_tables/property_names.rs":"504ea44604cd15a7e827a89066bb81a847dd5c57cef360d9f4a914cf22afcf36","src/unicode_tables/property_values.rs":"4d793ad1b664c1913db146897c8eb4fa29d181b821f096de90dc889b738edb88","src/unicode_tables/script.rs":"5a7d2a958b93056081b8b2eb87c3a5609579ad791ad5b0c42959362ce6ea5b31","src/unicode_tables/script_extension.rs":"1d5f1985f7dcae833e78c3858231666b535bf60e032cfacc09d014c22bda6690","src/unicode_tables/sentence_break.rs":"cd5f0eb7ab6b0ec1c1fb4d78496dfecd691d0d0b76495538b9f376645a753deb","src/unicode_tables/word_break.rs":"eabeacfde7558cfe7b1556b0221f09c65f049de0b08c7cd464c1669040610a6b","src/utf8.rs":"a42486af691ca686673b85df5661cd5b1ee793368d5571abd81893ec04094e3f","test":"9d0bc68616c249f317e783e5083102d2645a6ade3de735e8d8a414e97eaa76d0"},"package":"24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548"}
\ No newline at end of file
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/BUILD.bazel b/third_party/cargo/vendor/regex-syntax-0.6.23/BUILD.bazel
similarity index 98%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/BUILD.bazel
rename to third_party/cargo/vendor/regex-syntax-0.6.23/BUILD.bazel
index 55b9ac5..b1ccb99 100644
--- a/third_party/cargo/vendor/regex-syntax-0.6.21/BUILD.bazel
+++ b/third_party/cargo/vendor/regex-syntax-0.6.23/BUILD.bazel
@@ -57,7 +57,7 @@ rust_library(
         "cargo-raze",
         "manual",
     ],
-    version = "0.6.21",
+    version = "0.6.23",
     # buildifier: leave-alone
     deps = [
     ],
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/Cargo.toml b/third_party/cargo/vendor/regex-syntax-0.6.23/Cargo.toml
similarity index 98%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/Cargo.toml
rename to third_party/cargo/vendor/regex-syntax-0.6.23/Cargo.toml
index f4b1476..877b230 100644
--- a/third_party/cargo/vendor/regex-syntax-0.6.21/Cargo.toml
+++ b/third_party/cargo/vendor/regex-syntax-0.6.23/Cargo.toml
@@ -12,7 +12,7 @@
 
 [package]
 name = "regex-syntax"
-version = "0.6.21"
+version = "0.6.23"
 authors = ["The Rust Project Developers"]
 description = "A regular expression parser."
 homepage = "https://github.com/rust-lang/regex"
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/LICENSE-APACHE b/third_party/cargo/vendor/regex-syntax-0.6.23/LICENSE-APACHE
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/LICENSE-APACHE
rename to third_party/cargo/vendor/regex-syntax-0.6.23/LICENSE-APACHE
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/LICENSE-MIT b/third_party/cargo/vendor/regex-syntax-0.6.23/LICENSE-MIT
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/LICENSE-MIT
rename to third_party/cargo/vendor/regex-syntax-0.6.23/LICENSE-MIT
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/README.md b/third_party/cargo/vendor/regex-syntax-0.6.23/README.md
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/README.md
rename to third_party/cargo/vendor/regex-syntax-0.6.23/README.md
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/benches/bench.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/benches/bench.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/benches/bench.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/benches/bench.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/ast/mod.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/ast/mod.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/ast/mod.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/ast/mod.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/ast/parse.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/ast/parse.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/ast/parse.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/ast/parse.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/ast/print.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/ast/print.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/ast/print.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/ast/print.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/ast/visitor.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/ast/visitor.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/ast/visitor.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/ast/visitor.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/either.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/either.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/either.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/either.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/error.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/error.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/error.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/error.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/hir/interval.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/hir/interval.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/hir/interval.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/hir/interval.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/hir/literal/mod.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/hir/literal/mod.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/hir/literal/mod.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/hir/literal/mod.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/hir/mod.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/hir/mod.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/hir/mod.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/hir/mod.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/hir/print.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/hir/print.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/hir/print.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/hir/print.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/hir/translate.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/hir/translate.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/hir/translate.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/hir/translate.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/hir/visitor.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/hir/visitor.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/hir/visitor.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/hir/visitor.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/lib.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/lib.rs
similarity index 98%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/lib.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/lib.rs
index f35c913..6be634a 100644
--- a/third_party/cargo/vendor/regex-syntax-0.6.21/src/lib.rs
+++ b/third_party/cargo/vendor/regex-syntax-0.6.23/src/lib.rs
@@ -155,6 +155,7 @@ The following features are available:
 */
 
 #![deny(missing_docs)]
+#![warn(missing_debug_implementations)]
 #![forbid(unsafe_code)]
 
 pub use error::{Error, Result};
@@ -215,7 +216,7 @@ pub fn is_meta_character(c: char) -> bool {
 /// character.
 ///
 /// A Unicode word character is defined by
-/// [UTS#18 Annex C](http://unicode.org/reports/tr18/#Compatibility_Properties).
+/// [UTS#18 Annex C](https://unicode.org/reports/tr18/#Compatibility_Properties).
 /// In particular, a character
 /// is considered a word character if it is in either of the `Alphabetic` or
 /// `Join_Control` properties, or is in one of the `Decimal_Number`, `Mark`
@@ -235,7 +236,7 @@ pub fn is_word_character(c: char) -> bool {
 /// character.
 ///
 /// A Unicode word character is defined by
-/// [UTS#18 Annex C](http://unicode.org/reports/tr18/#Compatibility_Properties).
+/// [UTS#18 Annex C](https://unicode.org/reports/tr18/#Compatibility_Properties).
 /// In particular, a character
 /// is considered a word character if it is in either of the `Alphabetic` or
 /// `Join_Control` properties, or is in one of the `Decimal_Number`, `Mark`
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/parser.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/parser.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/parser.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/parser.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode.rs
similarity index 99%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode.rs
index a78362b..73df698 100644
--- a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode.rs
+++ b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode.rs
@@ -823,7 +823,7 @@ fn symbolic_name_normalize(x: &str) -> String {
 /// The slice returned is guaranteed to be valid UTF-8 for all possible values
 /// of `slice`.
 ///
-/// See: http://unicode.org/reports/tr44/#UAX44-LM3
+/// See: https://unicode.org/reports/tr44/#UAX44-LM3
 fn symbolic_name_normalize_bytes(slice: &mut [u8]) -> &mut [u8] {
     // I couldn't find a place in the standard that specified that property
     // names/aliases had a particular structure (unlike character names), but
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/LICENSE-UNICODE b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/LICENSE-UNICODE
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/LICENSE-UNICODE
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/LICENSE-UNICODE
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/age.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/age.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/age.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/age.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/case_folding_simple.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/case_folding_simple.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/case_folding_simple.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/case_folding_simple.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/general_category.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/general_category.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/general_category.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/general_category.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/grapheme_cluster_break.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/grapheme_cluster_break.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/grapheme_cluster_break.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/grapheme_cluster_break.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/mod.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/mod.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/mod.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/mod.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/perl_decimal.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/perl_decimal.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/perl_decimal.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/perl_decimal.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/perl_space.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/perl_space.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/perl_space.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/perl_space.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/perl_word.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/perl_word.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/perl_word.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/perl_word.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/property_bool.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/property_bool.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/property_bool.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/property_bool.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/property_names.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/property_names.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/property_names.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/property_names.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/property_values.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/property_values.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/property_values.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/property_values.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/script.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/script.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/script.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/script.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/script_extension.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/script_extension.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/script_extension.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/script_extension.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/sentence_break.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/sentence_break.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/sentence_break.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/sentence_break.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/word_break.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/word_break.rs
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/unicode_tables/word_break.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/unicode_tables/word_break.rs
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/src/utf8.rs b/third_party/cargo/vendor/regex-syntax-0.6.23/src/utf8.rs
similarity index 99%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/src/utf8.rs
rename to third_party/cargo/vendor/regex-syntax-0.6.23/src/utf8.rs
index 489729e..947ba7c 100644
--- a/third_party/cargo/vendor/regex-syntax-0.6.21/src/utf8.rs
+++ b/third_party/cargo/vendor/regex-syntax-0.6.23/src/utf8.rs
@@ -15,7 +15,7 @@ whether a particular byte sequence was a Cyrillic character. One possible
 scalar value range is `[0400-04FF]`. The set of allowed bytes for this
 range can be expressed as a sequence of byte ranges:
 
-```ignore
+```text
 [D0-D3][80-BF]
 ```
 
@@ -32,7 +32,7 @@ for example, `04FF` (because its last byte, `BF` isn't in the range `80-AF`).
 
 Instead, you need multiple sequences of byte ranges:
 
-```ignore
+```text
 [D0-D3][80-BF]  # matches codepoints 0400-04FF
 [D4][80-AF]     # matches codepoints 0500-052F
 ```
@@ -41,7 +41,7 @@ This gets even more complicated if you want bigger ranges, particularly if
 they naively contain surrogate codepoints. For example, the sequence of byte
 ranges for the basic multilingual plane (`[0000-FFFF]`) look like this:
 
-```ignore
+```text
 [0-7F]
 [C2-DF][80-BF]
 [E0][A0-BF][80-BF]
@@ -55,7 +55,7 @@ UTF-8, including encodings of surrogate codepoints.
 
 And, of course, for all of Unicode (`[000000-10FFFF]`):
 
-```ignore
+```text
 [0-7F]
 [C2-DF][80-BF]
 [E0][A0-BF][80-BF]
@@ -84,6 +84,7 @@ which uses it for executing automata on their term index.
 
 use std::char;
 use std::fmt;
+use std::iter::FusedIterator;
 use std::slice;
 
 const MAX_UTF8_BYTES: usize = 4;
@@ -156,13 +157,13 @@ impl Utf8Sequence {
     ///
     /// For example, if this corresponds to the following sequence:
     ///
-    /// ```ignore
+    /// ```text
     /// [D0-D3][80-BF]
     /// ```
     ///
     /// Then after reversal, it will be
     ///
-    /// ```ignore
+    /// ```text
     /// [80-BF][D0-D3]
     /// ```
     ///
@@ -295,6 +296,7 @@ impl fmt::Debug for Utf8Range {
 /// illustrative. In practice, you could just try to decode your byte sequence
 /// and compare it with the scalar value range directly. However, this is not
 /// always possible (for example, in a byte based automaton).
+#[derive(Debug)]
 pub struct Utf8Sequences {
     range_stack: Vec,
 }
@@ -388,6 +390,8 @@ impl Iterator for Utf8Sequences {
     }
 }
 
+impl FusedIterator for Utf8Sequences {}
+
 impl ScalarRange {
     /// split splits this range if it overlaps with a surrogate codepoint.
     ///
diff --git a/third_party/cargo/vendor/regex-syntax-0.6.21/test b/third_party/cargo/vendor/regex-syntax-0.6.23/test
similarity index 100%
rename from third_party/cargo/vendor/regex-syntax-0.6.21/test
rename to third_party/cargo/vendor/regex-syntax-0.6.23/test
diff --git a/third_party/cargo/vendor/serde-1.0.118/.cargo-checksum.json b/third_party/cargo/vendor/serde-1.0.118/.cargo-checksum.json
deleted file mode 100644
index 9b2c12c..0000000
--- a/third_party/cargo/vendor/serde-1.0.118/.cargo-checksum.json
+++ /dev/null
@@ -1 +0,0 @@
-{"files":{"Cargo.toml":"4a6098c5140bc095bf8f96fb08b3262ec6939ec3da831ff762a034ff98a017ce","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"5cf9d2158d70048a2916360ad59d9079f6233c6f68781a7a792e70f8b772d8ce","build.rs":"d6af5a05be728765c2d98d960406ba648333745ed8644be311d2a1f52d7075f0","crates-io.md":"25ed421fe25d0f6f74c4b78674144bef2843a5f78bf552d0a8ec633be69d282b","src/de/from_primitive.rs":"058fa17313ed3a9c29ec04c6ec67f21a756f6f28cdeb4b0dfcd7012b3e702d0b","src/de/ignored_any.rs":"6a0527edd497a56a103ae65f5e73da675b3f99094d6dcad3c335c8d932daaf40","src/de/impls.rs":"5972a9c0d9a0e811b543ff3850a402b3adfc5237e62c5db18c5e0f71928ea74e","src/de/mod.rs":"b59c365b05e4e09a7467c958f85b2c64435514c59c17275be019397ad7ccb00e","src/de/utf8.rs":"f17524ee0af98ec3abcfd7d0b812fbd1033263bd8e2ce2f57c1e1999ce153558","src/de/value.rs":"1b58860694b753886b087e20f6afbeea2cb69a1d12b6e72d9934f5649a1ec219","src/export.rs":"2ebdf0eccaa64c5e98c6dfd13b4980474f627fc3fae90cfc2c741acf860afd5d","src/integer128.rs":"b213ec6c1ecf8c8228d9591e0b2c31b78d972cd4c6a0b231468090f15784f6f6","src/lib.rs":"45a70c9c81c0e2cdc8b4c9ed3441a1b605b38e0705cfa3d9fae06bd96614917d","src/macros.rs":"f18fc25c5fb857238bf119cdee5c7987a8584dea69c51f27ca718b7dfd871d0f","src/private/de.rs":"bce814fa2f2fd689c6d4a354839f38d7ea260509339181ce83d9b0fdbe0e1b3b","src/private/macros.rs":"ebb6affd4c89e3b5f9a42e03f8b7d966bc588875e9b44e962d0b7aba7f80a10f","src/private/mod.rs":"f8f2cd5edbfc26c268b34cdb89db1b34e6348f81384f03d18532e7568575006d","src/private/ser.rs":"96a1e23ad7f3c8ee51a02d799d92780e19dd3c18fa0f1ad791abef7cb346e224","src/ser/fmt.rs":"7827ed07fd8897e6324f75625ba0c926a4c4e7ec2914cd067391ce54d942ac7b","src/ser/impls.rs":"496b7ba45529e569ffdf5d755c6df99c1321fddc89b9f64f5cc58e24052caefc","src/ser/impossible.rs":"3dd0e165b88fc67e698e675f16569b91fab9e054caa4c3e1997f929ba364fe90","src/ser/mod.rs":"9c26100d8058a5c39aea72512fb78de959e4ed9199481eef47996f0864df0f2c","src/std_error.rs":"3aac687856c035517fae44ed2906dd4a1e3184bae4bf613adcdeb73f74126c57"},"package":"06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800"}
\ No newline at end of file
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/de/from_primitive.rs b/third_party/cargo/vendor/serde-1.0.118/src/de/from_primitive.rs
deleted file mode 100644
index 544f3f1..0000000
--- a/third_party/cargo/vendor/serde-1.0.118/src/de/from_primitive.rs
+++ /dev/null
@@ -1,260 +0,0 @@
-use lib::*;
-
-macro_rules! int_to_int {
-    ($dst:ident, $n:ident) => {
-        if $dst::min_value() as i64 <= $n as i64 && $n as i64 <= $dst::max_value() as i64 {
-            Some($n as $dst)
-        } else {
-            None
-        }
-    };
-}
-
-macro_rules! int_to_uint {
-    ($dst:ident, $n:ident) => {
-        if 0 <= $n && $n as u64 <= $dst::max_value() as u64 {
-            Some($n as $dst)
-        } else {
-            None
-        }
-    };
-}
-
-macro_rules! uint_to {
-    ($dst:ident, $n:ident) => {
-        if $n as u64 <= $dst::max_value() as u64 {
-            Some($n as $dst)
-        } else {
-            None
-        }
-    };
-}
-
-pub trait FromPrimitive: Sized {
-    fn from_i8(n: i8) -> Option;
-    fn from_i16(n: i16) -> Option;
-    fn from_i32(n: i32) -> Option;
-    fn from_i64(n: i64) -> Option;
-    fn from_u8(n: u8) -> Option;
-    fn from_u16(n: u16) -> Option;
-    fn from_u32(n: u32) -> Option;
-    fn from_u64(n: u64) -> Option;
-}
-
-macro_rules! impl_from_primitive_for_int {
-    ($t:ident) => {
-        impl FromPrimitive for $t {
-            #[inline]
-            fn from_i8(n: i8) -> Option {
-                int_to_int!($t, n)
-            }
-            #[inline]
-            fn from_i16(n: i16) -> Option {
-                int_to_int!($t, n)
-            }
-            #[inline]
-            fn from_i32(n: i32) -> Option {
-                int_to_int!($t, n)
-            }
-            #[inline]
-            fn from_i64(n: i64) -> Option {
-                int_to_int!($t, n)
-            }
-            #[inline]
-            fn from_u8(n: u8) -> Option {
-                uint_to!($t, n)
-            }
-            #[inline]
-            fn from_u16(n: u16) -> Option {
-                uint_to!($t, n)
-            }
-            #[inline]
-            fn from_u32(n: u32) -> Option {
-                uint_to!($t, n)
-            }
-            #[inline]
-            fn from_u64(n: u64) -> Option {
-                uint_to!($t, n)
-            }
-        }
-    };
-}
-
-macro_rules! impl_from_primitive_for_uint {
-    ($t:ident) => {
-        impl FromPrimitive for $t {
-            #[inline]
-            fn from_i8(n: i8) -> Option {
-                int_to_uint!($t, n)
-            }
-            #[inline]
-            fn from_i16(n: i16) -> Option {
-                int_to_uint!($t, n)
-            }
-            #[inline]
-            fn from_i32(n: i32) -> Option {
-                int_to_uint!($t, n)
-            }
-            #[inline]
-            fn from_i64(n: i64) -> Option {
-                int_to_uint!($t, n)
-            }
-            #[inline]
-            fn from_u8(n: u8) -> Option {
-                uint_to!($t, n)
-            }
-            #[inline]
-            fn from_u16(n: u16) -> Option {
-                uint_to!($t, n)
-            }
-            #[inline]
-            fn from_u32(n: u32) -> Option {
-                uint_to!($t, n)
-            }
-            #[inline]
-            fn from_u64(n: u64) -> Option {
-                uint_to!($t, n)
-            }
-        }
-    };
-}
-
-macro_rules! impl_from_primitive_for_float {
-    ($t:ident) => {
-        impl FromPrimitive for $t {
-            #[inline]
-            fn from_i8(n: i8) -> Option {
-                Some(n as Self)
-            }
-            #[inline]
-            fn from_i16(n: i16) -> Option {
-                Some(n as Self)
-            }
-            #[inline]
-            fn from_i32(n: i32) -> Option {
-                Some(n as Self)
-            }
-            #[inline]
-            fn from_i64(n: i64) -> Option {
-                Some(n as Self)
-            }
-            #[inline]
-            fn from_u8(n: u8) -> Option {
-                Some(n as Self)
-            }
-            #[inline]
-            fn from_u16(n: u16) -> Option {
-                Some(n as Self)
-            }
-            #[inline]
-            fn from_u32(n: u32) -> Option {
-                Some(n as Self)
-            }
-            #[inline]
-            fn from_u64(n: u64) -> Option {
-                Some(n as Self)
-            }
-        }
-    };
-}
-
-impl_from_primitive_for_int!(isize);
-impl_from_primitive_for_int!(i8);
-impl_from_primitive_for_int!(i16);
-impl_from_primitive_for_int!(i32);
-impl_from_primitive_for_int!(i64);
-impl_from_primitive_for_uint!(usize);
-impl_from_primitive_for_uint!(u8);
-impl_from_primitive_for_uint!(u16);
-impl_from_primitive_for_uint!(u32);
-impl_from_primitive_for_uint!(u64);
-impl_from_primitive_for_float!(f32);
-impl_from_primitive_for_float!(f64);
-
-serde_if_integer128! {
-    impl FromPrimitive for i128 {
-        #[inline]
-        fn from_i8(n: i8) -> Option {
-            Some(n as i128)
-        }
-        #[inline]
-        fn from_i16(n: i16) -> Option {
-            Some(n as i128)
-        }
-        #[inline]
-        fn from_i32(n: i32) -> Option {
-            Some(n as i128)
-        }
-        #[inline]
-        fn from_i64(n: i64) -> Option {
-            Some(n as i128)
-        }
-        #[inline]
-        fn from_u8(n: u8) -> Option {
-            Some(n as i128)
-        }
-        #[inline]
-        fn from_u16(n: u16) -> Option {
-            Some(n as i128)
-        }
-        #[inline]
-        fn from_u32(n: u32) -> Option {
-            Some(n as i128)
-        }
-        #[inline]
-        fn from_u64(n: u64) -> Option {
-            Some(n as i128)
-        }
-    }
-
-    impl FromPrimitive for u128 {
-        #[inline]
-        fn from_i8(n: i8) -> Option {
-            if n >= 0 {
-                Some(n as u128)
-            } else {
-                None
-            }
-        }
-        #[inline]
-        fn from_i16(n: i16) -> Option {
-            if n >= 0 {
-                Some(n as u128)
-            } else {
-                None
-            }
-        }
-        #[inline]
-        fn from_i32(n: i32) -> Option {
-            if n >= 0 {
-                Some(n as u128)
-            } else {
-                None
-            }
-        }
-        #[inline]
-        fn from_i64(n: i64) -> Option {
-            if n >= 0 {
-                Some(n as u128)
-            } else {
-                None
-            }
-        }
-        #[inline]
-        fn from_u8(n: u8) -> Option {
-            Some(n as u128)
-        }
-        #[inline]
-        fn from_u16(n: u16) -> Option {
-            Some(n as u128)
-        }
-        #[inline]
-        fn from_u32(n: u32) -> Option {
-            Some(n as u128)
-        }
-        #[inline]
-        fn from_u64(n: u64) -> Option {
-            Some(n as u128)
-        }
-    }
-}
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/private/mod.rs b/third_party/cargo/vendor/serde-1.0.118/src/private/mod.rs
deleted file mode 100644
index 79e0a7d..0000000
--- a/third_party/cargo/vendor/serde-1.0.118/src/private/mod.rs
+++ /dev/null
@@ -1,4 +0,0 @@
-mod macros;
-
-pub mod de;
-pub mod ser;
diff --git a/third_party/cargo/vendor/serde-1.0.125/.cargo-checksum.json b/third_party/cargo/vendor/serde-1.0.125/.cargo-checksum.json
new file mode 100644
index 0000000..137a858
--- /dev/null
+++ b/third_party/cargo/vendor/serde-1.0.125/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"4d0bb8ac283d1466067bc7bafb17d0e376450c028203e08d0a27e60d54c42b75","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"5cf9d2158d70048a2916360ad59d9079f6233c6f68781a7a792e70f8b772d8ce","build.rs":"9aa78b1b3432f342b7ae6f34796955ca62eb1604dde7fea2f565ec87ae454828","crates-io.md":"25ed421fe25d0f6f74c4b78674144bef2843a5f78bf552d0a8ec633be69d282b","src/de/ignored_any.rs":"c69d6071191c2075372218442e9e73991335c6b4be18736a7a789f04bb305525","src/de/impls.rs":"8505b47b4fa97e426bedf97082005ee2d5700bfac0da41da9127c9826004c163","src/de/mod.rs":"4db241ed202d418c85fdcee34b70a807269514f8678a3997d52ced96aef85b95","src/de/seed.rs":"e8cf0233afe0af5b8fb9e4c94f301c92729c5ba417280af9e2201b732e374a72","src/de/utf8.rs":"f17524ee0af98ec3abcfd7d0b812fbd1033263bd8e2ce2f57c1e1999ce153558","src/de/value.rs":"82d530d0bc50cba75a095c819b4269d58229a7384043f7f6e674891cc6dae7bb","src/integer128.rs":"12f6ce6a513c1c293398db38cf1d3ea7c0c5a6717152621bcba61f49abc7b5b1","src/lib.rs":"e44065aa4c0721fa86dbf01ef851d8dbcb7064dfed340ea5dbb6a82046999bdc","src/macros.rs":"3d695a51f0a07f9f719dcb5620012c21a1b084c06a6283349cabf574ceba8123","src/private/de.rs":"dd2b988650281e4aa2c89835428417e7aebfa1815cc2bebdbe16678809dd2388","src/private/doc.rs":"e9801a43c3088fccd5f1fac76416698f948e65b647024aa9da17d673e1e8c217","src/private/mod.rs":"67cf4471f6bfd390f0e591a96603b3c434ba2912d8392e3520ec7578b9b42ab3","src/private/ser.rs":"3a90dfb5c17e81bf1d959fed60a9477713498e9d0934463627c98709132f066e","src/private/size_hint.rs":"605521227e9ba3100fbb9d5ea7fd5853385097c35015ce6908bd5f1ea20d59ad","src/ser/fmt.rs":"7827ed07fd8897e6324f75625ba0c926a4c4e7ec2914cd067391ce54d942ac7b","src/ser/impls.rs":"c99000b33b2b7cb1c9b275f769f0cb5dd6ecb3caf260b66f2d0157e6faf04d96","src/ser/impossible.rs":"db17913522c1c27389c5a085113911353b9813c1b116518681362e7c8b692c3a","src/ser/mod.rs":"2ad1f3a41a23d8413affe4f6ab261c7c888ba924c7aada030332d178d7872c98","src/std_error.rs":"3aac687856c035517fae44ed2906dd4a1e3184bae4bf613adcdeb73f74126c57"},"package":"558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171"}
\ No newline at end of file
diff --git a/third_party/cargo/vendor/serde-1.0.118/BUILD.bazel b/third_party/cargo/vendor/serde-1.0.125/BUILD.bazel
similarity index 97%
rename from third_party/cargo/vendor/serde-1.0.118/BUILD.bazel
rename to third_party/cargo/vendor/serde-1.0.125/BUILD.bazel
index f6ee6f9..9d61202 100644
--- a/third_party/cargo/vendor/serde-1.0.118/BUILD.bazel
+++ b/third_party/cargo/vendor/serde-1.0.125/BUILD.bazel
@@ -50,7 +50,7 @@ rust_library(
         "cargo-raze",
         "manual",
     ],
-    version = "1.0.118",
+    version = "1.0.125",
     # buildifier: leave-alone
     deps = [
     ],
diff --git a/third_party/cargo/vendor/serde-1.0.118/Cargo.toml b/third_party/cargo/vendor/serde-1.0.125/Cargo.toml
similarity index 97%
rename from third_party/cargo/vendor/serde-1.0.118/Cargo.toml
rename to third_party/cargo/vendor/serde-1.0.125/Cargo.toml
index 984ecbd..a260341 100644
--- a/third_party/cargo/vendor/serde-1.0.118/Cargo.toml
+++ b/third_party/cargo/vendor/serde-1.0.125/Cargo.toml
@@ -12,7 +12,7 @@
 
 [package]
 name = "serde"
-version = "1.0.118"
+version = "1.0.125"
 authors = ["Erick Tryzelaar ", "David Tolnay "]
 build = "build.rs"
 include = ["build.rs", "src/**/*.rs", "crates-io.md", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
@@ -30,7 +30,7 @@ targets = ["x86_64-unknown-linux-gnu"]
 [package.metadata.playground]
 features = ["derive", "rc"]
 [dependencies.serde_derive]
-version = "=1.0.118"
+version = "=1.0.125"
 optional = true
 [dev-dependencies.serde_derive]
 version = "1.0"
diff --git a/third_party/cargo/vendor/serde-1.0.118/LICENSE-APACHE b/third_party/cargo/vendor/serde-1.0.125/LICENSE-APACHE
similarity index 100%
rename from third_party/cargo/vendor/serde-1.0.118/LICENSE-APACHE
rename to third_party/cargo/vendor/serde-1.0.125/LICENSE-APACHE
diff --git a/third_party/cargo/vendor/once_cell-1.5.2/LICENSE-MIT b/third_party/cargo/vendor/serde-1.0.125/LICENSE-MIT
similarity index 100%
rename from third_party/cargo/vendor/once_cell-1.5.2/LICENSE-MIT
rename to third_party/cargo/vendor/serde-1.0.125/LICENSE-MIT
diff --git a/third_party/cargo/vendor/serde-1.0.118/README.md b/third_party/cargo/vendor/serde-1.0.125/README.md
similarity index 100%
rename from third_party/cargo/vendor/serde-1.0.118/README.md
rename to third_party/cargo/vendor/serde-1.0.125/README.md
diff --git a/third_party/cargo/vendor/serde-1.0.118/build.rs b/third_party/cargo/vendor/serde-1.0.125/build.rs
similarity index 93%
rename from third_party/cargo/vendor/serde-1.0.118/build.rs
rename to third_party/cargo/vendor/serde-1.0.125/build.rs
index 6137608..afda291 100644
--- a/third_party/cargo/vendor/serde-1.0.118/build.rs
+++ b/third_party/cargo/vendor/serde-1.0.125/build.rs
@@ -71,12 +71,19 @@ fn main() {
         println!("cargo:rustc-cfg=num_nonzero");
     }
 
-    // TryFrom, Atomic types, and non-zero signed integers stabilized in Rust 1.34:
+    // Current minimum supported version of serde_derive crate is Rust 1.31.
+    if minor >= 31 {
+        println!("cargo:rustc-cfg=serde_derive");
+    }
+
+    // TryFrom, Atomic types, non-zero signed integers, and SystemTime::checked_add
+    // stabilized in Rust 1.34:
     // https://blog.rust-lang.org/2019/04/11/Rust-1.34.0.html#tryfrom-and-tryinto
     // https://blog.rust-lang.org/2019/04/11/Rust-1.34.0.html#library-stabilizations
     if minor >= 34 {
         println!("cargo:rustc-cfg=core_try_from");
         println!("cargo:rustc-cfg=num_nonzero_signed");
+        println!("cargo:rustc-cfg=systemtime_checked_add");
 
         // Whitelist of archs that support std::sync::atomic module. Ideally we
         // would use #[cfg(target_has_atomic = "...")] but it is not stable yet.
diff --git a/third_party/cargo/vendor/serde-1.0.118/crates-io.md b/third_party/cargo/vendor/serde-1.0.125/crates-io.md
similarity index 100%
rename from third_party/cargo/vendor/serde-1.0.118/crates-io.md
rename to third_party/cargo/vendor/serde-1.0.125/crates-io.md
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/de/ignored_any.rs b/third_party/cargo/vendor/serde-1.0.125/src/de/ignored_any.rs
similarity index 94%
rename from third_party/cargo/vendor/serde-1.0.118/src/de/ignored_any.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/de/ignored_any.rs
index 68a644e..1d50f5e 100644
--- a/third_party/cargo/vendor/serde-1.0.118/src/de/ignored_any.rs
+++ b/third_party/cargo/vendor/serde-1.0.125/src/de/ignored_any.rs
@@ -130,12 +130,28 @@ impl<'de> Visitor<'de> for IgnoredAny {
         Ok(IgnoredAny)
     }
 
+    serde_if_integer128! {
+        #[inline]
+        fn visit_i128(self, x: i128) -> Result {
+            let _ = x;
+            Ok(IgnoredAny)
+        }
+    }
+
     #[inline]
     fn visit_u64(self, x: u64) -> Result {
         let _ = x;
         Ok(IgnoredAny)
     }
 
+    serde_if_integer128! {
+        #[inline]
+        fn visit_u128(self, x: u128) -> Result {
+            let _ = x;
+            Ok(IgnoredAny)
+        }
+    }
+
     #[inline]
     fn visit_f64(self, x: f64) -> Result {
         let _ = x;
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/de/impls.rs b/third_party/cargo/vendor/serde-1.0.125/src/de/impls.rs
similarity index 89%
rename from third_party/cargo/vendor/serde-1.0.118/src/de/impls.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/de/impls.rs
index d9af210..59d90d2 100644
--- a/third_party/cargo/vendor/serde-1.0.118/src/de/impls.rs
+++ b/third_party/cargo/vendor/serde-1.0.125/src/de/impls.rs
@@ -7,11 +7,10 @@ use de::{
 #[cfg(any(core_duration, feature = "std", feature = "alloc"))]
 use de::MapAccess;
 
-use de::from_primitive::FromPrimitive;
-use private::de::InPlaceSeed;
+use seed::InPlaceSeed;
 
 #[cfg(any(feature = "std", feature = "alloc"))]
-use private::de::size_hint;
+use __private::size_hint;
 
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -81,38 +80,8 @@ impl<'de> Deserialize<'de> for bool {
 
 ////////////////////////////////////////////////////////////////////////////////
 
-macro_rules! visit_integer_method {
-    ($src_ty:ident, $method:ident, $from_method:ident, $group:ident, $group_ty:ident) => {
-        #[inline]
-        fn $method(self, v: $src_ty) -> Result
-        where
-            E: Error,
-        {
-            match FromPrimitive::$from_method(v) {
-                Some(v) => Ok(v),
-                None => Err(Error::invalid_value(
-                    Unexpected::$group(v as $group_ty),
-                    &self,
-                )),
-            }
-        }
-    };
-}
-
-macro_rules! visit_float_method {
-    ($src_ty:ident, $method:ident) => {
-        #[inline]
-        fn $method(self, v: $src_ty) -> Result
-        where
-            E: Error,
-        {
-            Ok(v as Self::Value)
-        }
-    };
-}
-
 macro_rules! impl_deserialize_num {
-    ($ty:ident, $method:ident, $($visit:ident),*) => {
+    ($ty:ident, $deserialize:ident $($methods:tt)*) => {
         impl<'de> Deserialize<'de> for $ty {
             #[inline]
             fn deserialize(deserializer: D) -> Result
@@ -128,131 +97,221 @@ macro_rules! impl_deserialize_num {
                         formatter.write_str(stringify!($ty))
                     }
 
-                    $(
-                        impl_deserialize_num!($visit $ty);
-                    )*
+                    $($methods)*
                 }
 
-                deserializer.$method(PrimitiveVisitor)
+                deserializer.$deserialize(PrimitiveVisitor)
             }
         }
     };
-
-    (integer $ty:ident) => {
-        visit_integer_method!(i8, visit_i8, from_i8, Signed, i64);
-        visit_integer_method!(i16, visit_i16, from_i16, Signed, i64);
-        visit_integer_method!(i32, visit_i32, from_i32, Signed, i64);
-        visit_integer_method!(i64, visit_i64, from_i64, Signed, i64);
-
-        visit_integer_method!(u8, visit_u8, from_u8, Unsigned, u64);
-        visit_integer_method!(u16, visit_u16, from_u16, Unsigned, u64);
-        visit_integer_method!(u32, visit_u32, from_u32, Unsigned, u64);
-        visit_integer_method!(u64, visit_u64, from_u64, Unsigned, u64);
-    };
-
-    (float $ty:ident) => {
-        visit_float_method!(f32, visit_f32);
-        visit_float_method!(f64, visit_f64);
-    };
 }
 
-impl_deserialize_num!(i8, deserialize_i8, integer);
-impl_deserialize_num!(i16, deserialize_i16, integer);
-impl_deserialize_num!(i32, deserialize_i32, integer);
-impl_deserialize_num!(i64, deserialize_i64, integer);
-impl_deserialize_num!(isize, deserialize_i64, integer);
-
-impl_deserialize_num!(u8, deserialize_u8, integer);
-impl_deserialize_num!(u16, deserialize_u16, integer);
-impl_deserialize_num!(u32, deserialize_u32, integer);
-impl_deserialize_num!(u64, deserialize_u64, integer);
-impl_deserialize_num!(usize, deserialize_u64, integer);
-
-impl_deserialize_num!(f32, deserialize_f32, integer, float);
-impl_deserialize_num!(f64, deserialize_f64, integer, float);
-
-serde_if_integer128! {
-    impl<'de> Deserialize<'de> for i128 {
+macro_rules! num_self {
+    ($ty:ident : $visit:ident) => {
         #[inline]
-        fn deserialize(deserializer: D) -> Result
+        fn $visit(self, v: $ty) -> Result
         where
-            D: Deserializer<'de>,
+            E: Error,
         {
-            struct PrimitiveVisitor;
+            Ok(v)
+        }
+    };
+}
 
-            impl<'de> Visitor<'de> for PrimitiveVisitor {
-                type Value = i128;
+macro_rules! num_as_self {
+    ($($ty:ident : $visit:ident)*) => {
+        $(
+            #[inline]
+            fn $visit(self, v: $ty) -> Result
+            where
+                E: Error,
+            {
+                Ok(v as Self::Value)
+            }
+        )*
+    };
+}
 
-                fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-                    formatter.write_str("i128")
-                }
-
-                impl_deserialize_num!(integer i128);
-
-                #[inline]
-                fn visit_i128(self, v: i128) -> Result
-                where
-                    E: Error,
-                {
-                    Ok(v)
-                }
-
-                #[inline]
-                fn visit_u128(self, v: u128) -> Result
-                where
-                    E: Error,
-                {
-                    if v <= i128::max_value() as u128 {
-                        Ok(v as i128)
-                    } else {
-                        Err(Error::invalid_value(Unexpected::Other("u128"), &self))
-                    }
+macro_rules! int_to_int {
+    ($($ty:ident : $visit:ident)*) => {
+        $(
+            #[inline]
+            fn $visit(self, v: $ty) -> Result
+            where
+                E: Error,
+            {
+                if Self::Value::min_value() as i64 <= v as i64 && v as i64 <= Self::Value::max_value() as i64 {
+                    Ok(v as Self::Value)
+                } else {
+                    Err(Error::invalid_value(Unexpected::Signed(v as i64), &self))
                 }
             }
+        )*
+    };
+}
 
-            deserializer.deserialize_i128(PrimitiveVisitor)
+macro_rules! int_to_uint {
+    ($($ty:ident : $visit:ident)*) => {
+        $(
+            #[inline]
+            fn $visit(self, v: $ty) -> Result
+            where
+                E: Error,
+            {
+                if 0 <= v && v as u64 <= Self::Value::max_value() as u64 {
+                    Ok(v as Self::Value)
+                } else {
+                    Err(Error::invalid_value(Unexpected::Signed(v as i64), &self))
+                }
+            }
+        )*
+    };
+}
+
+macro_rules! uint_to_self {
+    ($($ty:ident : $visit:ident)*) => {
+        $(
+            #[inline]
+            fn $visit(self, v: $ty) -> Result
+            where
+                E: Error,
+            {
+                if v as u64 <= Self::Value::max_value() as u64 {
+                    Ok(v as Self::Value)
+                } else {
+                    Err(Error::invalid_value(Unexpected::Unsigned(v as u64), &self))
+                }
+            }
+        )*
+    };
+}
+
+impl_deserialize_num! {
+    i8, deserialize_i8
+    num_self!(i8:visit_i8);
+    int_to_int!(i16:visit_i16 i32:visit_i32 i64:visit_i64);
+    uint_to_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);
+}
+
+impl_deserialize_num! {
+    i16, deserialize_i16
+    num_self!(i16:visit_i16);
+    num_as_self!(i8:visit_i8);
+    int_to_int!(i32:visit_i32 i64:visit_i64);
+    uint_to_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);
+}
+
+impl_deserialize_num! {
+    i32, deserialize_i32
+    num_self!(i32:visit_i32);
+    num_as_self!(i8:visit_i8 i16:visit_i16);
+    int_to_int!(i64:visit_i64);
+    uint_to_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);
+}
+
+impl_deserialize_num! {
+    i64, deserialize_i64
+    num_self!(i64:visit_i64);
+    num_as_self!(i8:visit_i8 i16:visit_i16 i32:visit_i32);
+    uint_to_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);
+}
+
+impl_deserialize_num! {
+    isize, deserialize_i64
+    num_as_self!(i8:visit_i8 i16:visit_i16);
+    int_to_int!(i32:visit_i32 i64:visit_i64);
+    uint_to_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);
+}
+
+impl_deserialize_num! {
+    u8, deserialize_u8
+    num_self!(u8:visit_u8);
+    int_to_uint!(i8:visit_i8 i16:visit_i16 i32:visit_i32 i64:visit_i64);
+    uint_to_self!(u16:visit_u16 u32:visit_u32 u64:visit_u64);
+}
+
+impl_deserialize_num! {
+    u16, deserialize_u16
+    num_self!(u16:visit_u16);
+    num_as_self!(u8:visit_u8);
+    int_to_uint!(i8:visit_i8 i16:visit_i16 i32:visit_i32 i64:visit_i64);
+    uint_to_self!(u32:visit_u32 u64:visit_u64);
+}
+
+impl_deserialize_num! {
+    u32, deserialize_u32
+    num_self!(u32:visit_u32);
+    num_as_self!(u8:visit_u8 u16:visit_u16);
+    int_to_uint!(i8:visit_i8 i16:visit_i16 i32:visit_i32 i64:visit_i64);
+    uint_to_self!(u64:visit_u64);
+}
+
+impl_deserialize_num! {
+    u64, deserialize_u64
+    num_self!(u64:visit_u64);
+    num_as_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32);
+    int_to_uint!(i8:visit_i8 i16:visit_i16 i32:visit_i32 i64:visit_i64);
+}
+
+impl_deserialize_num! {
+    usize, deserialize_u64
+    num_as_self!(u8:visit_u8 u16:visit_u16);
+    int_to_uint!(i8:visit_i8 i16:visit_i16 i32:visit_i32 i64:visit_i64);
+    uint_to_self!(u32:visit_u32 u64:visit_u64);
+}
+
+impl_deserialize_num! {
+    f32, deserialize_f32
+    num_self!(f32:visit_f32);
+    num_as_self!(f64:visit_f64);
+    num_as_self!(i8:visit_i8 i16:visit_i16 i32:visit_i32 i64:visit_i64);
+    num_as_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);
+}
+
+impl_deserialize_num! {
+    f64, deserialize_f64
+    num_self!(f64:visit_f64);
+    num_as_self!(f32:visit_f32);
+    num_as_self!(i8:visit_i8 i16:visit_i16 i32:visit_i32 i64:visit_i64);
+    num_as_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);
+}
+
+serde_if_integer128! {
+    impl_deserialize_num! {
+        i128, deserialize_i128
+        num_self!(i128:visit_i128);
+        num_as_self!(i8:visit_i8 i16:visit_i16 i32:visit_i32 i64:visit_i64);
+        num_as_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);
+
+        #[inline]
+        fn visit_u128(self, v: u128) -> Result
+        where
+            E: Error,
+        {
+            if v <= i128::max_value() as u128 {
+                Ok(v as i128)
+            } else {
+                Err(Error::invalid_value(Unexpected::Other("u128"), &self))
+            }
         }
     }
 
-    impl<'de> Deserialize<'de> for u128 {
+    impl_deserialize_num! {
+        u128, deserialize_u128
+        num_self!(u128:visit_u128);
+        num_as_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);
+        int_to_uint!(i8:visit_i8 i16:visit_i16 i32:visit_i32 i64:visit_i64);
+
         #[inline]
-        fn deserialize(deserializer: D) -> Result
+        fn visit_i128(self, v: i128) -> Result
         where
-            D: Deserializer<'de>,
+            E: Error,
         {
-            struct PrimitiveVisitor;
-
-            impl<'de> Visitor<'de> for PrimitiveVisitor {
-                type Value = u128;
-
-                fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-                    formatter.write_str("u128")
-                }
-
-                impl_deserialize_num!(integer u128);
-
-                #[inline]
-                fn visit_i128(self, v: i128) -> Result
-                where
-                    E: Error,
-                {
-                    if v >= 0 {
-                        Ok(v as u128)
-                    } else {
-                        Err(Error::invalid_value(Unexpected::Other("i128"), &self))
-                    }
-                }
-
-                #[inline]
-                fn visit_u128(self, v: u128) -> Result
-                where
-                    E: Error,
-                {
-                    Ok(v)
-                }
+            if 0 <= v {
+                Ok(v as u128)
+            } else {
+                Err(Error::invalid_value(Unexpected::Other("i128"), &self))
             }
-
-            deserializer.deserialize_u128(PrimitiveVisitor)
         }
     }
 }
@@ -1260,24 +1319,7 @@ macro_rules! parse_ip_impl {
                 D: Deserializer<'de>,
             {
                 if deserializer.is_human_readable() {
-                    struct IpAddrVisitor;
-
-                    impl<'de> Visitor<'de> for IpAddrVisitor {
-                        type Value = $ty;
-
-                        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-                            formatter.write_str($expecting)
-                        }
-
-                        fn visit_str(self, s: &str) -> Result
-                        where
-                            E: Error,
-                        {
-                            s.parse().map_err(Error::custom)
-                        }
-                    }
-
-                    deserializer.deserialize_str(IpAddrVisitor)
+                    deserializer.deserialize_str(FromStrVisitor::new($expecting))
                 } else {
                     <[u8; $size]>::deserialize(deserializer).map(<$ty>::from)
                 }
@@ -1405,24 +1447,7 @@ impl<'de> Deserialize<'de> for net::IpAddr {
         D: Deserializer<'de>,
     {
         if deserializer.is_human_readable() {
-            struct IpAddrVisitor;
-
-            impl<'de> Visitor<'de> for IpAddrVisitor {
-                type Value = net::IpAddr;
-
-                fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-                    formatter.write_str("IP address")
-                }
-
-                fn visit_str(self, s: &str) -> Result
-                where
-                    E: Error,
-                {
-                    s.parse().map_err(Error::custom)
-                }
-            }
-
-            deserializer.deserialize_str(IpAddrVisitor)
+            deserializer.deserialize_str(FromStrVisitor::new("IP address"))
         } else {
             use lib::net::IpAddr;
             deserialize_enum! {
@@ -1449,24 +1474,7 @@ macro_rules! parse_socket_impl {
                 D: Deserializer<'de>,
             {
                 if deserializer.is_human_readable() {
-                    struct SocketAddrVisitor;
-
-                    impl<'de> Visitor<'de> for SocketAddrVisitor {
-                        type Value = $ty;
-
-                        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-                            formatter.write_str($expecting)
-                        }
-
-                        fn visit_str(self, s: &str) -> Result
-                        where
-                            E: Error,
-                        {
-                            s.parse().map_err(Error::custom)
-                        }
-                    }
-
-                    deserializer.deserialize_str(SocketAddrVisitor)
+                    deserializer.deserialize_str(FromStrVisitor::new($expecting))
                 } else {
                     <(_, u16)>::deserialize(deserializer).map(|(ip, port)| $new(ip, port))
                 }
@@ -1482,24 +1490,7 @@ impl<'de> Deserialize<'de> for net::SocketAddr {
         D: Deserializer<'de>,
     {
         if deserializer.is_human_readable() {
-            struct SocketAddrVisitor;
-
-            impl<'de> Visitor<'de> for SocketAddrVisitor {
-                type Value = net::SocketAddr;
-
-                fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-                    formatter.write_str("socket address")
-                }
-
-                fn visit_str(self, s: &str) -> Result
-                where
-                    E: Error,
-                {
-                    s.parse().map_err(Error::custom)
-                }
-            }
-
-            deserializer.deserialize_str(SocketAddrVisitor)
+            deserializer.deserialize_str(FromStrVisitor::new("socket address"))
         } else {
             use lib::net::SocketAddr;
             deserialize_enum! {
@@ -1906,7 +1897,7 @@ impl<'de> Deserialize<'de> for Duration {
                             b"secs" => Ok(Field::Secs),
                             b"nanos" => Ok(Field::Nanos),
                             _ => {
-                                let value = ::export::from_utf8_lossy(value);
+                                let value = ::__private::from_utf8_lossy(value);
                                 Err(Error::unknown_field(&value, FIELDS))
                             }
                         }
@@ -1917,6 +1908,17 @@ impl<'de> Deserialize<'de> for Duration {
             }
         }
 
+        fn check_overflow(secs: u64, nanos: u32) -> Result<(), E>
+        where
+            E: Error,
+        {
+            static NANOS_PER_SEC: u32 = 1_000_000_000;
+            match secs.checked_add((nanos / NANOS_PER_SEC) as u64) {
+                Some(_) => Ok(()),
+                None => Err(E::custom("overflow deserializing Duration")),
+            }
+        }
+
         struct DurationVisitor;
 
         impl<'de> Visitor<'de> for DurationVisitor {
@@ -1942,6 +1944,7 @@ impl<'de> Deserialize<'de> for Duration {
                         return Err(Error::invalid_length(1, &self));
                     }
                 };
+                try!(check_overflow(secs, nanos));
                 Ok(Duration::new(secs, nanos))
             }
 
@@ -1975,6 +1978,7 @@ impl<'de> Deserialize<'de> for Duration {
                     Some(nanos) => nanos,
                     None => return Err(::missing_field("nanos")),
                 };
+                try!(check_overflow(secs, nanos));
                 Ok(Duration::new(secs, nanos))
             }
         }
@@ -2042,6 +2046,17 @@ impl<'de> Deserialize<'de> for SystemTime {
             }
         }
 
+        fn check_overflow(secs: u64, nanos: u32) -> Result<(), E>
+        where
+            E: Error,
+        {
+            static NANOS_PER_SEC: u32 = 1_000_000_000;
+            match secs.checked_add((nanos / NANOS_PER_SEC) as u64) {
+                Some(_) => Ok(()),
+                None => Err(E::custom("overflow deserializing SystemTime epoch offset")),
+            }
+        }
+
         struct DurationVisitor;
 
         impl<'de> Visitor<'de> for DurationVisitor {
@@ -2067,6 +2082,7 @@ impl<'de> Deserialize<'de> for SystemTime {
                         return Err(Error::invalid_length(1, &self));
                     }
                 };
+                try!(check_overflow(secs, nanos));
                 Ok(Duration::new(secs, nanos))
             }
 
@@ -2104,13 +2120,20 @@ impl<'de> Deserialize<'de> for SystemTime {
                     Some(nanos) => nanos,
                     None => return Err(::missing_field("nanos_since_epoch")),
                 };
+                try!(check_overflow(secs, nanos));
                 Ok(Duration::new(secs, nanos))
             }
         }
 
         const FIELDS: &'static [&'static str] = &["secs_since_epoch", "nanos_since_epoch"];
         let duration = try!(deserializer.deserialize_struct("SystemTime", FIELDS, DurationVisitor));
-        Ok(UNIX_EPOCH + duration)
+        #[cfg(systemtime_checked_add)]
+        let ret = UNIX_EPOCH
+            .checked_add(duration)
+            .ok_or_else(|| D::Error::custom("overflow deserializing SystemTime"));
+        #[cfg(not(systemtime_checked_add))]
+        let ret = Ok(UNIX_EPOCH + duration);
+        ret
     }
 }
 
@@ -2214,7 +2237,7 @@ mod range {
                         b"start" => Ok(Field::Start),
                         b"end" => Ok(Field::End),
                         _ => {
-                            let value = ::export::from_utf8_lossy(value);
+                            let value = ::__private::from_utf8_lossy(value);
                             Err(Error::unknown_field(&value, FIELDS))
                         }
                     }
@@ -2603,3 +2626,39 @@ atomic_impl! {
 atomic_impl! {
     AtomicI64 AtomicU64
 }
+
+#[cfg(feature = "std")]
+struct FromStrVisitor {
+    expecting: &'static str,
+    ty: PhantomData,
+}
+
+#[cfg(feature = "std")]
+impl FromStrVisitor {
+    fn new(expecting: &'static str) -> Self {
+        FromStrVisitor {
+            expecting: expecting,
+            ty: PhantomData,
+        }
+    }
+}
+
+#[cfg(feature = "std")]
+impl<'de, T> Visitor<'de> for FromStrVisitor
+where
+    T: str::FromStr,
+    T::Err: fmt::Display,
+{
+    type Value = T;
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str(self.expecting)
+    }
+
+    fn visit_str(self, s: &str) -> Result
+    where
+        E: Error,
+    {
+        s.parse().map_err(Error::custom)
+    }
+}
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/de/mod.rs b/third_party/cargo/vendor/serde-1.0.125/src/de/mod.rs
similarity index 99%
rename from third_party/cargo/vendor/serde-1.0.118/src/de/mod.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/de/mod.rs
index 6d39473..1ed7b4f 100644
--- a/third_party/cargo/vendor/serde-1.0.118/src/de/mod.rs
+++ b/third_party/cargo/vendor/serde-1.0.125/src/de/mod.rs
@@ -118,7 +118,6 @@ use lib::*;
 
 pub mod value;
 
-mod from_primitive;
 mod ignored_any;
 mod impls;
 mod utf8;
@@ -393,7 +392,7 @@ pub enum Unexpected<'a> {
 }
 
 impl<'a> fmt::Display for Unexpected<'a> {
-    fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
         use self::Unexpected::*;
         match *self {
             Bool(b) => write!(formatter, "boolean `{}`", b),
diff --git a/third_party/cargo/vendor/serde-1.0.125/src/de/seed.rs b/third_party/cargo/vendor/serde-1.0.125/src/de/seed.rs
new file mode 100644
index 0000000..13b7ea4
--- /dev/null
+++ b/third_party/cargo/vendor/serde-1.0.125/src/de/seed.rs
@@ -0,0 +1,19 @@
+use de::{Deserialize, DeserializeSeed, Deserializer};
+
+/// A DeserializeSeed helper for implementing deserialize_in_place Visitors.
+///
+/// Wraps a mutable reference and calls deserialize_in_place on it.
+pub struct InPlaceSeed<'a, T: 'a>(pub &'a mut T);
+
+impl<'a, 'de, T> DeserializeSeed<'de> for InPlaceSeed<'a, T>
+where
+    T: Deserialize<'de>,
+{
+    type Value = ();
+    fn deserialize(self, deserializer: D) -> Result
+    where
+        D: Deserializer<'de>,
+    {
+        T::deserialize_in_place(deserializer, self.0)
+    }
+}
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/de/utf8.rs b/third_party/cargo/vendor/serde-1.0.125/src/de/utf8.rs
similarity index 100%
rename from third_party/cargo/vendor/serde-1.0.118/src/de/utf8.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/de/utf8.rs
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/de/value.rs b/third_party/cargo/vendor/serde-1.0.125/src/de/value.rs
similarity index 88%
rename from third_party/cargo/vendor/serde-1.0.118/src/de/value.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/de/value.rs
index 4044f32..1b154c3 100644
--- a/third_party/cargo/vendor/serde-1.0.118/src/de/value.rs
+++ b/third_party/cargo/vendor/serde-1.0.125/src/de/value.rs
@@ -24,8 +24,8 @@
 use lib::*;
 
 use self::private::{First, Second};
-use de::{self, Expected, IntoDeserializer, SeqAccess};
-use private::de::size_hint;
+use __private::size_hint;
+use de::{self, Deserializer, Expected, IntoDeserializer, SeqAccess, Visitor};
 use ser;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -48,7 +48,7 @@ macro_rules! impl_copy_clone {
 
 /// A minimal representation of all possible errors that can occur using the
 /// `IntoDeserializer` trait.
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, PartialEq)]
 pub struct Error {
     err: ErrorImpl,
 }
@@ -93,16 +93,25 @@ impl ser::Error for Error {
 
 impl Display for Error {
     #[cfg(any(feature = "std", feature = "alloc"))]
-    fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
         formatter.write_str(&self.err)
     }
 
     #[cfg(not(any(feature = "std", feature = "alloc")))]
-    fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
         formatter.write_str("Serde deserialization error")
     }
 }
 
+impl Debug for Error {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = formatter.debug_tuple("Error");
+        #[cfg(any(feature = "std", feature = "alloc"))]
+        debug.field(&self.err);
+        debug.finish()
+    }
+}
+
 #[cfg(feature = "std")]
 impl error::Error for Error {
     fn description(&self) -> &str {
@@ -126,7 +135,6 @@ where
 }
 
 /// A deserializer holding a `()`.
-#[derive(Debug)]
 pub struct UnitDeserializer {
     marker: PhantomData,
 }
@@ -160,6 +168,12 @@ where
     }
 }
 
+impl Debug for UnitDeserializer {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.debug_struct("UnitDeserializer").finish()
+    }
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 
 /// A deserializer that cannot be instantiated.
@@ -208,7 +222,6 @@ macro_rules! primitive_deserializer {
     ($ty:ty, $doc:tt, $name:ident, $method:ident $($cast:tt)*) => {
         #[doc = "A deserializer holding"]
         #[doc = $doc]
-        #[derive(Debug)]
         pub struct $name {
             value: $ty,
             marker: PhantomData
@@ -249,6 +262,15 @@ macro_rules! primitive_deserializer {
                 visitor.$method(self.value $($cast)*)
             }
         }
+
+        impl Debug for $name {
+            fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                formatter
+                    .debug_struct(stringify!($name))
+                    .field("value", &self.value)
+                    .finish()
+            }
+        }
     }
 }
 
@@ -272,7 +294,6 @@ serde_if_integer128! {
 }
 
 /// A deserializer holding a `u32`.
-#[derive(Debug)]
 pub struct U32Deserializer {
     value: u32,
     marker: PhantomData,
@@ -343,10 +364,18 @@ where
     }
 }
 
+impl Debug for U32Deserializer {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter
+            .debug_struct("U32Deserializer")
+            .field("value", &self.value)
+            .finish()
+    }
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 
 /// A deserializer holding a `&str`.
-#[derive(Debug)]
 pub struct StrDeserializer<'a, E> {
     value: &'a str,
     marker: PhantomData,
@@ -417,11 +446,19 @@ where
     }
 }
 
+impl<'a, E> Debug for StrDeserializer<'a, E> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter
+            .debug_struct("StrDeserializer")
+            .field("value", &self.value)
+            .finish()
+    }
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 
 /// A deserializer holding a `&str` with a lifetime tied to another
 /// deserializer.
-#[derive(Debug)]
 pub struct BorrowedStrDeserializer<'de, E> {
     value: &'de str,
     marker: PhantomData,
@@ -488,11 +525,19 @@ where
     }
 }
 
+impl<'de, E> Debug for BorrowedStrDeserializer<'de, E> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter
+            .debug_struct("BorrowedStrDeserializer")
+            .field("value", &self.value)
+            .finish()
+    }
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 
 /// A deserializer holding a `String`.
 #[cfg(any(feature = "std", feature = "alloc"))]
-#[derive(Debug)]
 pub struct StringDeserializer {
     value: String,
     marker: PhantomData,
@@ -574,11 +619,20 @@ where
     }
 }
 
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl Debug for StringDeserializer {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter
+            .debug_struct("StringDeserializer")
+            .field("value", &self.value)
+            .finish()
+    }
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 
 /// A deserializer holding a `Cow`.
 #[cfg(any(feature = "std", feature = "alloc"))]
-#[derive(Debug)]
 pub struct CowStrDeserializer<'a, E> {
     value: Cow<'a, str>,
     marker: PhantomData,
@@ -663,29 +717,48 @@ where
     }
 }
 
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, E> Debug for CowStrDeserializer<'a, E> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter
+            .debug_struct("CowStrDeserializer")
+            .field("value", &self.value)
+            .finish()
+    }
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 
-/// A deserializer holding a `&[u8]` with a lifetime tied to another
-/// deserializer.
-#[derive(Debug)]
-pub struct BorrowedBytesDeserializer<'de, E> {
-    value: &'de [u8],
+/// A deserializer holding a `&[u8]`. Always calls [`Visitor::visit_bytes`].
+pub struct BytesDeserializer<'a, E> {
+    value: &'a [u8],
     marker: PhantomData,
 }
 
-impl_copy_clone!(BorrowedBytesDeserializer<'de>);
-
-impl<'de, E> BorrowedBytesDeserializer<'de, E> {
-    /// Create a new borrowed deserializer from the given byte slice.
-    pub fn new(value: &'de [u8]) -> BorrowedBytesDeserializer<'de, E> {
-        BorrowedBytesDeserializer {
+impl<'a, E> BytesDeserializer<'a, E> {
+    /// Create a new deserializer from the given bytes.
+    pub fn new(value: &'a [u8]) -> Self {
+        BytesDeserializer {
             value: value,
             marker: PhantomData,
         }
     }
 }
 
-impl<'de, E> de::Deserializer<'de> for BorrowedBytesDeserializer<'de, E>
+impl_copy_clone!(BytesDeserializer<'a>);
+
+impl<'de, 'a, E> IntoDeserializer<'de, E> for &'a [u8]
+where
+    E: de::Error,
+{
+    type Deserializer = BytesDeserializer<'a, E>;
+
+    fn into_deserializer(self) -> BytesDeserializer<'a, E> {
+        BytesDeserializer::new(self)
+    }
+}
+
+impl<'de, 'a, E> Deserializer<'de> for BytesDeserializer<'a, E>
 where
     E: de::Error,
 {
@@ -693,7 +766,55 @@ where
 
     fn deserialize_any(self, visitor: V) -> Result
     where
-        V: de::Visitor<'de>,
+        V: Visitor<'de>,
+    {
+        visitor.visit_bytes(self.value)
+    }
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct enum identifier ignored_any
+    }
+}
+
+impl<'a, E> Debug for BytesDeserializer<'a, E> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter
+            .debug_struct("BytesDeserializer")
+            .field("value", &self.value)
+            .finish()
+    }
+}
+
+/// A deserializer holding a `&[u8]` with a lifetime tied to another
+/// deserializer. Always calls [`Visitor::visit_borrowed_bytes`].
+pub struct BorrowedBytesDeserializer<'de, E> {
+    value: &'de [u8],
+    marker: PhantomData,
+}
+
+impl<'de, E> BorrowedBytesDeserializer<'de, E> {
+    /// Create a new borrowed deserializer from the given borrowed bytes.
+    pub fn new(value: &'de [u8]) -> Self {
+        BorrowedBytesDeserializer {
+            value: value,
+            marker: PhantomData,
+        }
+    }
+}
+
+impl_copy_clone!(BorrowedBytesDeserializer<'de>);
+
+impl<'de, E> Deserializer<'de> for BorrowedBytesDeserializer<'de, E>
+where
+    E: de::Error,
+{
+    type Error = E;
+
+    fn deserialize_any(self, visitor: V) -> Result
+    where
+        V: Visitor<'de>,
     {
         visitor.visit_borrowed_bytes(self.value)
     }
@@ -701,14 +822,23 @@ where
     forward_to_deserialize_any! {
         bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
         bytes byte_buf option unit unit_struct newtype_struct seq tuple
-        tuple_struct map struct identifier ignored_any enum
+        tuple_struct map struct enum identifier ignored_any
+    }
+}
+
+impl<'de, E> Debug for BorrowedBytesDeserializer<'de, E> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter
+            .debug_struct("BorrowedBytesDeserializer")
+            .field("value", &self.value)
+            .finish()
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 /// A deserializer that iterates over a sequence.
-#[derive(Clone, Debug)]
+#[derive(Clone)]
 pub struct SeqDeserializer {
     iter: iter::Fuse,
     count: usize,
@@ -813,6 +943,19 @@ impl Expected for ExpectedInSeq {
     }
 }
 
+impl Debug for SeqDeserializer
+where
+    I: Debug,
+{
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter
+            .debug_struct("SeqDeserializer")
+            .field("iter", &self.iter)
+            .field("count", &self.count)
+            .finish()
+    }
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 
 #[cfg(any(feature = "std", feature = "alloc"))]
@@ -1108,7 +1251,6 @@ where
     }
 }
 
-// Cannot #[derive(Debug)] because of the bound `Second: Debug`.
 impl<'de, I, E> Debug for MapDeserializer<'de, I, E>
 where
     I: Iterator + Debug,
@@ -1121,8 +1263,6 @@ where
             .field("iter", &self.iter)
             .field("value", &self.value)
             .field("count", &self.count)
-            .field("lifetime", &self.lifetime)
-            .field("error", &self.error)
             .finish()
     }
 }
@@ -1331,7 +1471,6 @@ mod private {
 
     use de::{self, DeserializeSeed, Deserializer, MapAccess, Unexpected, VariantAccess, Visitor};
 
-    #[derive(Clone, Debug)]
     pub struct UnitOnly {
         marker: PhantomData,
     }
@@ -1390,7 +1529,6 @@ mod private {
         }
     }
 
-    #[derive(Clone, Debug)]
     pub struct MapAsEnum {
         map: A,
     }
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/integer128.rs b/third_party/cargo/vendor/serde-1.0.125/src/integer128.rs
similarity index 98%
rename from third_party/cargo/vendor/serde-1.0.118/src/integer128.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/integer128.rs
index 01d6f34..0ee05bd 100644
--- a/third_party/cargo/vendor/serde-1.0.118/src/integer128.rs
+++ b/third_party/cargo/vendor/serde-1.0.125/src/integer128.rs
@@ -10,7 +10,7 @@
 /// bother with this macro and may assume support for 128-bit integers.
 ///
 /// ```edition2018
-/// # use serde::private::ser::Error;
+/// # use serde::__private::doc::Error;
 /// #
 /// # struct MySerializer;
 /// #
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/lib.rs b/third_party/cargo/vendor/serde-1.0.125/src/lib.rs
similarity index 93%
rename from third_party/cargo/vendor/serde-1.0.118/src/lib.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/lib.rs
index 12154da..5c07ece 100644
--- a/third_party/cargo/vendor/serde-1.0.118/src/lib.rs
+++ b/third_party/cargo/vendor/serde-1.0.125/src/lib.rs
@@ -9,11 +9,9 @@
 //! these two groups interact with each other, allowing any supported data
 //! structure to be serialized and deserialized using any supported data format.
 //!
-//! See the Serde website [https://serde.rs/] for additional documentation and
+//! See the Serde website  for additional documentation and
 //! usage examples.
 //!
-//! [https://serde.rs/]: https://serde.rs/
-//!
 //! ## Design
 //!
 //! Where many other languages rely on runtime reflection for serializing data,
@@ -46,7 +44,7 @@
 //! - [BSON], the data storage and network transfer format used by MongoDB.
 //! - [Avro], a binary format used within Apache Hadoop, with support for schema
 //!   definition.
-//! - [JSON5], A superset of JSON including some productions from ES5.
+//! - [JSON5], a superset of JSON including some productions from ES5.
 //! - [Postcard], a no\_std and embedded-systems friendly compact binary format.
 //! - [URL] query strings, in the x-www-form-urlencoded format.
 //! - [Envy], a way to deserialize environment variables into Rust structs.
@@ -57,6 +55,8 @@
 //!   Lisp language family.
 //! - [D-Bus]'s binary wire format.
 //! - [FlexBuffers], the schemaless cousin of Google's FlatBuffers zero-copy serialization format.
+//! - [DynamoDB Items], the format used by [rusoto_dynamodb] to transfer data to
+//!   and from DynamoDB.
 //!
 //! [JSON]: https://github.com/serde-rs/json
 //! [Bincode]: https://github.com/servo/bincode
@@ -78,11 +78,13 @@
 //! [S-expressions]: https://github.com/rotty/lexpr-rs
 //! [D-Bus]: https://docs.rs/zvariant
 //! [FlexBuffers]: https://github.com/google/flatbuffers/tree/master/rust/flexbuffers
+//! [DynamoDB Items]: https://docs.rs/serde_dynamo
+//! [rusoto_dynamodb]: https://docs.rs/rusoto_dynamodb
 
 ////////////////////////////////////////////////////////////////////////////////
 
 // Serde types in rustdoc of other crates get linked to here.
-#![doc(html_root_url = "https://docs.rs/serde/1.0.118")]
+#![doc(html_root_url = "https://docs.rs/serde/1.0.125")]
 // Support using Serde without the standard library!
 #![cfg_attr(not(feature = "std"), no_std)]
 // Unstable functionality only if the user asks for it. For tracking and
@@ -118,6 +120,7 @@
         zero_prefixed_literal,
         // correctly used
         enum_glob_use,
+        let_underscore_drop,
         map_err_ignore,
         result_unit_err,
         wildcard_imports,
@@ -136,7 +139,6 @@
     )
 )]
 // Rustc lints.
-#![forbid(unsafe_code)]
 #![deny(missing_docs, unused_imports)]
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -264,13 +266,18 @@ pub use de::{Deserialize, Deserializer};
 #[doc(inline)]
 pub use ser::{Serialize, Serializer};
 
-// Generated code uses these to support no_std. Not public API.
+// Used by generated code and doc tests. Not public API.
 #[doc(hidden)]
-pub mod export;
+#[path = "private/mod.rs"]
+pub mod __private;
 
-// Helpers used by generated code and doc tests. Not public API.
-#[doc(hidden)]
-pub mod private;
+#[allow(unused_imports)]
+use self::__private as export;
+#[allow(unused_imports)]
+use self::__private as private;
+
+#[path = "de/seed.rs"]
+mod seed;
 
 #[cfg(not(feature = "std"))]
 mod std_error;
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/macros.rs b/third_party/cargo/vendor/serde-1.0.125/src/macros.rs
similarity index 99%
rename from third_party/cargo/vendor/serde-1.0.118/src/macros.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/macros.rs
index 57600a5..6502a23 100644
--- a/third_party/cargo/vendor/serde-1.0.118/src/macros.rs
+++ b/third_party/cargo/vendor/serde-1.0.125/src/macros.rs
@@ -124,7 +124,7 @@ macro_rules! forward_to_deserialize_any {
 macro_rules! forward_to_deserialize_any_method {
     ($func:ident<$l:tt, $v:ident>($($arg:ident : $ty:ty),*)) => {
         #[inline]
-        fn $func<$v>(self, $($arg: $ty,)* visitor: $v) -> $crate::export::Result<$v::Value, Self::Error>
+        fn $func<$v>(self, $($arg: $ty,)* visitor: $v) -> $crate::__private::Result<$v::Value, Self::Error>
         where
             $v: $crate::de::Visitor<$l>,
         {
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/private/de.rs b/third_party/cargo/vendor/serde-1.0.125/src/private/de.rs
similarity index 97%
rename from third_party/cargo/vendor/serde-1.0.118/src/private/de.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/private/de.rs
index bcb964a..9199816 100644
--- a/third_party/cargo/vendor/serde-1.0.118/src/private/de.rs
+++ b/third_party/cargo/vendor/serde-1.0.125/src/private/de.rs
@@ -1,9 +1,10 @@
 use lib::*;
 
-use de::{Deserialize, DeserializeSeed, Deserializer, Error, IntoDeserializer, Visitor};
+use de::value::{BorrowedBytesDeserializer, BytesDeserializer};
+use de::{Deserialize, Deserializer, Error, IntoDeserializer, Visitor};
 
 #[cfg(any(feature = "std", feature = "alloc"))]
-use de::{MapAccess, Unexpected};
+use de::{DeserializeSeed, MapAccess, Unexpected};
 
 #[cfg(any(feature = "std", feature = "alloc"))]
 pub use self::content::{
@@ -12,6 +13,8 @@ pub use self::content::{
     TagOrContentField, TagOrContentFieldVisitor, TaggedContentVisitor, UntaggedUnitVisitor,
 };
 
+pub use seed::InPlaceSeed;
+
 /// If the missing field is of type `Option` then treat is as `None`,
 /// otherwise it is an error.
 pub fn missing_field<'de, V, E>(field: &'static str) -> Result
@@ -188,29 +191,6 @@ where
         .map(From::from)
 }
 
-pub mod size_hint {
-    use lib::*;
-
-    pub fn from_bounds(iter: &I) -> Option
-    where
-        I: Iterator,
-    {
-        helper(iter.size_hint())
-    }
-
-    #[inline]
-    pub fn cautious(hint: Option) -> usize {
-        cmp::min(hint.unwrap_or(0), 4096)
-    }
-
-    fn helper(bounds: (usize, Option)) -> Option {
-        match bounds {
-            (lower, Some(upper)) if lower == upper => Some(upper),
-            _ => None,
-        }
-    }
-}
-
 #[cfg(any(feature = "std", feature = "alloc"))]
 mod content {
     // This module is private and nothing here should be used outside of
@@ -225,7 +205,7 @@ mod content {
 
     use lib::*;
 
-    use super::size_hint;
+    use __private::size_hint;
     use de::{
         self, Deserialize, DeserializeSeed, Deserializer, EnumAccess, Expected, IgnoredAny,
         MapAccess, SeqAccess, Unexpected, Visitor,
@@ -824,15 +804,17 @@ mod content {
     /// Not public API.
     pub struct TaggedContentVisitor<'de, T> {
         tag_name: &'static str,
+        expecting: &'static str,
         value: PhantomData>,
     }
 
     impl<'de, T> TaggedContentVisitor<'de, T> {
         /// Visitor for the content of an internally tagged enum with the given
         /// tag name.
-        pub fn new(name: &'static str) -> Self {
+        pub fn new(name: &'static str, expecting: &'static str) -> Self {
             TaggedContentVisitor {
                 tag_name: name,
+                expecting: expecting,
                 value: PhantomData,
             }
         }
@@ -861,7 +843,7 @@ mod content {
         type Value = TaggedContent<'de, T>;
 
         fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
-            fmt.write_str("internally tagged enum")
+            fmt.write_str(self.expecting)
         }
 
         fn visit_seq(self, mut seq: S) -> Result
@@ -1040,6 +1022,25 @@ mod content {
                 _ => Err(self.invalid_type(&visitor)),
             }
         }
+
+        fn deserialize_float(self, visitor: V) -> Result
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                Content::F32(v) => visitor.visit_f32(v),
+                Content::F64(v) => visitor.visit_f64(v),
+                Content::U8(v) => visitor.visit_u8(v),
+                Content::U16(v) => visitor.visit_u16(v),
+                Content::U32(v) => visitor.visit_u32(v),
+                Content::U64(v) => visitor.visit_u64(v),
+                Content::I8(v) => visitor.visit_i8(v),
+                Content::I16(v) => visitor.visit_i16(v),
+                Content::I32(v) => visitor.visit_i32(v),
+                Content::I64(v) => visitor.visit_i64(v),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
     }
 
     fn visit_content_seq<'de, V, E>(content: Vec>, visitor: V) -> Result
@@ -1179,25 +1180,14 @@ mod content {
         where
             V: Visitor<'de>,
         {
-            match self.content {
-                Content::F32(v) => visitor.visit_f32(v),
-                Content::F64(v) => visitor.visit_f64(v),
-                Content::U64(v) => visitor.visit_u64(v),
-                Content::I64(v) => visitor.visit_i64(v),
-                _ => Err(self.invalid_type(&visitor)),
-            }
+            self.deserialize_float(visitor)
         }
 
         fn deserialize_f64(self, visitor: V) -> Result
         where
             V: Visitor<'de>,
         {
-            match self.content {
-                Content::F64(v) => visitor.visit_f64(v),
-                Content::U64(v) => visitor.visit_u64(v),
-                Content::I64(v) => visitor.visit_i64(v),
-                _ => Err(self.invalid_type(&visitor)),
-            }
+            self.deserialize_float(visitor)
         }
 
         fn deserialize_char(self, visitor: V) -> Result
@@ -1297,8 +1287,9 @@ mod content {
                 //     }
                 //
                 // We want {"topic":"Info"} to deserialize even though
-                // ordinarily unit structs do not deserialize from empty map.
+                // ordinarily unit structs do not deserialize from empty map/seq.
                 Content::Map(ref v) if v.is_empty() => visitor.visit_unit(),
+                Content::Seq(ref v) if v.is_empty() => visitor.visit_unit(),
                 _ => self.deserialize_any(visitor),
             }
         }
@@ -1751,6 +1742,25 @@ mod content {
                 _ => Err(self.invalid_type(&visitor)),
             }
         }
+
+        fn deserialize_float(self, visitor: V) -> Result
+        where
+            V: Visitor<'de>,
+        {
+            match *self.content {
+                Content::F32(v) => visitor.visit_f32(v),
+                Content::F64(v) => visitor.visit_f64(v),
+                Content::U8(v) => visitor.visit_u8(v),
+                Content::U16(v) => visitor.visit_u16(v),
+                Content::U32(v) => visitor.visit_u32(v),
+                Content::U64(v) => visitor.visit_u64(v),
+                Content::I8(v) => visitor.visit_i8(v),
+                Content::I16(v) => visitor.visit_i16(v),
+                Content::I32(v) => visitor.visit_i32(v),
+                Content::I64(v) => visitor.visit_i64(v),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
     }
 
     fn visit_content_seq_ref<'a, 'de, V, E>(
@@ -1898,25 +1908,14 @@ mod content {
         where
             V: Visitor<'de>,
         {
-            match *self.content {
-                Content::F32(v) => visitor.visit_f32(v),
-                Content::F64(v) => visitor.visit_f64(v),
-                Content::U64(v) => visitor.visit_u64(v),
-                Content::I64(v) => visitor.visit_i64(v),
-                _ => Err(self.invalid_type(&visitor)),
-            }
+            self.deserialize_float(visitor)
         }
 
         fn deserialize_f64(self, visitor: V) -> Result
         where
             V: Visitor<'de>,
         {
-            match *self.content {
-                Content::F64(v) => visitor.visit_f64(v),
-                Content::U64(v) => visitor.visit_u64(v),
-                Content::I64(v) => visitor.visit_i64(v),
-                _ => Err(self.invalid_type(&visitor)),
-            }
+            self.deserialize_float(visitor)
         }
 
         fn deserialize_char(self, visitor: V) -> Result
@@ -2542,11 +2541,13 @@ pub trait IdentifierDeserializer<'de, E: Error> {
     fn from(self) -> Self::Deserializer;
 }
 
-impl<'de, E> IdentifierDeserializer<'de, E> for u32
+pub struct Borrowed<'de, T: 'de + ?Sized>(pub &'de T);
+
+impl<'de, E> IdentifierDeserializer<'de, E> for u64
 where
     E: Error,
 {
-    type Deserializer = >::Deserializer;
+    type Deserializer = >::Deserializer;
 
     fn from(self) -> Self::Deserializer {
         self.into_deserializer()
@@ -2558,20 +2559,6 @@ pub struct StrDeserializer<'a, E> {
     marker: PhantomData,
 }
 
-impl<'a, E> IdentifierDeserializer<'a, E> for &'a str
-where
-    E: Error,
-{
-    type Deserializer = StrDeserializer<'a, E>;
-
-    fn from(self) -> Self::Deserializer {
-        StrDeserializer {
-            value: self,
-            marker: PhantomData,
-        }
-    }
-}
-
 impl<'de, 'a, E> Deserializer<'de> for StrDeserializer<'a, E>
 where
     E: Error,
@@ -2592,26 +2579,12 @@ where
     }
 }
 
-pub struct BytesDeserializer<'a, E> {
-    value: &'a [u8],
+pub struct BorrowedStrDeserializer<'de, E> {
+    value: &'de str,
     marker: PhantomData,
 }
 
-impl<'a, E> IdentifierDeserializer<'a, E> for &'a [u8]
-where
-    E: Error,
-{
-    type Deserializer = BytesDeserializer<'a, E>;
-
-    fn from(self) -> Self::Deserializer {
-        BytesDeserializer {
-            value: self,
-            marker: PhantomData,
-        }
-    }
-}
-
-impl<'de, 'a, E> Deserializer<'de> for BytesDeserializer<'a, E>
+impl<'de, E> Deserializer<'de> for BorrowedStrDeserializer<'de, E>
 where
     E: Error,
 {
@@ -2621,7 +2594,7 @@ where
     where
         V: Visitor<'de>,
     {
-        visitor.visit_bytes(self.value)
+        visitor.visit_borrowed_str(self.value)
     }
 
     forward_to_deserialize_any! {
@@ -2631,21 +2604,53 @@ where
     }
 }
 
-/// A DeserializeSeed helper for implementing deserialize_in_place Visitors.
-///
-/// Wraps a mutable reference and calls deserialize_in_place on it.
-pub struct InPlaceSeed<'a, T: 'a>(pub &'a mut T);
-
-impl<'a, 'de, T> DeserializeSeed<'de> for InPlaceSeed<'a, T>
+impl<'a, E> IdentifierDeserializer<'a, E> for &'a str
 where
-    T: Deserialize<'de>,
+    E: Error,
 {
-    type Value = ();
-    fn deserialize(self, deserializer: D) -> Result
-    where
-        D: Deserializer<'de>,
-    {
-        T::deserialize_in_place(deserializer, self.0)
+    type Deserializer = StrDeserializer<'a, E>;
+
+    fn from(self) -> Self::Deserializer {
+        StrDeserializer {
+            value: self,
+            marker: PhantomData,
+        }
+    }
+}
+
+impl<'de, E> IdentifierDeserializer<'de, E> for Borrowed<'de, str>
+where
+    E: Error,
+{
+    type Deserializer = BorrowedStrDeserializer<'de, E>;
+
+    fn from(self) -> Self::Deserializer {
+        BorrowedStrDeserializer {
+            value: self.0,
+            marker: PhantomData,
+        }
+    }
+}
+
+impl<'a, E> IdentifierDeserializer<'a, E> for &'a [u8]
+where
+    E: Error,
+{
+    type Deserializer = BytesDeserializer<'a, E>;
+
+    fn from(self) -> Self::Deserializer {
+        BytesDeserializer::new(self)
+    }
+}
+
+impl<'de, E> IdentifierDeserializer<'de, E> for Borrowed<'de, [u8]>
+where
+    E: Error,
+{
+    type Deserializer = BorrowedBytesDeserializer<'de, E>;
+
+    fn from(self) -> Self::Deserializer {
+        BorrowedBytesDeserializer::new(self.0)
     }
 }
 
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/private/macros.rs b/third_party/cargo/vendor/serde-1.0.125/src/private/doc.rs
similarity index 88%
rename from third_party/cargo/vendor/serde-1.0.118/src/private/macros.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/private/doc.rs
index 4f7054f..f597af8 100644
--- a/third_party/cargo/vendor/serde-1.0.118/src/private/macros.rs
+++ b/third_party/cargo/vendor/serde-1.0.125/src/private/doc.rs
@@ -1,3 +1,35 @@
+// Used only by Serde doc tests. Not public API.
+
+use lib::*;
+
+use ser;
+
+#[doc(hidden)]
+#[derive(Debug)]
+pub struct Error;
+
+impl ser::Error for Error {
+    fn custom(_: T) -> Self
+    where
+        T: Display,
+    {
+        unimplemented!()
+    }
+}
+
+#[cfg(feature = "std")]
+impl error::Error for Error {
+    fn description(&self) -> &str {
+        unimplemented!()
+    }
+}
+
+impl Display for Error {
+    fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
+        unimplemented!()
+    }
+}
+
 #[doc(hidden)]
 #[macro_export]
 macro_rules! __private_serialize {
@@ -10,19 +42,6 @@ macro_rules! __private_serialize {
     };
 }
 
-#[doc(hidden)]
-#[macro_export]
-macro_rules! __private_deserialize {
-    () => {
-        trait Deserialize<'de>: Sized {
-            fn deserialize(deserializer: D) -> Result
-            where
-                D: $crate::Deserializer<'de>;
-        }
-    };
-}
-
-/// Used only by Serde doc tests. Not public API.
 #[doc(hidden)]
 #[macro_export(local_inner_macros)]
 macro_rules! __serialize_unimplemented {
@@ -37,7 +56,7 @@ macro_rules! __serialize_unimplemented {
 #[macro_export]
 macro_rules! __serialize_unimplemented_method {
     ($func:ident $(<$t:ident>)* ($($arg:ty),*) -> $ret:ident) => {
-        fn $func $(<$t: ?Sized + $crate::Serialize>)* (self $(, _: $arg)*) -> $crate::export::Result {
+        fn $func $(<$t: ?Sized + $crate::Serialize>)* (self $(, _: $arg)*) -> $crate::__private::Result {
             unimplemented!()
         }
     };
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/export.rs b/third_party/cargo/vendor/serde-1.0.125/src/private/mod.rs
similarity index 82%
rename from third_party/cargo/vendor/serde-1.0.118/src/export.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/private/mod.rs
index caa1f4d..24ea84b 100644
--- a/third_party/cargo/vendor/serde-1.0.118/src/export.rs
+++ b/third_party/cargo/vendor/serde-1.0.125/src/private/mod.rs
@@ -1,3 +1,13 @@
+#[cfg(serde_derive)]
+pub mod de;
+#[cfg(serde_derive)]
+pub mod ser;
+
+pub mod size_hint;
+
+// FIXME: #[cfg(doctest)] once https://github.com/rust-lang/rust/issues/67295 is fixed.
+pub mod doc;
+
 pub use lib::clone::Clone;
 pub use lib::convert::{From, Into};
 pub use lib::default::Default;
@@ -24,7 +34,7 @@ mod string {
 
     // The generated code calls this like:
     //
-    //     let value = &_serde::export::from_utf8_lossy(bytes);
+    //     let value = &_serde::__private::from_utf8_lossy(bytes);
     //     Err(_serde::de::Error::unknown_variant(value, VARIANTS))
     //
     // so it is okay for the return type to be different from the std case as long
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/private/ser.rs b/third_party/cargo/vendor/serde-1.0.125/src/private/ser.rs
similarity index 98%
rename from third_party/cargo/vendor/serde-1.0.118/src/private/ser.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/private/ser.rs
index eb8cfc9..6ee9993 100644
--- a/third_party/cargo/vendor/serde-1.0.118/src/private/ser.rs
+++ b/third_party/cargo/vendor/serde-1.0.125/src/private/ser.rs
@@ -335,33 +335,6 @@ where
     }
 }
 
-/// Used only by Serde doc tests. Not public API.
-#[doc(hidden)]
-#[derive(Debug)]
-pub struct Error;
-
-impl ser::Error for Error {
-    fn custom(_: T) -> Self
-    where
-        T: Display,
-    {
-        unimplemented!()
-    }
-}
-
-#[cfg(feature = "std")]
-impl error::Error for Error {
-    fn description(&self) -> &str {
-        unimplemented!()
-    }
-}
-
-impl Display for Error {
-    fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
-        unimplemented!()
-    }
-}
-
 #[cfg(any(feature = "std", feature = "alloc"))]
 mod content {
     use lib::*;
@@ -452,7 +425,6 @@ mod content {
         }
     }
 
-    #[derive(Debug)]
     pub enum Content {
         Bool(bool),
 
diff --git a/third_party/cargo/vendor/serde-1.0.125/src/private/size_hint.rs b/third_party/cargo/vendor/serde-1.0.125/src/private/size_hint.rs
new file mode 100644
index 0000000..ca71e61
--- /dev/null
+++ b/third_party/cargo/vendor/serde-1.0.125/src/private/size_hint.rs
@@ -0,0 +1,21 @@
+use lib::*;
+
+pub fn from_bounds(iter: &I) -> Option
+where
+    I: Iterator,
+{
+    helper(iter.size_hint())
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+#[inline]
+pub fn cautious(hint: Option) -> usize {
+    cmp::min(hint.unwrap_or(0), 4096)
+}
+
+fn helper(bounds: (usize, Option)) -> Option {
+    match bounds {
+        (lower, Some(upper)) if lower == upper => Some(upper),
+        _ => None,
+    }
+}
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/ser/fmt.rs b/third_party/cargo/vendor/serde-1.0.125/src/ser/fmt.rs
similarity index 100%
rename from third_party/cargo/vendor/serde-1.0.118/src/ser/fmt.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/ser/fmt.rs
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/ser/impls.rs b/third_party/cargo/vendor/serde-1.0.125/src/ser/impls.rs
similarity index 93%
rename from third_party/cargo/vendor/serde-1.0.118/src/ser/impls.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/ser/impls.rs
index 431a478..c254ac6 100644
--- a/third_party/cargo/vendor/serde-1.0.118/src/ser/impls.rs
+++ b/third_party/cargo/vendor/serde-1.0.125/src/ser/impls.rs
@@ -674,6 +674,52 @@ impl Serialize for net::IpAddr {
     }
 }
 
+#[cfg(feature = "std")]
+const DEC_DIGITS_LUT: &'static [u8] = b"\
+      0001020304050607080910111213141516171819\
+      2021222324252627282930313233343536373839\
+      4041424344454647484950515253545556575859\
+      6061626364656667686970717273747576777879\
+      8081828384858687888990919293949596979899";
+
+#[cfg(feature = "std")]
+#[inline]
+fn format_u8(mut n: u8, out: &mut [u8]) -> usize {
+    if n >= 100 {
+        let d1 = ((n % 100) << 1) as usize;
+        n /= 100;
+        out[0] = b'0' + n;
+        out[1] = DEC_DIGITS_LUT[d1];
+        out[2] = DEC_DIGITS_LUT[d1 + 1];
+        3
+    } else if n >= 10 {
+        let d1 = (n << 1) as usize;
+        out[0] = DEC_DIGITS_LUT[d1];
+        out[1] = DEC_DIGITS_LUT[d1 + 1];
+        2
+    } else {
+        out[0] = b'0' + n;
+        1
+    }
+}
+
+#[cfg(feature = "std")]
+#[test]
+fn test_format_u8() {
+    let mut i = 0u8;
+
+    loop {
+        let mut buf = [0u8; 3];
+        let written = format_u8(i, &mut buf);
+        assert_eq!(i.to_string().as_bytes(), &buf[..written]);
+
+        match i.checked_add(1) {
+            Some(next) => i = next,
+            None => break,
+        }
+    }
+}
+
 #[cfg(feature = "std")]
 impl Serialize for net::Ipv4Addr {
     fn serialize(&self, serializer: S) -> Result
@@ -683,7 +729,14 @@ impl Serialize for net::Ipv4Addr {
         if serializer.is_human_readable() {
             const MAX_LEN: usize = 15;
             debug_assert_eq!(MAX_LEN, "101.102.103.104".len());
-            serialize_display_bounded_length!(self, MAX_LEN, serializer)
+            let mut buf = [b'.'; MAX_LEN];
+            let mut written = format_u8(self.octets()[0], &mut buf);
+            for oct in &self.octets()[1..] {
+                // Skip over delimiters that we initialized buf with
+                written += format_u8(*oct, &mut buf[written + 1..]) + 1;
+            }
+            // We've only written ASCII bytes to the buffer, so it is valid UTF-8
+            serializer.serialize_str(unsafe { str::from_utf8_unchecked(&buf[..written]) })
         } else {
             self.octets().serialize(serializer)
         }
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/ser/impossible.rs b/third_party/cargo/vendor/serde-1.0.125/src/ser/impossible.rs
similarity index 99%
rename from third_party/cargo/vendor/serde-1.0.118/src/ser/impossible.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/ser/impossible.rs
index 90bab29..e8df9ca 100644
--- a/third_party/cargo/vendor/serde-1.0.118/src/ser/impossible.rs
+++ b/third_party/cargo/vendor/serde-1.0.125/src/ser/impossible.rs
@@ -17,7 +17,7 @@ use ser::{
 ///
 /// ```edition2018
 /// # use serde::ser::{Serializer, Impossible};
-/// # use serde::private::ser::Error;
+/// # use serde::__private::doc::Error;
 /// #
 /// # struct MySerializer;
 /// #
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/ser/mod.rs b/third_party/cargo/vendor/serde-1.0.125/src/ser/mod.rs
similarity index 99%
rename from third_party/cargo/vendor/serde-1.0.118/src/ser/mod.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/ser/mod.rs
index 8a4b2e3..d686c5a 100644
--- a/third_party/cargo/vendor/serde-1.0.118/src/ser/mod.rs
+++ b/third_party/cargo/vendor/serde-1.0.125/src/ser/mod.rs
@@ -711,7 +711,7 @@ pub trait Serializer: Sized {
     ///
     /// ```edition2018
     /// # use serde::ser::{Serializer, SerializeSeq};
-    /// # use serde::private::ser::Error;
+    /// # use serde::__private::doc::Error;
     /// #
     /// # struct MySerializer;
     /// #
diff --git a/third_party/cargo/vendor/serde-1.0.118/src/std_error.rs b/third_party/cargo/vendor/serde-1.0.125/src/std_error.rs
similarity index 100%
rename from third_party/cargo/vendor/serde-1.0.118/src/std_error.rs
rename to third_party/cargo/vendor/serde-1.0.125/src/std_error.rs
diff --git a/third_party/cargo/vendor/shared_library-0.1.9/BUILD.bazel b/third_party/cargo/vendor/shared_library-0.1.9/BUILD.bazel
index 2a5a3b9..5dd55f7 100644
--- a/third_party/cargo/vendor/shared_library-0.1.9/BUILD.bazel
+++ b/third_party/cargo/vendor/shared_library-0.1.9/BUILD.bazel
@@ -50,6 +50,6 @@ rust_library(
     # buildifier: leave-alone
     deps = [
         "//third_party/cargo/vendor/lazy_static-1.4.0:lazy_static",
-        "//third_party/cargo/vendor/libc-0.2.82:libc",
+        "//third_party/cargo/vendor/libc-0.2.92:libc",
     ],
 )
diff --git a/third_party/cargo/vendor/smallvec-1.6.0/.cargo-checksum.json b/third_party/cargo/vendor/smallvec-1.6.0/.cargo-checksum.json
deleted file mode 100644
index febc840..0000000
--- a/third_party/cargo/vendor/smallvec-1.6.0/.cargo-checksum.json
+++ /dev/null
@@ -1 +0,0 @@
-{"files":{"Cargo.toml":"d4dd84fce0c41196fe41dc490c1282cd268ac304088eb085907878e93fad689e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0b28172679e0009b655da42797c03fd163a3379d5cfa67ba1f1655e974a2a1a9","README.md":"a01127c37308457e8d396b176fb790846be0978c173be3f13260b62efcef011b","benches/bench.rs":"7425b60d83d01a0bcedb5855ec8652fb1089194da5b5d8f7d7d9072c8ea9d133","scripts/run_miri.sh":"0d0b8c54c73fa9da1217d29ed0984f8328dd9fb61bb5a02db44458c360cdc3c4","src/lib.rs":"092cbff540e17c5431d91739e1be9f3465ad7bbfcf1662cc9880f69918f7f00f","src/specialization.rs":"46433586203399251cba496d67b88d34e1be3c2b591986b77463513da1c66471","src/tests.rs":"1c4763444139813d335d33f9eda8b8b719da60a2b13ddcb44e1a6cc278c319cc","tests/macro.rs":"22ad4f6f104a599fdcba19cad8834105b8656b212fb6c7573a427d447f5db14f"},"package":"1a55ca5f3b68e41c979bf8c46a6f1da892ca4db8f94023ce0bd32407573b1ac0"}
\ No newline at end of file
diff --git a/third_party/cargo/vendor/smallvec-1.6.1/.cargo-checksum.json b/third_party/cargo/vendor/smallvec-1.6.1/.cargo-checksum.json
new file mode 100644
index 0000000..3478529
--- /dev/null
+++ b/third_party/cargo/vendor/smallvec-1.6.1/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"46f2d60c34053a4d9fb34db9f8ea2a84bc29175d16c476e74f7a71d1d5ce10d0","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0b28172679e0009b655da42797c03fd163a3379d5cfa67ba1f1655e974a2a1a9","README.md":"a01127c37308457e8d396b176fb790846be0978c173be3f13260b62efcef011b","benches/bench.rs":"7425b60d83d01a0bcedb5855ec8652fb1089194da5b5d8f7d7d9072c8ea9d133","scripts/run_miri.sh":"0d0b8c54c73fa9da1217d29ed0984f8328dd9fb61bb5a02db44458c360cdc3c4","src/lib.rs":"1d4ed3854a0a9c3731a62e485f8eab721d450c0f42de45baaac1f3ce4415419a","src/specialization.rs":"46433586203399251cba496d67b88d34e1be3c2b591986b77463513da1c66471","src/tests.rs":"3a8f9d998a7c813d54b7214f80d0edf29ebb618821eb23f8e443bcdf60827556","tests/macro.rs":"22ad4f6f104a599fdcba19cad8834105b8656b212fb6c7573a427d447f5db14f"},"package":"fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"}
\ No newline at end of file
diff --git a/third_party/cargo/vendor/smallvec-1.6.0/BUILD.bazel b/third_party/cargo/vendor/smallvec-1.6.1/BUILD.bazel
similarity index 97%
rename from third_party/cargo/vendor/smallvec-1.6.0/BUILD.bazel
rename to third_party/cargo/vendor/smallvec-1.6.1/BUILD.bazel
index 09cbbc5..5c3d538 100644
--- a/third_party/cargo/vendor/smallvec-1.6.0/BUILD.bazel
+++ b/third_party/cargo/vendor/smallvec-1.6.1/BUILD.bazel
@@ -48,7 +48,7 @@ rust_library(
         "cargo-raze",
         "manual",
     ],
-    version = "1.6.0",
+    version = "1.6.1",
     # buildifier: leave-alone
     deps = [
     ],
diff --git a/third_party/cargo/vendor/smallvec-1.6.0/Cargo.toml b/third_party/cargo/vendor/smallvec-1.6.1/Cargo.toml
similarity index 98%
rename from third_party/cargo/vendor/smallvec-1.6.0/Cargo.toml
rename to third_party/cargo/vendor/smallvec-1.6.1/Cargo.toml
index 0847c03..1759894 100644
--- a/third_party/cargo/vendor/smallvec-1.6.0/Cargo.toml
+++ b/third_party/cargo/vendor/smallvec-1.6.1/Cargo.toml
@@ -13,7 +13,7 @@
 [package]
 edition = "2018"
 name = "smallvec"
-version = "1.6.0"
+version = "1.6.1"
 authors = ["The Servo Project Developers"]
 description = "'Small vector' optimization: store up to a small number of items on the stack"
 documentation = "https://docs.rs/smallvec/"
diff --git a/third_party/cargo/vendor/smallvec-1.6.0/LICENSE-APACHE b/third_party/cargo/vendor/smallvec-1.6.1/LICENSE-APACHE
similarity index 100%
rename from third_party/cargo/vendor/smallvec-1.6.0/LICENSE-APACHE
rename to third_party/cargo/vendor/smallvec-1.6.1/LICENSE-APACHE
diff --git a/third_party/cargo/vendor/smallvec-1.6.0/LICENSE-MIT b/third_party/cargo/vendor/smallvec-1.6.1/LICENSE-MIT
similarity index 100%
rename from third_party/cargo/vendor/smallvec-1.6.0/LICENSE-MIT
rename to third_party/cargo/vendor/smallvec-1.6.1/LICENSE-MIT
diff --git a/third_party/cargo/vendor/smallvec-1.6.0/README.md b/third_party/cargo/vendor/smallvec-1.6.1/README.md
similarity index 100%
rename from third_party/cargo/vendor/smallvec-1.6.0/README.md
rename to third_party/cargo/vendor/smallvec-1.6.1/README.md
diff --git a/third_party/cargo/vendor/smallvec-1.6.0/benches/bench.rs b/third_party/cargo/vendor/smallvec-1.6.1/benches/bench.rs
similarity index 100%
rename from third_party/cargo/vendor/smallvec-1.6.0/benches/bench.rs
rename to third_party/cargo/vendor/smallvec-1.6.1/benches/bench.rs
diff --git a/third_party/cargo/vendor/smallvec-1.6.0/scripts/run_miri.sh b/third_party/cargo/vendor/smallvec-1.6.1/scripts/run_miri.sh
similarity index 100%
rename from third_party/cargo/vendor/smallvec-1.6.0/scripts/run_miri.sh
rename to third_party/cargo/vendor/smallvec-1.6.1/scripts/run_miri.sh
diff --git a/third_party/cargo/vendor/smallvec-1.6.0/src/lib.rs b/third_party/cargo/vendor/smallvec-1.6.1/src/lib.rs
similarity index 98%
rename from third_party/cargo/vendor/smallvec-1.6.0/src/lib.rs
rename to third_party/cargo/vendor/smallvec-1.6.1/src/lib.rs
index 0241aef..5e9de82 100644
--- a/third_party/cargo/vendor/smallvec-1.6.0/src/lib.rs
+++ b/third_party/cargo/vendor/smallvec-1.6.1/src/lib.rs
@@ -1009,7 +1009,7 @@ impl SmallVec {
     /// Insert multiple elements at position `index`, shifting all following elements toward the
     /// back.
     pub fn insert_many>(&mut self, index: usize, iterable: I) {
-        let iter = iterable.into_iter();
+        let mut iter = iterable.into_iter();
         if index == self.len() {
             return self.extend(iter);
         }
@@ -1017,13 +1017,16 @@ impl SmallVec {
         let (lower_size_bound, _) = iter.size_hint();
         assert!(lower_size_bound <= core::isize::MAX as usize); // Ensure offset is indexable
         assert!(index + lower_size_bound >= index); // Protect against overflow
-        self.reserve(lower_size_bound);
+
+        let mut num_added = 0;
+        let old_len = self.len();
+        assert!(index <= old_len);
 
         unsafe {
-            let old_len = self.len();
-            assert!(index <= old_len);
+            // Reserve space for `lower_size_bound` elements.
+            self.reserve(lower_size_bound);
             let start = self.as_mut_ptr();
-            let mut ptr = start.add(index);
+            let ptr = start.add(index);
 
             // Move the trailing elements.
             ptr::copy(ptr, ptr.add(lower_size_bound), old_len - index);
@@ -1036,42 +1039,39 @@ impl SmallVec {
                 len: old_len + lower_size_bound,
             };
 
-            let mut num_added = 0;
-            for element in iter {
-                let mut cur = ptr.add(num_added);
-                if num_added >= lower_size_bound {
-                    // Iterator provided more elements than the hint.  Move trailing items again.
-                    self.reserve(1);
-                    let start = self.as_mut_ptr();
-                    ptr = start.add(index);
-                    cur = ptr.add(num_added);
-                    ptr::copy(cur, cur.add(1), old_len - index);
-
-                    guard.start = start;
-                    guard.len += 1;
-                    guard.skip.end += 1;
-                }
+            while num_added < lower_size_bound {
+                let element = match iter.next() {
+                    Some(x) => x,
+                    None => break,
+                };
+                let cur = ptr.add(num_added);
                 ptr::write(cur, element);
                 guard.skip.start += 1;
                 num_added += 1;
             }
-            mem::forget(guard);
 
             if num_added < lower_size_bound {
-                // Iterator provided fewer elements than the hint
+                // Iterator provided fewer elements than the hint. Move the tail backward.
                 ptr::copy(
                     ptr.add(lower_size_bound),
                     ptr.add(num_added),
                     old_len - index,
                 );
             }
-
+            // There are no more duplicate or uninitialized slots, so the guard is not needed.
             self.set_len(old_len + num_added);
+            mem::forget(guard);
+        }
+
+        // Insert any remaining elements one-by-one.
+        for element in iter {
+            self.insert(index + num_added, element);
+            num_added += 1;
         }
 
         struct DropOnPanic {
             start: *mut T,
-            skip: Range,
+            skip: Range, // Space we copied-out-of, but haven't written-to yet.
             len: usize,
         }
 
diff --git a/third_party/cargo/vendor/smallvec-1.6.0/src/specialization.rs b/third_party/cargo/vendor/smallvec-1.6.1/src/specialization.rs
similarity index 100%
rename from third_party/cargo/vendor/smallvec-1.6.0/src/specialization.rs
rename to third_party/cargo/vendor/smallvec-1.6.1/src/specialization.rs
diff --git a/third_party/cargo/vendor/smallvec-1.6.0/src/tests.rs b/third_party/cargo/vendor/smallvec-1.6.1/src/tests.rs
similarity index 98%
rename from third_party/cargo/vendor/smallvec-1.6.0/src/tests.rs
rename to third_party/cargo/vendor/smallvec-1.6.1/src/tests.rs
index 0452ae8..19f6da8 100644
--- a/third_party/cargo/vendor/smallvec-1.6.0/src/tests.rs
+++ b/third_party/cargo/vendor/smallvec-1.6.1/src/tests.rs
@@ -905,3 +905,16 @@ fn empty_macro() {
 fn zero_size_items() {
     SmallVec::<[(); 0]>::new().push(());
 }
+
+#[test]
+fn test_insert_many_overflow() {
+    let mut v: SmallVec<[u8; 1]> = SmallVec::new();
+    v.push(123);
+
+    // Prepare an iterator with small lower bound
+    let iter = (0u8..5).filter(|n| n % 2 == 0);
+    assert_eq!(iter.size_hint().0, 0);
+
+    v.insert_many(0, iter);
+    assert_eq!(&*v, &[0, 2, 4, 123]);
+}
diff --git a/third_party/cargo/vendor/smallvec-1.6.0/tests/macro.rs b/third_party/cargo/vendor/smallvec-1.6.1/tests/macro.rs
similarity index 100%
rename from third_party/cargo/vendor/smallvec-1.6.0/tests/macro.rs
rename to third_party/cargo/vendor/smallvec-1.6.1/tests/macro.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/.cargo-checksum.json b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/.cargo-checksum.json
similarity index 84%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/.cargo-checksum.json
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/.cargo-checksum.json
index 8c85b5b..392e68a 100644
--- a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/.cargo-checksum.json
+++ b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"CHANGELOG.md":"11ac0ee344bf625a63c4230dcbf68c8adcd5efac50ab49dd508751683baa40dc","CONTRIBUTING.md":"b3a310f25decb6d92da06a5db2df1a6d2e2a0843890e07c0bba0d517f83c60bf","Cargo.lock":"1a0e6dab5a2f1ab398864d40a5cf33f287061bccb6375247e016d45a32c4f85d","Cargo.toml":"b60f44052b1b90f04e7164b10e9209c88104ac1f687118554ea2da5bf3931bac","LICENSE.txt":"13c0147abe1c7607fde840e2dffcde75bf925aea504b2845b7be4869a5af2afc","README.md":"d7962ff0127c4b155fcf0442435aae6dc1137a9da304146854ee7f77fbbbec16","doc_index.html":"383be472c810a6ad7970779a37f2344735a6331ed21bd48de7a38a2772301621","examples/compositor_info.rs":"ad9037e9456e8696feb20b1084f577f3a02c4425275646a9a7a5ffed23a4d698","examples/image_viewer.rs":"3c8c580e225cec4dd620626778ea4c3e7bffe5ca0e3ca47bdc0fdf1edf4b9f66","examples/kbd_input.rs":"4c50c0c0c474252487c41cb6f5453a7b45a34793df87ad70d9fa63c619728627","examples/layer_shell.rs":"b6c472a1f1340e63887a7dff01825c2935afa91e4d61e24ab644bc2d3cd88f62","examples/pointer_input.rs":"b3579fa97edded2d8da1480805dd388ded4df74a8bfdd817d774b3f0a95404ea","examples/selection.rs":"06779ffe680a9137769f76064ebc7c9e7a070d3c04741f7821ae7b6759829677","examples/themed_frame.rs":"41cc5f7381c95c21c12bc0a45ddf527e4da8e67992aa8bfc4ed8aeb9aa3571e7","rustfmt.toml":"96bdd19cb3977f491db46410865c40708050eb093d27fff129a19e4d19be3caf","src/data_device/device.rs":"42126e8998ccc7ab7cb9083df262f5b39ba3aa9c59c9231d34c38c2f92b7d424","src/data_device/mod.rs":"d0372eb338b32a16d401f3f71b485d62ff3c6bb1b91afb9865a4190b847db445","src/data_device/offer.rs":"944449dc087fdc645af258f481afb1ad4fc9f3bd133cca20bb53311f6c5ffc9c","src/data_device/source.rs":"74bb7ebf2980deb3eb21da157bd8a647d6d277ab037e5540b5b589af37c266bf","src/environment.rs":"5c8cdf2f6e3193f15fd9c56b29388014a1512b7532788d9c862ae8e6071475db","src/event_loop.rs":"c18481bec422182f0940ca7e18effb8eb744e77bb9374d68e3e6157493f8f4cd","src/lazy_global.rs":"30e67f4a0ea1557b47ad9846ca13caaae8f287dff75de235b7ff57bfd42821a6","src/lib.rs":"e82104dcb61ef6664e3efceb596d063aa01858c67f797b88adc6aebfed98c120","src/output.rs":"3db1e633b0912ae2bcea4a7c72f2fff5b1b0fcf5c12c566dcc1080e3593e1624","src/primary_selection/device.rs":"6f07cccca4d257f15c28e633d76781d0c467a28db1182b1a59ed77df76d117ef","src/primary_selection/mod.rs":"a685511eeac96550bed2f68a41beff5747ad4fe0e4791d05727bd860c9687acb","src/primary_selection/offer.rs":"f47f115a5ac32accc96e965ff7056dfffb988dc29a9e670c66b7f19db6e7e011","src/primary_selection/source.rs":"cee78b8dbe90f7f2287be8956d96b22601f206e2b93fdf6b6e12080287ede2ce","src/seat/keyboard/ffi.rs":"e772d660a5280428c480c73b8379485b6af2adcb1dbe553450d70201afe77dba","src/seat/keyboard/keysyms.rs":"9fa396664a5fa15969b113b2db20ec9458b319c252a3f6d6e4bb289ee9518e34","src/seat/keyboard/mod.rs":"f505a240c672d76708207216304f323f1e9ce79b5ac1e02d604e6256958e119e","src/seat/keyboard/state.rs":"3210981a08413f0b382f5f6a30dc61ee1b3c62f4cceb57fbfe09fc5bd26508ee","src/seat/mod.rs":"016eafde0f287721011a02b9176eee142bbe578e9f59abf05e946c6f3464b6d9","src/seat/pointer/mod.rs":"f072cea6c05d1016fe14bdf15ae2dec3710074be27814b9d25823297bbc7f7b3","src/seat/pointer/theme.rs":"e5db8ec9a7046ddb7b6d9539467e100c638350bbb11979fff86477764c555b1f","src/shell/mod.rs":"01966cc4ccf28da651eb658fd0490f6d9d3aa26337706f8c6530956b71727b50","src/shell/wl.rs":"f133f4374570437983d7c7c228034f6e4dd75364154dcdcee3416e0c77deacb4","src/shell/xdg.rs":"500bebd38aaec504087c6726315d0fc70b26b495a2c0bfa33bbef9dcccacf8fc","src/shell/zxdg.rs":"8855b97652ba6c4c1852e28f0eb6ff4e9993a493a2bff4e0f014f4929111fd21","src/shm/mempool.rs":"16832c2c465643a54c518332c13e7a01aef5bfff38280520138c40ac56edb22e","src/shm/mod.rs":"f36524e621d4dc21b2076f3efac8b3e359518b961d2cbf7fac7639d9a592c35c","src/surface.rs":"9cca453f50931ad47d2fbfb1e5fc3684c03b6440965e89617d532609be5e281d","src/window/concept_frame.rs":"e9ee9b97da6e081acf3835725312485e98600b67bf6d23164a609afb81655f7f","src/window/mod.rs":"9661565ef8b834cf8ebdfc8c1253d457c9d5dfce076772ad004905d3f695ad33","travis_install_wayland.sh":"02ba67cbc481d65b75440d04e059ab00fbd59bc1821d6206d28c6f4499e3368a","update_keysyms.sh":"2c764c93647847b96bc26d1daf2e3d904f5e128c78910c237e482484561f4301"},"package":"316e13a3eb853ce7bf72ad3530dc186cb2005c57c521ef5f4ada5ee4eed74de6"}
\ No newline at end of file
+{"files":{"CHANGELOG.md":"6a7c397fda5f2375db832cae56519c3666e0bf80ff42dd59fc0e8dcb88779bd3","CONTRIBUTING.md":"b3a310f25decb6d92da06a5db2df1a6d2e2a0843890e07c0bba0d517f83c60bf","Cargo.lock":"f062fbdd0df4e2e259e21db862dabb133651996346eb1c711820a4d00d71244f","Cargo.toml":"b26bde4d5054cd8ad9d0a4ec6411f187d8512e92b42e7f299b311b54b5a9be44","LICENSE.txt":"13c0147abe1c7607fde840e2dffcde75bf925aea504b2845b7be4869a5af2afc","README.md":"d7962ff0127c4b155fcf0442435aae6dc1137a9da304146854ee7f77fbbbec16","doc_index.html":"383be472c810a6ad7970779a37f2344735a6331ed21bd48de7a38a2772301621","examples/compositor_info.rs":"ad9037e9456e8696feb20b1084f577f3a02c4425275646a9a7a5ffed23a4d698","examples/image_viewer.rs":"3c8c580e225cec4dd620626778ea4c3e7bffe5ca0e3ca47bdc0fdf1edf4b9f66","examples/kbd_input.rs":"4c50c0c0c474252487c41cb6f5453a7b45a34793df87ad70d9fa63c619728627","examples/layer_shell.rs":"b6c472a1f1340e63887a7dff01825c2935afa91e4d61e24ab644bc2d3cd88f62","examples/pointer_input.rs":"b3579fa97edded2d8da1480805dd388ded4df74a8bfdd817d774b3f0a95404ea","examples/selection.rs":"06779ffe680a9137769f76064ebc7c9e7a070d3c04741f7821ae7b6759829677","examples/themed_frame.rs":"41cc5f7381c95c21c12bc0a45ddf527e4da8e67992aa8bfc4ed8aeb9aa3571e7","rustfmt.toml":"96bdd19cb3977f491db46410865c40708050eb093d27fff129a19e4d19be3caf","src/data_device/device.rs":"42126e8998ccc7ab7cb9083df262f5b39ba3aa9c59c9231d34c38c2f92b7d424","src/data_device/mod.rs":"d0372eb338b32a16d401f3f71b485d62ff3c6bb1b91afb9865a4190b847db445","src/data_device/offer.rs":"944449dc087fdc645af258f481afb1ad4fc9f3bd133cca20bb53311f6c5ffc9c","src/data_device/source.rs":"74bb7ebf2980deb3eb21da157bd8a647d6d277ab037e5540b5b589af37c266bf","src/environment.rs":"5c8cdf2f6e3193f15fd9c56b29388014a1512b7532788d9c862ae8e6071475db","src/event_loop.rs":"c18481bec422182f0940ca7e18effb8eb744e77bb9374d68e3e6157493f8f4cd","src/lazy_global.rs":"30e67f4a0ea1557b47ad9846ca13caaae8f287dff75de235b7ff57bfd42821a6","src/lib.rs":"e82104dcb61ef6664e3efceb596d063aa01858c67f797b88adc6aebfed98c120","src/output.rs":"3db1e633b0912ae2bcea4a7c72f2fff5b1b0fcf5c12c566dcc1080e3593e1624","src/primary_selection/device.rs":"6f07cccca4d257f15c28e633d76781d0c467a28db1182b1a59ed77df76d117ef","src/primary_selection/mod.rs":"a685511eeac96550bed2f68a41beff5747ad4fe0e4791d05727bd860c9687acb","src/primary_selection/offer.rs":"f47f115a5ac32accc96e965ff7056dfffb988dc29a9e670c66b7f19db6e7e011","src/primary_selection/source.rs":"cee78b8dbe90f7f2287be8956d96b22601f206e2b93fdf6b6e12080287ede2ce","src/seat/keyboard/ffi.rs":"e772d660a5280428c480c73b8379485b6af2adcb1dbe553450d70201afe77dba","src/seat/keyboard/keysyms.rs":"9fa396664a5fa15969b113b2db20ec9458b319c252a3f6d6e4bb289ee9518e34","src/seat/keyboard/mod.rs":"f505a240c672d76708207216304f323f1e9ce79b5ac1e02d604e6256958e119e","src/seat/keyboard/state.rs":"3210981a08413f0b382f5f6a30dc61ee1b3c62f4cceb57fbfe09fc5bd26508ee","src/seat/mod.rs":"016eafde0f287721011a02b9176eee142bbe578e9f59abf05e946c6f3464b6d9","src/seat/pointer/mod.rs":"f072cea6c05d1016fe14bdf15ae2dec3710074be27814b9d25823297bbc7f7b3","src/seat/pointer/theme.rs":"e5db8ec9a7046ddb7b6d9539467e100c638350bbb11979fff86477764c555b1f","src/shell/mod.rs":"01966cc4ccf28da651eb658fd0490f6d9d3aa26337706f8c6530956b71727b50","src/shell/wl.rs":"f133f4374570437983d7c7c228034f6e4dd75364154dcdcee3416e0c77deacb4","src/shell/xdg.rs":"500bebd38aaec504087c6726315d0fc70b26b495a2c0bfa33bbef9dcccacf8fc","src/shell/zxdg.rs":"8855b97652ba6c4c1852e28f0eb6ff4e9993a493a2bff4e0f014f4929111fd21","src/shm/mempool.rs":"16832c2c465643a54c518332c13e7a01aef5bfff38280520138c40ac56edb22e","src/shm/mod.rs":"f36524e621d4dc21b2076f3efac8b3e359518b961d2cbf7fac7639d9a592c35c","src/surface.rs":"9cca453f50931ad47d2fbfb1e5fc3684c03b6440965e89617d532609be5e281d","src/window/concept_frame.rs":"e9ee9b97da6e081acf3835725312485e98600b67bf6d23164a609afb81655f7f","src/window/mod.rs":"8936e498a7a7d1ae22697666d92e5bf8f392538c97a82e988b1844fea6176e1a","travis_install_wayland.sh":"02ba67cbc481d65b75440d04e059ab00fbd59bc1821d6206d28c6f4499e3368a","update_keysyms.sh":"2c764c93647847b96bc26d1daf2e3d904f5e128c78910c237e482484561f4301"},"package":"4750c76fd5d3ac95fa3ed80fe667d6a3d8590a960e5b575b98eea93339a80b80"}
\ No newline at end of file
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/BUILD.bazel b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/BUILD.bazel
similarity index 88%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/BUILD.bazel
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/BUILD.bazel
index 6a69cf3..cfcc50e 100644
--- a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/BUILD.bazel
+++ b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/BUILD.bazel
@@ -64,7 +64,7 @@ rust_library(
         "cargo-raze",
         "manual",
     ],
-    version = "0.12.2",
+    version = "0.12.3",
     # buildifier: leave-alone
     deps = [
         "//third_party/cargo/vendor/andrew-0.3.1:andrew",
@@ -72,11 +72,11 @@ rust_library(
         "//third_party/cargo/vendor/calloop-0.6.5:calloop",
         "//third_party/cargo/vendor/dlib-0.4.2:dlib",
         "//third_party/cargo/vendor/lazy_static-1.4.0:lazy_static",
-        "//third_party/cargo/vendor/log-0.4.11:log",
+        "//third_party/cargo/vendor/log-0.4.14:log",
         "//third_party/cargo/vendor/memmap2-0.1.0:memmap2",
         "//third_party/cargo/vendor/nix-0.18.0:nix",
-        "//third_party/cargo/vendor/wayland-client-0.28.3:wayland_client",
-        "//third_party/cargo/vendor/wayland-cursor-0.28.3:wayland_cursor",
-        "//third_party/cargo/vendor/wayland-protocols-0.28.3:wayland_protocols",
+        "//third_party/cargo/vendor/wayland-client-0.28.5:wayland_client",
+        "//third_party/cargo/vendor/wayland-cursor-0.28.5:wayland_cursor",
+        "//third_party/cargo/vendor/wayland-protocols-0.28.5:wayland_protocols",
     ],
 )
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/CHANGELOG.md b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/CHANGELOG.md
similarity index 98%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/CHANGELOG.md
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/CHANGELOG.md
index b54c000..99359fd 100644
--- a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/CHANGELOG.md
+++ b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/CHANGELOG.md
@@ -2,6 +2,12 @@
 
 ## Unreleased
 
+## 0.12.3 -- 2021-03-05
+
+#### Additions
+
+- `Window::start_interactive_move` to enable dragging the window with a user action
+
 ## 0.12.2 -- 2020-12-30
 
 #### Changes
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/CONTRIBUTING.md b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/CONTRIBUTING.md
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/CONTRIBUTING.md
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/CONTRIBUTING.md
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/Cargo.lock b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/Cargo.lock
similarity index 99%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/Cargo.lock
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/Cargo.lock
index a237def..a242fa3 100644
--- a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/Cargo.lock
+++ b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/Cargo.lock
@@ -507,7 +507,7 @@ checksum = "3757cb9d89161a2f24e1cf78efa0c1fcff485d18e3f55e0aa3480824ddaa0f3f"
 
 [[package]]
 name = "smithay-client-toolkit"
-version = "0.12.2"
+version = "0.12.3"
 dependencies = [
  "andrew",
  "bitflags",
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/Cargo.toml b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/Cargo.toml
similarity index 98%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/Cargo.toml
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/Cargo.toml
index 1fa9aab..33d4aa5 100644
--- a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/Cargo.toml
+++ b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/Cargo.toml
@@ -13,7 +13,7 @@
 [package]
 edition = "2018"
 name = "smithay-client-toolkit"
-version = "0.12.2"
+version = "0.12.3"
 authors = ["Victor Berger "]
 description = "Toolkit for making client wayland applications."
 documentation = "https://smithay.github.io/client-toolkit"
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/LICENSE.txt b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/LICENSE.txt
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/LICENSE.txt
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/LICENSE.txt
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/README.md b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/README.md
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/README.md
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/README.md
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/doc_index.html b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/doc_index.html
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/doc_index.html
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/doc_index.html
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/examples/compositor_info.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/examples/compositor_info.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/examples/compositor_info.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/examples/compositor_info.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/examples/image_viewer.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/examples/image_viewer.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/examples/image_viewer.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/examples/image_viewer.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/examples/kbd_input.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/examples/kbd_input.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/examples/kbd_input.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/examples/kbd_input.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/examples/layer_shell.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/examples/layer_shell.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/examples/layer_shell.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/examples/layer_shell.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/examples/pointer_input.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/examples/pointer_input.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/examples/pointer_input.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/examples/pointer_input.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/examples/selection.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/examples/selection.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/examples/selection.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/examples/selection.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/examples/themed_frame.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/examples/themed_frame.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/examples/themed_frame.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/examples/themed_frame.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/rustfmt.toml b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/rustfmt.toml
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/rustfmt.toml
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/rustfmt.toml
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/data_device/device.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/data_device/device.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/data_device/device.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/data_device/device.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/data_device/mod.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/data_device/mod.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/data_device/mod.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/data_device/mod.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/data_device/offer.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/data_device/offer.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/data_device/offer.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/data_device/offer.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/data_device/source.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/data_device/source.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/data_device/source.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/data_device/source.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/environment.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/environment.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/environment.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/environment.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/event_loop.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/event_loop.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/event_loop.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/event_loop.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/lazy_global.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/lazy_global.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/lazy_global.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/lazy_global.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/lib.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/lib.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/lib.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/lib.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/output.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/output.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/output.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/output.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/primary_selection/device.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/primary_selection/device.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/primary_selection/device.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/primary_selection/device.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/primary_selection/mod.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/primary_selection/mod.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/primary_selection/mod.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/primary_selection/mod.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/primary_selection/offer.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/primary_selection/offer.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/primary_selection/offer.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/primary_selection/offer.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/primary_selection/source.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/primary_selection/source.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/primary_selection/source.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/primary_selection/source.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/seat/keyboard/ffi.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/seat/keyboard/ffi.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/seat/keyboard/ffi.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/seat/keyboard/ffi.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/seat/keyboard/keysyms.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/seat/keyboard/keysyms.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/seat/keyboard/keysyms.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/seat/keyboard/keysyms.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/seat/keyboard/mod.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/seat/keyboard/mod.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/seat/keyboard/mod.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/seat/keyboard/mod.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/seat/keyboard/state.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/seat/keyboard/state.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/seat/keyboard/state.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/seat/keyboard/state.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/seat/mod.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/seat/mod.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/seat/mod.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/seat/mod.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/seat/pointer/mod.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/seat/pointer/mod.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/seat/pointer/mod.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/seat/pointer/mod.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/seat/pointer/theme.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/seat/pointer/theme.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/seat/pointer/theme.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/seat/pointer/theme.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/shell/mod.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/shell/mod.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/shell/mod.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/shell/mod.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/shell/wl.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/shell/wl.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/shell/wl.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/shell/wl.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/shell/xdg.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/shell/xdg.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/shell/xdg.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/shell/xdg.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/shell/zxdg.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/shell/zxdg.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/shell/zxdg.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/shell/zxdg.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/shm/mempool.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/shm/mempool.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/shm/mempool.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/shm/mempool.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/shm/mod.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/shm/mod.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/shm/mod.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/shm/mod.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/surface.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/surface.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/surface.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/surface.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/window/concept_frame.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/window/concept_frame.rs
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/window/concept_frame.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/window/concept_frame.rs
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/window/mod.rs b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/window/mod.rs
similarity index 98%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/window/mod.rs
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/window/mod.rs
index 22ad23d..aade1f4 100644
--- a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/src/window/mod.rs
+++ b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/src/window/mod.rs
@@ -669,6 +669,20 @@ impl Window {
     pub fn set_frame_config(&mut self, config: F::Config) {
         self.frame.borrow_mut().set_config(config)
     }
+
+    /// Start an interactive, user-driven move of the surface
+    ///
+    /// This request must be used in response to some sort of user action
+    /// like a button press, key press, or touch down event. The passed
+    /// serial is used to determine the type of interactive move (touch,
+    /// pointer, etc).
+    ///
+    /// The server may ignore move requests depending on the state of
+    /// the surface (e.g. fullscreen or maximized), or if the passed serial
+    /// is no longer valid.
+    pub fn start_interactive_move(&self, seat: &wl_seat::WlSeat, serial: u32) {
+        self.shell_surface.move_(seat, serial);
+    }
 }
 
 impl Drop for Window {
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/travis_install_wayland.sh b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/travis_install_wayland.sh
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/travis_install_wayland.sh
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/travis_install_wayland.sh
diff --git a/third_party/cargo/vendor/smithay-client-toolkit-0.12.2/update_keysyms.sh b/third_party/cargo/vendor/smithay-client-toolkit-0.12.3/update_keysyms.sh
similarity index 100%
rename from third_party/cargo/vendor/smithay-client-toolkit-0.12.2/update_keysyms.sh
rename to third_party/cargo/vendor/smithay-client-toolkit-0.12.3/update_keysyms.sh
diff --git a/third_party/cargo/vendor/syn-1.0.58/.cargo-checksum.json b/third_party/cargo/vendor/syn-1.0.68/.cargo-checksum.json
similarity index 68%
rename from third_party/cargo/vendor/syn-1.0.58/.cargo-checksum.json
rename to third_party/cargo/vendor/syn-1.0.68/.cargo-checksum.json
index cf9d617..0427c3f 100644
--- a/third_party/cargo/vendor/syn-1.0.58/.cargo-checksum.json
+++ b/third_party/cargo/vendor/syn-1.0.68/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"Cargo.toml":"92063cbc21269376b50af6a841718c1c3016f6dc8ae6fd5e53d0f33925b00cfe","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"03f3b53cf858536a0883aa5b5882ee61dcd0f1e71c0930c9106fcfa1d6aad2df","benches/file.rs":"b4724fc7c0f48b8f488e2632a1064f6c0bf16ded3969680fc3f4a2369536269b","benches/rust.rs":"ea6291ef2d2a83d94a3312fe179d48259f8ec0b04c961993ddd181d0a4ab740e","build.rs":"241f9e3af93b32d2d928ef9251d8ed2e67c6c64acc4aacce81f3aca58778e655","src/attr.rs":"24739d1093fd1714e3f132b1b74e84bf4cb9fd798e11486091aaf666419fff8e","src/await.rs":"8aa22e3c201cb2bdb6b4817fa00901f308ab06817607aa7b884c58c957705969","src/bigint.rs":"efc7f64959980653d73fe4f8bc2a3a2904dc05f45b02c6dc15cd316fa3d7c338","src/buffer.rs":"a5d6692938c2ec6ec140f70ec89fa93659fa227b52e8d381e9da7dd440f0249e","src/custom_keyword.rs":"9842ed7fafd6ebc15d4c9b060d3d97ae21bfd0c0c64bc34a5a0858549fc125db","src/custom_punctuation.rs":"ec75d5f83607cf6fa282e4290031c645ac3f95798cef6fd26886aa10e3a1e74f","src/data.rs":"767f2964b8f12d87b0f218aa43ffbdec411e26a702e61e93dda4f131277c8adb","src/derive.rs":"ee24a202be2d36ccdff576dd9cd765e94b33ef2286946e6725d75b08e777d462","src/discouraged.rs":"a1f3d85e20dedf50b1b7b4571d970a3a6e9b2de4afde7dd0c986fe240df2ba46","src/error.rs":"6c70d6b27f12674cf629ee7dc3c007435430ef3a3781c4d4c2b00a64f02062dd","src/export.rs":"dcae67456278c0339acfbcbb4737b8d37cfba5a150ae789f31f4be79abf7e726","src/expr.rs":"53c674a0c21e7f4b428282beebdd79f3dd9dcfbd02bc824ed92010a1df74d488","src/ext.rs":"1f648cff1d705a1cea64b32b77482b97a82d2fe0aaf63b40cade91e5c02dc969","src/file.rs":"f86697655222ae294215114f4eae8e6b0b5e2a935d6c479ff8f8f889c4efd2e2","src/gen/clone.rs":"8db60fc2bf515f9a65f4e98669427ce02ed0ccc9ffdad25d8fb39b38768ecaf1","src/gen/debug.rs":"facf4fb5c7e017dd890c4a9531f337659d7b55475aa44124abf48e088ad56fc5","src/gen/eq.rs":"576a4f1e4030434b0f0170f4d681d2c46292fda64ad5f3913623e1c6e858c24f","src/gen/fold.rs":"3f59e59ed8ad2ab5dd347bfbe41bbc785c2aabd8ae902087a584a6daed597182","src/gen/hash.rs":"458052bb0d64b2a722eaeef4461af80bce109cd97d19bd44dbd608e4c53a6520","src/gen/visit.rs":"23008c170d4dd3975232876a0a654921d9b6af57372cb9fcc133ca740588d666","src/gen/visit_mut.rs":"42886c3ee02ded72d9c3eec006e20431eaee0c6b90ddefc1a36ec7bf50c6a24a","src/gen_helper.rs":"ea6c66388365971db6a2fc86cbb208f7eacde77e245bc8623f27a3642a3d7741","src/generics.rs":"e96cdc4e4d85cd686fa4eaadf3a7f845a11f8316a82de066814cc7dc5f3a56c6","src/group.rs":"d9cd30ea5bd4d453293e8e8debbe388a0360c3c766f67c8499fec453a9a43cdc","src/ident.rs":"d67975d3dd89becde96579c0454a1357aa7c62da11bdf94f29ccf63514ffbc9d","src/item.rs":"9e485f03eacadec069595ef0af6744ccbbe4a08d52ffe72d0e387e8bec53c766","src/lib.rs":"81069c12b04976cd8b4103ec3288ae9e8a25de32276658aea3f3ec548f728f41","src/lifetime.rs":"957fcf3923f6cb27d9d6f7caf920fdf0882a131fe5ac3806eab68d934051c2a3","src/lit.rs":"28eb28df4312070dc39e60906cf7abdf7becf18dce5c4654123dfbec61f15e95","src/lookahead.rs":"92ee63b48de02d3f6f1b09121f0fbac41d55cebc5771c8320e27df8482906152","src/mac.rs":"004cb89f9697564f6c9ee837e08ead68463ef946fb4c13c6c105adf2ba364b2b","src/macros.rs":"eeea315e5e8564254ff4ba7f1b2783b8254fce02bdb703ad77d125df8d526cc8","src/op.rs":"9d499022902743a6a0a19223b356449a979b90e60552d0446497d72750e646a4","src/parse.rs":"8b4aa518660dfd6310a5455b5624de01ad7ba42d11527b217f811b687b26e1fc","src/parse_macro_input.rs":"88929a1a7e5e72aa2d0b3459e52d8975afea856d159047ba4ab02ecbc5878a9c","src/parse_quote.rs":"80db945403d9731c5f3299a5819a5e2bb726c19fd9f256d50240bc32703c96b1","src/pat.rs":"3bd1f8fc40e55473253747d10df42c38405014110f4ac7d42e10943293b23630","src/path.rs":"5a0d83a533a6ded318491546193867bbb7a484a73f73e86c24b1ed308962df8d","src/print.rs":"da6529c1d9d21aaf6c835f66b4e67eacb7cf91a10eb5e9a2143b49bf99b3b5e1","src/punctuated.rs":"8d0384b2320ed76de06b566fd84d0a7a59a606e1f7e898fc607b384d7d9f480d","src/reserved.rs":"e70e028bd55cfa43e23cab4ba29e4dc53a3d91eff685ef2b6e57efc2b87a3428","src/sealed.rs":"896a495a5340eec898527f18bd4ddca408ea03ea0ee3af30074ff48deace778d","src/span.rs":"748c51c6feb223c26d3b1701f5bb98aee823666c775c98106cfa24fe29d8cec1","src/spanned.rs":"3ca016a943637653ab98e373dfb826a120f3c159867346fa38a844439944eb39","src/stmt.rs":"e68f76530606aab24e3587aa697fcd862c176e1cca0a50ab883c76bb91464f3d","src/thread.rs":"815eca6bd64f4eef7c447f0809e84108f5428ff50225224b373efd8fbb696874","src/token.rs":"5e423a696f80e281c322f37c87577f9fdc28607e9c007e24896a2b12da62d5ad","src/tt.rs":"32402645b6e82ef1e882945721b59b5fb7b0ee337d1972876362ecacef643d0f","src/ty.rs":"c8db70afe97a28d9b9f84bacca7edd8ba6e82c63764eb814fe6735be5ae897e0","src/verbatim.rs":"802a97df997432f18cac6e6200ff6ea29fb2474986005e0fcdbc2b65197f87f7","src/whitespace.rs":"e63dd0aa3d34029f17766a8b09c1a6e4479e36c552c8b7023d710a399333aace","tests/.gitignore":"22e782449a3c216db3f7215d5fb8882e316768e40beeec3833aae419ad8941db","tests/common/eq.rs":"6698adbc462a82cb1cf344b82de040ed12cd31c2bc88a90677d70e1c8ec4cbf2","tests/common/mod.rs":"25ef6d7daa09bad3198a0e9e91b2812425f92db7c585c1e34a03a84d7362ccd8","tests/common/parse.rs":"81580f23583723f7a2a337c4d13ebc021057cd825562fb4e474caa7cc641fed9","tests/debug/gen.rs":"e30e2b6c61feb15abe11cee86c4edff9f7e7c9c79080447d44be97869c9a3adb","tests/debug/mod.rs":"868763d0ef1609a3ad5e05e9f1bfa0f813e91e7e9a36653414a188bb2fdaa425","tests/macros/mod.rs":"a93136b172377ffebe8b68fd596a86d6625f64ed6c3d5e7f5d6ad859e25d5623","tests/repo/mod.rs":"10fa8a5b8d7838c4c6313a7d6e0aa1e14831cdd41328ae91e0fdffb509f76efe","tests/repo/progress.rs":"c08d0314a7f3ecf760d471f27da3cd2a500aeb9f1c8331bffb2aa648f9fabf3f","tests/test_asyncness.rs":"cff01db49d28ab23b0b258bc6c0a5cc4071be4fe7248eef344a5d79d2fb649b7","tests/test_attribute.rs":"0ffd99384e1a52ae17d9fed5c4053e411e8f9018decef07ffa621d1faa7329d8","tests/test_derive_input.rs":"610444351e3bf99366976bbf1da109c334a70ac9500caef366bcf9b68819829f","tests/test_expr.rs":"0ee83f6f6de950018c043efcc3e85776b4227dae3068309998a8d9709f2fc66c","tests/test_generics.rs":"9d713f90a79d6145efc89fb6f946029ca03486c632219950889da39940152ba0","tests/test_grouping.rs":"6276c3c73bba649dec5c97904ad2492879f918bc887a2c425d095c654ca0d925","tests/test_ident.rs":"9eb53d1e21edf23e7c9e14dc74dcc2b2538e9221e19dbcc0a44e3acc2e90f3f6","tests/test_item.rs":"8b20cae55d6455473632579f541ea7b840102a6a82e5e4f71a2b8aa1ed6f8b69","tests/test_iterators.rs":"53ed6078d37550bd6765d2411e3660be401aef8a31a407350cc064a7d08c7c33","tests/test_lit.rs":"ef3f39da6ed67ba73b05eab3dda299887a455bac8e97701a90a94b636681588f","tests/test_meta.rs":"bd6910ec0eba05e814dad27dda0ea65e1f8b483e64d943213066ffd114a82b45","tests/test_parse_buffer.rs":"8bbe2d24ca8a3788f72c6908fc96c26d546f11c69687bf8d72727f851d5e2d27","tests/test_parse_stream.rs":"2f449a2c41a3dee6fd14bee24e1666a453cb808eda17332fd91afd127fcdd2a6","tests/test_pat.rs":"134091ba20e86c982dadbae668aebe66b1edd9619a01dedee989d1c7efde6b80","tests/test_path.rs":"13ae78e958f0d7334d11f32519f593968e5503d46e29ec345feede025f16113d","tests/test_precedence.rs":"976788a6593440f4cd7e791e5faaeabc6dbf8050ea76f8aeb53f4989ded22c1a","tests/test_receiver.rs":"084eca59984b9a18651da52f2c4407355da3de1335916a12477652999e2d01cc","tests/test_round_trip.rs":"e5a9e8c546f43fba741028716f1f34596822accdbc52d0eccb92f98d98bad804","tests/test_shebang.rs":"f5772cadad5b56e3112cb16308b779f92bce1c3a48091fc9933deb2276a69331","tests/test_should_parse.rs":"1d3535698a446e2755bfc360676bdb161841a1f454cdef6e7556c6d06a95c89d","tests/test_size.rs":"5fae772bab66809d6708232f35cfb4a287882486763b0f763feec2ad79fbb68b","tests/test_stmt.rs":"ff6f6f447f46a52fb544353b7dcd2cd9e60781b297dcc86551bee613beaf2280","tests/test_token_trees.rs":"43e56a701817e3c3bfd0cae54a457dd7a38ccb3ca19da41e2b995fdf20e6ed18","tests/test_ty.rs":"01d33c67a72d0e030736b1be22cea916fde14681ee0253b8183905bccfcc5798","tests/test_visibility.rs":"7456fcb3a6634db509748aededff9c2d8b242d511a3e5ee3022e40b232892704","tests/zzz_stable.rs":"2a862e59cb446235ed99aec0e6ada8e16d3ecc30229b29d825b7c0bbc2602989"},"package":"cc60a3d73ea6594cd712d830cc1f0390fd71542d8c8cd24e70cc54cdfd5e05d5"}
\ No newline at end of file
+{"files":{"Cargo.toml":"d6f23e95df7009168a47f9c8a73a074932c138f7bbbc1e2747f7b9e5d47e1ed6","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"03f3b53cf858536a0883aa5b5882ee61dcd0f1e71c0930c9106fcfa1d6aad2df","benches/file.rs":"b4724fc7c0f48b8f488e2632a1064f6c0bf16ded3969680fc3f4a2369536269b","benches/rust.rs":"ea6291ef2d2a83d94a3312fe179d48259f8ec0b04c961993ddd181d0a4ab740e","build.rs":"241f9e3af93b32d2d928ef9251d8ed2e67c6c64acc4aacce81f3aca58778e655","src/attr.rs":"41bb00e06cdebe3e3145ee7c68c4dd7c05c099bfc3e9fc858fb0a3a174d31730","src/await.rs":"8aa22e3c201cb2bdb6b4817fa00901f308ab06817607aa7b884c58c957705969","src/bigint.rs":"efc7f64959980653d73fe4f8bc2a3a2904dc05f45b02c6dc15cd316fa3d7c338","src/buffer.rs":"a5d6692938c2ec6ec140f70ec89fa93659fa227b52e8d381e9da7dd440f0249e","src/custom_keyword.rs":"a834c617b4a0aa87c21275ded72a4e04d7fac2d2255cfc037c0690d21488fc31","src/custom_punctuation.rs":"8a666298e774b0d326642f0f73284f6677d0d0a7c9e4a712c9c98d010b4d8a2c","src/data.rs":"767f2964b8f12d87b0f218aa43ffbdec411e26a702e61e93dda4f131277c8adb","src/derive.rs":"ee24a202be2d36ccdff576dd9cd765e94b33ef2286946e6725d75b08e777d462","src/discouraged.rs":"a1f3d85e20dedf50b1b7b4571d970a3a6e9b2de4afde7dd0c986fe240df2ba46","src/error.rs":"72dae49d360326a1d1079a3a6dc4b22f8a304f84e0b90d70b73a02dfdc9f49da","src/export.rs":"d18438464c7ee1de7092c7c5d48dd9d114bdf184c1ea452c4fa709265cd19469","src/expr.rs":"e8c298dd0a9be02b6b7aaef970eedd5dfc4def83182e9ea5dc46e43384b35536","src/ext.rs":"1f648cff1d705a1cea64b32b77482b97a82d2fe0aaf63b40cade91e5c02dc969","src/file.rs":"f86697655222ae294215114f4eae8e6b0b5e2a935d6c479ff8f8f889c4efd2e2","src/gen/clone.rs":"8db60fc2bf515f9a65f4e98669427ce02ed0ccc9ffdad25d8fb39b38768ecaf1","src/gen/debug.rs":"facf4fb5c7e017dd890c4a9531f337659d7b55475aa44124abf48e088ad56fc5","src/gen/eq.rs":"576a4f1e4030434b0f0170f4d681d2c46292fda64ad5f3913623e1c6e858c24f","src/gen/fold.rs":"3f59e59ed8ad2ab5dd347bfbe41bbc785c2aabd8ae902087a584a6daed597182","src/gen/hash.rs":"458052bb0d64b2a722eaeef4461af80bce109cd97d19bd44dbd608e4c53a6520","src/gen/visit.rs":"23008c170d4dd3975232876a0a654921d9b6af57372cb9fcc133ca740588d666","src/gen/visit_mut.rs":"42886c3ee02ded72d9c3eec006e20431eaee0c6b90ddefc1a36ec7bf50c6a24a","src/gen_helper.rs":"ea6c66388365971db6a2fc86cbb208f7eacde77e245bc8623f27a3642a3d7741","src/generics.rs":"31d310511264b863d71ee12654abb3cac9074faf47681aba8011903b90613cc1","src/group.rs":"d9cd30ea5bd4d453293e8e8debbe388a0360c3c766f67c8499fec453a9a43cdc","src/ident.rs":"d67975d3dd89becde96579c0454a1357aa7c62da11bdf94f29ccf63514ffbc9d","src/item.rs":"8bf36d26629f8c863646bdb767a66d7aa88ece9e817af7ba882c722956d066ef","src/lib.rs":"4ab928ce5074c792c39ae1b2df5dda08f7728e8abbfd39036d118b8c50dbeb9a","src/lifetime.rs":"bd206f4471091498a8ac270c5f99d7d4b10eb614f452cd3ee614cab9e1b2f5e3","src/lit.rs":"c60c9840301504969040c409e0d328f5d574a2efbd15ebf638906f8d7e429761","src/lookahead.rs":"92ee63b48de02d3f6f1b09121f0fbac41d55cebc5771c8320e27df8482906152","src/mac.rs":"004cb89f9697564f6c9ee837e08ead68463ef946fb4c13c6c105adf2ba364b2b","src/macros.rs":"266590fd63a4a9d8637c6f8d36702acaace4ba59ab74c0883859efd1e260bae5","src/op.rs":"9d499022902743a6a0a19223b356449a979b90e60552d0446497d72750e646a4","src/parse.rs":"8b4aa518660dfd6310a5455b5624de01ad7ba42d11527b217f811b687b26e1fc","src/parse_macro_input.rs":"88929a1a7e5e72aa2d0b3459e52d8975afea856d159047ba4ab02ecbc5878a9c","src/parse_quote.rs":"80db945403d9731c5f3299a5819a5e2bb726c19fd9f256d50240bc32703c96b1","src/pat.rs":"397b02e0a6f6af8e87c2b3d70cc5b65f5428f9154f09b1006a51b31aaea65038","src/path.rs":"27e30afb3157cc410e97d64aaba06c8c0d6e279d502769834d709180d2872ee3","src/print.rs":"da6529c1d9d21aaf6c835f66b4e67eacb7cf91a10eb5e9a2143b49bf99b3b5e1","src/punctuated.rs":"ac2b0bd8ffa6ce6d07ed6e0af7384a1120db7a0918406da89a45e929feac49ba","src/reserved.rs":"e70e028bd55cfa43e23cab4ba29e4dc53a3d91eff685ef2b6e57efc2b87a3428","src/sealed.rs":"896a495a5340eec898527f18bd4ddca408ea03ea0ee3af30074ff48deace778d","src/span.rs":"748c51c6feb223c26d3b1701f5bb98aee823666c775c98106cfa24fe29d8cec1","src/spanned.rs":"3ca016a943637653ab98e373dfb826a120f3c159867346fa38a844439944eb39","src/stmt.rs":"e68f76530606aab24e3587aa697fcd862c176e1cca0a50ab883c76bb91464f3d","src/thread.rs":"815eca6bd64f4eef7c447f0809e84108f5428ff50225224b373efd8fbb696874","src/token.rs":"5e423a696f80e281c322f37c87577f9fdc28607e9c007e24896a2b12da62d5ad","src/tt.rs":"32402645b6e82ef1e882945721b59b5fb7b0ee337d1972876362ecacef643d0f","src/ty.rs":"f574845ed494241393479459e1d007f26b55d991cb2aa7aeb098807916123fc7","src/verbatim.rs":"802a97df997432f18cac6e6200ff6ea29fb2474986005e0fcdbc2b65197f87f7","src/whitespace.rs":"e63dd0aa3d34029f17766a8b09c1a6e4479e36c552c8b7023d710a399333aace","tests/.gitignore":"22e782449a3c216db3f7215d5fb8882e316768e40beeec3833aae419ad8941db","tests/common/eq.rs":"f2ff067d3472fd359749ac8d443cf39443c123b689b140d515ef287d950087eb","tests/common/mod.rs":"25ef6d7daa09bad3198a0e9e91b2812425f92db7c585c1e34a03a84d7362ccd8","tests/common/parse.rs":"81580f23583723f7a2a337c4d13ebc021057cd825562fb4e474caa7cc641fed9","tests/debug/gen.rs":"e30e2b6c61feb15abe11cee86c4edff9f7e7c9c79080447d44be97869c9a3adb","tests/debug/mod.rs":"868763d0ef1609a3ad5e05e9f1bfa0f813e91e7e9a36653414a188bb2fdaa425","tests/macros/mod.rs":"a93136b172377ffebe8b68fd596a86d6625f64ed6c3d5e7f5d6ad859e25d5623","tests/repo/mod.rs":"38cac869959e1b8b2263de15ca1ed6a6f3845f66412797cccb04d84356bd315e","tests/repo/progress.rs":"c08d0314a7f3ecf760d471f27da3cd2a500aeb9f1c8331bffb2aa648f9fabf3f","tests/test_asyncness.rs":"cff01db49d28ab23b0b258bc6c0a5cc4071be4fe7248eef344a5d79d2fb649b7","tests/test_attribute.rs":"0ffd99384e1a52ae17d9fed5c4053e411e8f9018decef07ffa621d1faa7329d8","tests/test_derive_input.rs":"610444351e3bf99366976bbf1da109c334a70ac9500caef366bcf9b68819829f","tests/test_expr.rs":"0ee83f6f6de950018c043efcc3e85776b4227dae3068309998a8d9709f2fc66c","tests/test_generics.rs":"9d713f90a79d6145efc89fb6f946029ca03486c632219950889da39940152ba0","tests/test_grouping.rs":"6276c3c73bba649dec5c97904ad2492879f918bc887a2c425d095c654ca0d925","tests/test_ident.rs":"9eb53d1e21edf23e7c9e14dc74dcc2b2538e9221e19dbcc0a44e3acc2e90f3f6","tests/test_item.rs":"4420ccd47fadbe6a5a5bc4d2284a6ff3124d0a89bea2aaab5ba198faf5eb01bb","tests/test_iterators.rs":"53ed6078d37550bd6765d2411e3660be401aef8a31a407350cc064a7d08c7c33","tests/test_lit.rs":"ef3f39da6ed67ba73b05eab3dda299887a455bac8e97701a90a94b636681588f","tests/test_meta.rs":"bd6910ec0eba05e814dad27dda0ea65e1f8b483e64d943213066ffd114a82b45","tests/test_parse_buffer.rs":"8bbe2d24ca8a3788f72c6908fc96c26d546f11c69687bf8d72727f851d5e2d27","tests/test_parse_stream.rs":"2f449a2c41a3dee6fd14bee24e1666a453cb808eda17332fd91afd127fcdd2a6","tests/test_pat.rs":"d4465f4fc3fd5d6e534ba8efabe1e0ed6da89de4ac7c96effa6bfb880c4287cf","tests/test_path.rs":"13ae78e958f0d7334d11f32519f593968e5503d46e29ec345feede025f16113d","tests/test_precedence.rs":"cd979febe0b00efcc6baf397a7ff573b03c849c1dd92a282ae9af6627acf6760","tests/test_receiver.rs":"084eca59984b9a18651da52f2c4407355da3de1335916a12477652999e2d01cc","tests/test_round_trip.rs":"e5a9e8c546f43fba741028716f1f34596822accdbc52d0eccb92f98d98bad804","tests/test_shebang.rs":"f5772cadad5b56e3112cb16308b779f92bce1c3a48091fc9933deb2276a69331","tests/test_should_parse.rs":"1d3535698a446e2755bfc360676bdb161841a1f454cdef6e7556c6d06a95c89d","tests/test_size.rs":"5fae772bab66809d6708232f35cfb4a287882486763b0f763feec2ad79fbb68b","tests/test_stmt.rs":"ff6f6f447f46a52fb544353b7dcd2cd9e60781b297dcc86551bee613beaf2280","tests/test_token_trees.rs":"43e56a701817e3c3bfd0cae54a457dd7a38ccb3ca19da41e2b995fdf20e6ed18","tests/test_ty.rs":"01d33c67a72d0e030736b1be22cea916fde14681ee0253b8183905bccfcc5798","tests/test_visibility.rs":"7456fcb3a6634db509748aededff9c2d8b242d511a3e5ee3022e40b232892704","tests/zzz_stable.rs":"2a862e59cb446235ed99aec0e6ada8e16d3ecc30229b29d825b7c0bbc2602989"},"package":"3ce15dd3ed8aa2f8eeac4716d6ef5ab58b6b9256db41d7e1a0224c2788e8fd87"}
\ No newline at end of file
diff --git a/third_party/cargo/vendor/syn-1.0.58/BUILD.bazel b/third_party/cargo/vendor/syn-1.0.68/BUILD.bazel
similarity index 95%
rename from third_party/cargo/vendor/syn-1.0.58/BUILD.bazel
rename to third_party/cargo/vendor/syn-1.0.68/BUILD.bazel
index 3e0ebcd..e98c175 100644
--- a/third_party/cargo/vendor/syn-1.0.58/BUILD.bazel
+++ b/third_party/cargo/vendor/syn-1.0.68/BUILD.bazel
@@ -62,11 +62,11 @@ rust_library(
         "cargo-raze",
         "manual",
     ],
-    version = "1.0.58",
+    version = "1.0.68",
     # buildifier: leave-alone
     deps = [
-        "//third_party/cargo/vendor/proc-macro2-1.0.24:proc_macro2",
-        "//third_party/cargo/vendor/quote-1.0.8:quote",
+        "//third_party/cargo/vendor/proc-macro2-1.0.26:proc_macro2",
+        "//third_party/cargo/vendor/quote-1.0.9:quote",
         "//third_party/cargo/vendor/unicode-xid-0.2.1:unicode_xid",
     ],
 )
diff --git a/third_party/cargo/vendor/syn-1.0.58/Cargo.toml b/third_party/cargo/vendor/syn-1.0.68/Cargo.toml
similarity index 98%
rename from third_party/cargo/vendor/syn-1.0.58/Cargo.toml
rename to third_party/cargo/vendor/syn-1.0.68/Cargo.toml
index 90eccd0..fa4c9f0 100644
--- a/third_party/cargo/vendor/syn-1.0.58/Cargo.toml
+++ b/third_party/cargo/vendor/syn-1.0.68/Cargo.toml
@@ -13,7 +13,7 @@
 [package]
 edition = "2018"
 name = "syn"
-version = "1.0.58"
+version = "1.0.68"
 authors = ["David Tolnay "]
 include = ["/benches/**", "/build.rs", "/Cargo.toml", "/LICENSE-APACHE", "/LICENSE-MIT", "/README.md", "/src/**", "/tests/**"]
 description = "Parser for Rust source code"
@@ -39,7 +39,7 @@ required-features = ["full", "parsing"]
 name = "file"
 required-features = ["full", "parsing"]
 [dependencies.proc-macro2]
-version = "1.0.23"
+version = "1.0.26"
 default-features = false
 
 [dependencies.quote]
diff --git a/third_party/cargo/vendor/syn-1.0.58/LICENSE-APACHE b/third_party/cargo/vendor/syn-1.0.68/LICENSE-APACHE
similarity index 100%
rename from third_party/cargo/vendor/syn-1.0.58/LICENSE-APACHE
rename to third_party/cargo/vendor/syn-1.0.68/LICENSE-APACHE
diff --git a/third_party/cargo/vendor/serde-1.0.118/LICENSE-MIT b/third_party/cargo/vendor/syn-1.0.68/LICENSE-MIT
similarity index 100%
rename from third_party/cargo/vendor/serde-1.0.118/LICENSE-MIT
rename to third_party/cargo/vendor/syn-1.0.68/LICENSE-MIT
diff --git a/third_party/cargo/vendor/syn-1.0.58/README.md b/third_party/cargo/vendor/syn-1.0.68/README.md
similarity index 100%
rename from third_party/cargo/vendor/syn-1.0.58/README.md
rename to third_party/cargo/vendor/syn-1.0.68/README.md
diff --git a/third_party/cargo/vendor/syn-1.0.58/benches/file.rs b/third_party/cargo/vendor/syn-1.0.68/benches/file.rs
similarity index 100%
rename from third_party/cargo/vendor/syn-1.0.58/benches/file.rs
rename to third_party/cargo/vendor/syn-1.0.68/benches/file.rs
diff --git a/third_party/cargo/vendor/syn-1.0.58/benches/rust.rs b/third_party/cargo/vendor/syn-1.0.68/benches/rust.rs
similarity index 100%
rename from third_party/cargo/vendor/syn-1.0.58/benches/rust.rs
rename to third_party/cargo/vendor/syn-1.0.68/benches/rust.rs
diff --git a/third_party/cargo/vendor/syn-1.0.58/build.rs b/third_party/cargo/vendor/syn-1.0.68/build.rs
similarity index 100%
rename from third_party/cargo/vendor/syn-1.0.58/build.rs
rename to third_party/cargo/vendor/syn-1.0.68/build.rs
diff --git a/third_party/cargo/vendor/syn-1.0.58/src/attr.rs b/third_party/cargo/vendor/syn-1.0.68/src/attr.rs
similarity index 99%
rename from third_party/cargo/vendor/syn-1.0.58/src/attr.rs
rename to third_party/cargo/vendor/syn-1.0.68/src/attr.rs
index 1d82190..794a310 100644
--- a/third_party/cargo/vendor/syn-1.0.58/src/attr.rs
+++ b/third_party/cargo/vendor/syn-1.0.68/src/attr.rs
@@ -530,7 +530,7 @@ pub mod parsing {
 
     #[cfg(feature = "full")]
     impl private {
-        pub fn attrs(outer: Vec, inner: Vec) -> Vec {
+        pub(crate) fn attrs(outer: Vec, inner: Vec) -> Vec {
             let mut attrs = outer;
             attrs.extend(inner);
             attrs
diff --git a/third_party/cargo/vendor/syn-1.0.58/src/await.rs b/third_party/cargo/vendor/syn-1.0.68/src/await.rs
similarity index 100%
rename from third_party/cargo/vendor/syn-1.0.58/src/await.rs
rename to third_party/cargo/vendor/syn-1.0.68/src/await.rs
diff --git a/third_party/cargo/vendor/syn-1.0.58/src/bigint.rs b/third_party/cargo/vendor/syn-1.0.68/src/bigint.rs
similarity index 100%
rename from third_party/cargo/vendor/syn-1.0.58/src/bigint.rs
rename to third_party/cargo/vendor/syn-1.0.68/src/bigint.rs
diff --git a/third_party/cargo/vendor/syn-1.0.58/src/buffer.rs b/third_party/cargo/vendor/syn-1.0.68/src/buffer.rs
similarity index 100%
rename from third_party/cargo/vendor/syn-1.0.58/src/buffer.rs
rename to third_party/cargo/vendor/syn-1.0.68/src/buffer.rs
diff --git a/third_party/cargo/vendor/syn-1.0.58/src/custom_keyword.rs b/third_party/cargo/vendor/syn-1.0.68/src/custom_keyword.rs
similarity index 99%
rename from third_party/cargo/vendor/syn-1.0.58/src/custom_keyword.rs
rename to third_party/cargo/vendor/syn-1.0.68/src/custom_keyword.rs
index a21842e..69d787e 100644
--- a/third_party/cargo/vendor/syn-1.0.58/src/custom_keyword.rs
+++ b/third_party/cargo/vendor/syn-1.0.68/src/custom_keyword.rs
@@ -198,6 +198,7 @@ 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
diff --git a/third_party/cargo/vendor/syn-1.0.58/src/custom_punctuation.rs b/third_party/cargo/vendor/syn-1.0.68/src/custom_punctuation.rs
similarity index 99%
rename from third_party/cargo/vendor/syn-1.0.58/src/custom_punctuation.rs
rename to third_party/cargo/vendor/syn-1.0.68/src/custom_punctuation.rs
index 128185d..118a845 100644
--- a/third_party/cargo/vendor/syn-1.0.58/src/custom_punctuation.rs
+++ b/third_party/cargo/vendor/syn-1.0.68/src/custom_punctuation.rs
@@ -169,6 +169,7 @@ 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
diff --git a/third_party/cargo/vendor/syn-1.0.58/src/data.rs b/third_party/cargo/vendor/syn-1.0.68/src/data.rs
similarity index 100%
rename from third_party/cargo/vendor/syn-1.0.58/src/data.rs
rename to third_party/cargo/vendor/syn-1.0.68/src/data.rs
diff --git a/third_party/cargo/vendor/syn-1.0.58/src/derive.rs b/third_party/cargo/vendor/syn-1.0.68/src/derive.rs
similarity index 100%
rename from third_party/cargo/vendor/syn-1.0.58/src/derive.rs
rename to third_party/cargo/vendor/syn-1.0.68/src/derive.rs
diff --git a/third_party/cargo/vendor/syn-1.0.58/src/discouraged.rs b/third_party/cargo/vendor/syn-1.0.68/src/discouraged.rs
similarity index 100%
rename from third_party/cargo/vendor/syn-1.0.58/src/discouraged.rs
rename to third_party/cargo/vendor/syn-1.0.68/src/discouraged.rs
diff --git a/third_party/cargo/vendor/syn-1.0.58/src/error.rs b/third_party/cargo/vendor/syn-1.0.68/src/error.rs
similarity index 99%
rename from third_party/cargo/vendor/syn-1.0.58/src/error.rs
rename to third_party/cargo/vendor/syn-1.0.68/src/error.rs
index 6051f3b..780731c 100644
--- a/third_party/cargo/vendor/syn-1.0.58/src/error.rs
+++ b/third_party/cargo/vendor/syn-1.0.68/src/error.rs
@@ -349,7 +349,7 @@ impl std::error::Error for Error {}
 
 impl From for Error {
     fn from(err: LexError) -> Self {
-        Error::new(Span::call_site(), format!("{:?}", err))
+        Error::new(err.span(), "lex error")
     }
 }
 
diff --git a/third_party/cargo/vendor/syn-1.0.58/src/export.rs b/third_party/cargo/vendor/syn-1.0.68/src/export.rs
similarity index 96%
rename from third_party/cargo/vendor/syn-1.0.58/src/export.rs
rename to third_party/cargo/vendor/syn-1.0.68/src/export.rs
index 37dc467..601a214 100644
--- a/third_party/cargo/vendor/syn-1.0.58/src/export.rs
+++ b/third_party/cargo/vendor/syn-1.0.68/src/export.rs
@@ -33,3 +33,5 @@ mod help {
     pub type Bool = bool;
     pub type Str = str;
 }
+
+pub struct private(pub(crate) ());
diff --git a/third_party/cargo/vendor/syn-1.0.58/src/expr.rs b/third_party/cargo/vendor/syn-1.0.68/src/expr.rs
similarity index 94%
rename from third_party/cargo/vendor/syn-1.0.58/src/expr.rs
rename to third_party/cargo/vendor/syn-1.0.68/src/expr.rs
index 8417475..d065747 100644
--- a/third_party/cargo/vendor/syn-1.0.58/src/expr.rs
+++ b/third_party/cargo/vendor/syn-1.0.68/src/expr.rs
@@ -224,8 +224,31 @@ ast_enum_of_structs! {
         /// A yield expression: `yield expr`.
         Yield(ExprYield),
 
+        // The following is the only supported idiom for exhaustive matching of
+        // this enum.
+        //
+        //     match expr {
+        //         Expr::Array(e) => {...}
+        //         Expr::Assign(e) => {...}
+        //         ...
+        //         Expr::Yield(e) => {...}
+        //
+        //         #[cfg(test)]
+        //         Expr::__TestExhaustive(_) => unimplemented!(),
+        //         #[cfg(not(test))]
+        //         _ => { /* 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.
+        //
+        // Once `deny(reachable)` is available in rustc, Expr will be
+        // reimplemented as a non_exhaustive enum.
+        // https://github.com/rust-lang/rust/issues/44109#issuecomment-521781237
         #[doc(hidden)]
-        __Nonexhaustive,
+        __TestExhaustive(crate::private),
     }
 }
 
@@ -804,7 +827,11 @@ impl Expr {
             | Expr::TryBlock(ExprTryBlock { attrs, .. })
             | Expr::Yield(ExprYield { attrs, .. }) => mem::replace(attrs, new),
             Expr::Verbatim(_) => Vec::new(),
-            Expr::__Nonexhaustive => unreachable!(),
+
+            #[cfg(test)]
+            Expr::__TestExhaustive(_) => unimplemented!(),
+            #[cfg(not(test))]
+            _ => unreachable!(),
         }
     }
 }
@@ -1395,7 +1422,9 @@ pub(crate) mod parsing {
             Precedence::Assign
         } else if input.peek(Token![..]) {
             Precedence::Range
-        } else if input.peek(Token![as]) || input.peek(Token![:]) && !input.peek(Token![::]) {
+        } else if input.peek(Token![as])
+            || cfg!(feature = "full") && input.peek(Token![:]) && !input.peek(Token![::])
+        {
             Precedence::Cast
         } else {
             Precedence::Any
@@ -1676,9 +1705,9 @@ pub(crate) mod parsing {
         } else if input.peek(Token![async])
             && (input.peek2(token::Brace) || input.peek2(Token![move]) && input.peek3(token::Brace))
         {
-            input.call(expr_async).map(Expr::Async)
+            input.parse().map(Expr::Async)
         } else if input.peek(Token![try]) && input.peek2(token::Brace) {
-            input.call(expr_try_block).map(Expr::TryBlock)
+            input.parse().map(Expr::TryBlock)
         } else if input.peek(Token![|])
             || input.peek(Token![async]) && (input.peek2(Token![|]) || input.peek2(Token![move]))
             || input.peek(Token![static])
@@ -1719,11 +1748,11 @@ pub(crate) mod parsing {
         } else if input.peek(Token![yield]) {
             input.call(expr_yield).map(Expr::Yield)
         } else if input.peek(Token![unsafe]) {
-            input.call(expr_unsafe).map(Expr::Unsafe)
+            input.parse().map(Expr::Unsafe)
         } else if input.peek(Token![const]) {
             input.call(expr_const).map(Expr::Verbatim)
         } else if input.peek(token::Brace) {
-            input.call(expr_block).map(Expr::Block)
+            input.parse().map(Expr::Block)
         } else if input.peek(Token![..]) {
             expr_range(input, allow_struct).map(Expr::Range)
         } else if input.peek(Token![_]) {
@@ -1739,7 +1768,7 @@ pub(crate) mod parsing {
             } else if input.peek(Token![loop]) {
                 Expr::Loop(input.parse()?)
             } else if input.peek(token::Brace) {
-                Expr::Block(input.call(expr_block)?)
+                Expr::Block(input.parse()?)
             } else {
                 return Err(input.error("expected loop or block expression"));
             };
@@ -1761,7 +1790,7 @@ pub(crate) mod parsing {
         if input.peek(Lit) {
             input.parse().map(Expr::Lit)
         } else if input.peek(token::Paren) {
-            input.call(expr_paren).map(Expr::Paren)
+            input.parse().map(Expr::Paren)
         } else if input.peek(Ident)
             || input.peek(Token![::])
             || input.peek(Token![<])
@@ -1817,6 +1846,17 @@ pub(crate) mod parsing {
         }
     }
 
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprMacro {
+        fn parse(input: ParseStream) -> Result {
+            Ok(ExprMacro {
+                attrs: Vec::new(),
+                mac: input.parse()?,
+            })
+        }
+    }
+
     #[cfg(feature = "full")]
     fn paren_or_tuple(input: ParseStream) -> Result {
         let content;
@@ -1903,6 +1943,48 @@ pub(crate) mod parsing {
         }
     }
 
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprArray {
+        fn parse(input: ParseStream) -> Result {
+            let content;
+            let bracket_token = bracketed!(content in input);
+            let inner_attrs = content.call(Attribute::parse_inner)?;
+            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: inner_attrs,
+                bracket_token,
+                elems,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprRepeat {
+        fn parse(input: ParseStream) -> Result {
+            let content;
+            Ok(ExprRepeat {
+                bracket_token: bracketed!(content in input),
+                attrs: content.call(Attribute::parse_inner)?,
+                expr: content.parse()?,
+                semi_token: content.parse()?,
+                len: content.parse()?,
+            })
+        }
+    }
+
     #[cfg(feature = "full")]
     pub(crate) fn expr_early(input: ParseStream) -> Result {
         let mut attrs = input.call(expr_attrs)?;
@@ -1917,13 +1999,13 @@ pub(crate) mod parsing {
         } else if input.peek(Token![match]) {
             Expr::Match(input.parse()?)
         } else if input.peek(Token![try]) && input.peek2(token::Brace) {
-            Expr::TryBlock(input.call(expr_try_block)?)
+            Expr::TryBlock(input.parse()?)
         } else if input.peek(Token![unsafe]) {
-            Expr::Unsafe(input.call(expr_unsafe)?)
+            Expr::Unsafe(input.parse()?)
         } else if input.peek(Token![const]) {
             Expr::Verbatim(input.call(expr_const)?)
         } else if input.peek(token::Brace) {
-            Expr::Block(input.call(expr_block)?)
+            Expr::Block(input.parse()?)
         } else {
             let allow_struct = AllowStruct(true);
             let mut expr = unary_expr(input, allow_struct)?;
@@ -1969,14 +2051,16 @@ pub(crate) mod parsing {
         })
     }
 
-    #[cfg(not(feature = "full"))]
-    fn expr_paren(input: ParseStream) -> Result {
-        let content;
-        Ok(ExprParen {
-            attrs: Vec::new(),
-            paren_token: parenthesized!(content in input),
-            expr: content.parse()?,
-        })
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprParen {
+        fn parse(input: ParseStream) -> Result {
+            let content;
+            Ok(ExprParen {
+                attrs: Vec::new(),
+                paren_token: parenthesized!(content in input),
+                expr: content.parse()?,
+            })
+        }
     }
 
     #[cfg(feature = "full")]
@@ -1987,7 +2071,7 @@ pub(crate) mod parsing {
         }
 
         if input.peek(token::Brace) {
-            let block = input.call(expr::parsing::expr_block)?;
+            let block: ExprBlock = input.parse()?;
             return Ok(GenericMethodArgument::Const(Expr::Block(block)));
         }
 
@@ -2152,7 +2236,6 @@ pub(crate) mod parsing {
 
     impl_by_parsing_expr! {
         ExprBox, Box, "expected box expression",
-        ExprArray, Array, "expected slice literal expression",
         ExprCall, Call, "expected function call expression",
         ExprMethodCall, MethodCall, "expected method call expression",
         ExprTuple, Tuple, "expected tuple expression",
@@ -2162,8 +2245,6 @@ pub(crate) mod parsing {
         ExprType, Type, "expected type ascription expression",
         ExprLet, Let, "expected let guard",
         ExprClosure, Closure, "expected closure expression",
-        ExprUnsafe, Unsafe, "expected unsafe block",
-        ExprBlock, Block, "expected blocked scope",
         ExprAssign, Assign, "expected assignment expression",
         ExprAssignOp, AssignOp, "expected compound assignment expression",
         ExprField, Field, "expected struct field access",
@@ -2173,23 +2254,20 @@ pub(crate) mod parsing {
         ExprBreak, Break, "expected break expression",
         ExprContinue, Continue, "expected continue expression",
         ExprReturn, Return, "expected return expression",
-        ExprMacro, Macro, "expected macro invocation expression",
-        ExprStruct, Struct, "expected struct literal expression",
-        ExprRepeat, Repeat, "expected array literal constructed from one repeated element",
-        ExprParen, Paren, "expected parenthesized expression",
         ExprTry, Try, "expected try expression",
-        ExprAsync, Async, "expected async block",
-        ExprTryBlock, TryBlock, "expected try block",
         ExprYield, Yield, "expected yield expression",
     }
 
     #[cfg(feature = "full")]
-    fn expr_try_block(input: ParseStream) -> Result {
-        Ok(ExprTryBlock {
-            attrs: Vec::new(),
-            try_token: input.parse()?,
-            block: input.parse()?,
-        })
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprTryBlock {
+        fn parse(input: ParseStream) -> Result {
+            Ok(ExprTryBlock {
+                attrs: Vec::new(),
+                try_token: input.parse()?,
+                block: input.parse()?,
+            })
+        }
     }
 
     #[cfg(feature = "full")]
@@ -2264,13 +2342,16 @@ pub(crate) mod parsing {
     }
 
     #[cfg(feature = "full")]
-    fn expr_async(input: ParseStream) -> Result {
-        Ok(ExprAsync {
-            attrs: Vec::new(),
-            async_token: input.parse()?,
-            capture: input.parse()?,
-            block: input.parse()?,
-        })
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprAsync {
+        fn parse(input: ParseStream) -> Result {
+            Ok(ExprAsync {
+                attrs: Vec::new(),
+                async_token: input.parse()?,
+                capture: input.parse()?,
+                block: input.parse()?,
+            })
+        }
     }
 
     #[cfg(feature = "full")]
@@ -2303,7 +2384,11 @@ pub(crate) mod parsing {
                 Pat::Type(_) => unreachable!(),
                 Pat::Verbatim(_) => {}
                 Pat::Wild(pat) => pat.attrs = attrs,
-                Pat::__Nonexhaustive => unreachable!(),
+
+                #[cfg(test)]
+                Pat::__TestExhaustive(_) => unimplemented!(),
+                #[cfg(not(test))]
+                _ => unreachable!(),
             }
             Ok(pat)
         }
@@ -2437,6 +2522,16 @@ pub(crate) mod parsing {
         }
     }
 
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprStruct {
+        fn parse(input: ParseStream) -> Result {
+            let attrs = Vec::new();
+            let path: Path = input.parse()?;
+            expr_struct_helper(input, attrs, path)
+        }
+    }
+
     #[cfg(feature = "full")]
     fn expr_struct_helper(
         input: ParseStream,
@@ -2484,19 +2579,22 @@ pub(crate) mod parsing {
     }
 
     #[cfg(feature = "full")]
-    fn expr_unsafe(input: ParseStream) -> Result {
-        let unsafe_token: Token![unsafe] = input.parse()?;
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprUnsafe {
+        fn parse(input: ParseStream) -> Result {
+            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)?;
+            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 },
-        })
+            Ok(ExprUnsafe {
+                attrs: inner_attrs,
+                unsafe_token,
+                block: Block { brace_token, stmts },
+            })
+        }
     }
 
     #[cfg(feature = "full")]
@@ -2513,19 +2611,23 @@ pub(crate) mod parsing {
     }
 
     #[cfg(feature = "full")]
-    pub fn expr_block(input: ParseStream) -> Result {
-        let label: Option