html-to-markdown 2.24.4 → 2.24.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -6
- data/README.md +1 -1
- data/ext/html-to-markdown-rb/native/Cargo.lock +254 -47
- data/ext/html-to-markdown-rb/native/Cargo.toml +1 -1
- data/lib/html_to_markdown/version.rb +1 -1
- data/rust-vendor/anyhow/.cargo-checksum.json +1 -0
- data/rust-vendor/anyhow/.cargo_vcs_info.json +6 -0
- data/rust-vendor/anyhow/.github/FUNDING.yml +1 -0
- data/rust-vendor/anyhow/.github/workflows/ci.yml +147 -0
- data/rust-vendor/anyhow/Cargo.lock +424 -0
- data/rust-vendor/anyhow/Cargo.toml +132 -0
- data/rust-vendor/anyhow/Cargo.toml.orig +40 -0
- data/rust-vendor/anyhow/LICENSE-APACHE +176 -0
- data/rust-vendor/anyhow/LICENSE-MIT +23 -0
- data/rust-vendor/anyhow/README.md +179 -0
- data/rust-vendor/anyhow/build.rs +207 -0
- data/rust-vendor/anyhow/rust-toolchain.toml +2 -0
- data/rust-vendor/anyhow/src/backtrace.rs +410 -0
- data/rust-vendor/anyhow/src/chain.rs +102 -0
- data/rust-vendor/anyhow/src/context.rs +193 -0
- data/rust-vendor/anyhow/src/ensure.rs +935 -0
- data/rust-vendor/anyhow/src/error.rs +1086 -0
- data/rust-vendor/anyhow/src/fmt.rs +158 -0
- data/rust-vendor/anyhow/src/kind.rs +121 -0
- data/rust-vendor/anyhow/src/lib.rs +728 -0
- data/rust-vendor/anyhow/src/macros.rs +245 -0
- data/rust-vendor/anyhow/src/nightly.rs +58 -0
- data/rust-vendor/anyhow/src/ptr.rs +187 -0
- data/rust-vendor/anyhow/src/wrapper.rs +84 -0
- data/rust-vendor/anyhow/tests/common/mod.rs +14 -0
- data/rust-vendor/anyhow/tests/compiletest.rs +7 -0
- data/rust-vendor/anyhow/tests/drop/mod.rs +53 -0
- data/rust-vendor/anyhow/tests/test_autotrait.rs +34 -0
- data/rust-vendor/anyhow/tests/test_backtrace.rs +15 -0
- data/rust-vendor/anyhow/tests/test_boxed.rs +45 -0
- data/rust-vendor/anyhow/tests/test_chain.rs +69 -0
- data/rust-vendor/anyhow/tests/test_context.rs +172 -0
- data/rust-vendor/anyhow/tests/test_convert.rs +46 -0
- data/rust-vendor/anyhow/tests/test_downcast.rs +123 -0
- data/rust-vendor/anyhow/tests/test_ensure.rs +756 -0
- data/rust-vendor/anyhow/tests/test_ffi.rs +19 -0
- data/rust-vendor/anyhow/tests/test_fmt.rs +93 -0
- data/rust-vendor/anyhow/tests/test_macros.rs +97 -0
- data/rust-vendor/anyhow/tests/test_repr.rs +30 -0
- data/rust-vendor/anyhow/tests/test_source.rs +62 -0
- data/rust-vendor/anyhow/tests/ui/chained-comparison.rs +8 -0
- data/rust-vendor/anyhow/tests/ui/chained-comparison.stderr +10 -0
- data/rust-vendor/anyhow/tests/ui/empty-ensure.rs +6 -0
- data/rust-vendor/anyhow/tests/ui/empty-ensure.stderr +12 -0
- data/rust-vendor/anyhow/tests/ui/ensure-nonbool.rs +40 -0
- data/rust-vendor/anyhow/tests/ui/ensure-nonbool.stderr +113 -0
- data/rust-vendor/anyhow/tests/ui/must-use.rs +11 -0
- data/rust-vendor/anyhow/tests/ui/must-use.stderr +15 -0
- data/rust-vendor/anyhow/tests/ui/no-impl.rs +8 -0
- data/rust-vendor/anyhow/tests/ui/no-impl.stderr +32 -0
- data/rust-vendor/anyhow/tests/ui/temporary-value.rs +5 -0
- data/rust-vendor/anyhow/tests/ui/temporary-value.stderr +15 -0
- data/rust-vendor/anyhow/tests/ui/wrong-interpolation.rs +5 -0
- data/rust-vendor/anyhow/tests/ui/wrong-interpolation.stderr +5 -0
- data/rust-vendor/bitflags/.cargo-checksum.json +1 -1
- data/rust-vendor/bitflags/.cargo_vcs_info.json +1 -1
- data/rust-vendor/bitflags/CHANGELOG.md +12 -0
- data/rust-vendor/bitflags/Cargo.lock +48 -48
- data/rust-vendor/bitflags/Cargo.toml +1 -1
- data/rust-vendor/bitflags/Cargo.toml.orig +1 -1
- data/rust-vendor/bitflags/README.md +1 -1
- data/rust-vendor/bitflags/src/external.rs +1 -1
- data/rust-vendor/bitflags/src/lib.rs +1 -1
- data/rust-vendor/bitflags/src/tests/known_bits.rs +47 -0
- data/rust-vendor/bitflags/src/tests/unknown_bits.rs +53 -0
- data/rust-vendor/bitflags/src/tests.rs +2 -0
- data/rust-vendor/bitflags/src/traits.rs +11 -1
- data/rust-vendor/cc/.cargo-checksum.json +1 -1
- data/rust-vendor/cc/.cargo_vcs_info.json +1 -1
- data/rust-vendor/cc/CHANGELOG.md +7 -0
- data/rust-vendor/cc/Cargo.lock +331 -7
- data/rust-vendor/cc/Cargo.toml +1 -1
- data/rust-vendor/cc/Cargo.toml.orig +1 -1
- data/rust-vendor/cc/src/lib.rs +10 -13
- data/rust-vendor/cc/src/target/generated.rs +1 -0
- data/rust-vendor/cpp_demangle/.cargo-checksum.json +1 -1
- data/rust-vendor/cpp_demangle/.cargo_vcs_info.json +1 -1
- data/rust-vendor/cpp_demangle/CHANGELOG.md +55 -0
- data/rust-vendor/cpp_demangle/Cargo.lock +5 -5
- data/rust-vendor/cpp_demangle/Cargo.toml +2 -2
- data/rust-vendor/cpp_demangle/Cargo.toml.orig +2 -2
- data/rust-vendor/cpp_demangle/README.md +9 -9
- data/rust-vendor/cpp_demangle/build.rs +10 -9
- data/rust-vendor/cpp_demangle/examples/cppfilt.rs +1 -1
- data/rust-vendor/cpp_demangle/examples/simple.rs +1 -1
- data/rust-vendor/cpp_demangle/src/ast.rs +238 -36
- data/rust-vendor/cpp_demangle/src/lib.rs +31 -46
- data/rust-vendor/cpp_demangle/src/subs.rs +1 -1
- data/rust-vendor/flate2/.cargo-checksum.json +1 -1
- data/rust-vendor/flate2/.cargo_vcs_info.json +1 -1
- data/rust-vendor/flate2/Cargo.lock +3 -3
- data/rust-vendor/flate2/Cargo.toml +13 -2
- data/rust-vendor/flate2/Cargo.toml.orig +16 -13
- data/rust-vendor/flate2/LICENSE-MIT +1 -1
- data/rust-vendor/flate2/src/crc.rs +177 -42
- data/rust-vendor/flate2/src/gz/mod.rs +159 -0
- data/rust-vendor/foldhash-0.1.5/.cargo-checksum.json +1 -0
- data/rust-vendor/foldhash-0.1.5/.cargo_vcs_info.json +6 -0
- data/rust-vendor/foldhash-0.1.5/Cargo.lock +852 -0
- data/rust-vendor/foldhash-0.1.5/Cargo.toml +76 -0
- data/rust-vendor/foldhash-0.1.5/Cargo.toml.orig +44 -0
- data/rust-vendor/foldhash-0.1.5/LICENSE +19 -0
- data/rust-vendor/foldhash-0.1.5/README.md +277 -0
- data/rust-vendor/foldhash-0.1.5/src/convenience.rs +73 -0
- data/rust-vendor/foldhash-0.1.5/src/fast.rs +270 -0
- data/rust-vendor/foldhash-0.1.5/src/lib.rs +284 -0
- data/rust-vendor/foldhash-0.1.5/src/quality.rs +174 -0
- data/rust-vendor/foldhash-0.1.5/src/seed.rs +267 -0
- data/rust-vendor/getrandom/.cargo-checksum.json +1 -1
- data/rust-vendor/getrandom/.cargo_vcs_info.json +1 -1
- data/rust-vendor/getrandom/CHANGELOG.md +39 -1
- data/rust-vendor/getrandom/Cargo.lock +451 -60
- data/rust-vendor/getrandom/Cargo.toml +44 -5
- data/rust-vendor/getrandom/Cargo.toml.orig +45 -10
- data/rust-vendor/getrandom/LICENSE-MIT +1 -1
- data/rust-vendor/getrandom/README.md +72 -40
- data/rust-vendor/getrandom/benches/buffer.rs +10 -8
- data/rust-vendor/getrandom/build.rs +1 -47
- data/rust-vendor/getrandom/src/backends/custom.rs +1 -1
- data/rust-vendor/getrandom/src/backends/efi_rng.rs +1 -1
- data/rust-vendor/getrandom/src/backends/esp_idf.rs +1 -1
- data/rust-vendor/getrandom/src/backends/extern_impl.rs +19 -0
- data/rust-vendor/getrandom/src/backends/fuchsia.rs +1 -1
- data/rust-vendor/getrandom/src/backends/getentropy.rs +4 -3
- data/rust-vendor/getrandom/src/backends/getrandom.rs +4 -12
- data/rust-vendor/getrandom/src/backends/hermit.rs +1 -1
- data/rust-vendor/getrandom/src/backends/linux_android_with_fallback.rs +8 -10
- data/rust-vendor/getrandom/src/backends/linux_raw.rs +101 -75
- data/rust-vendor/getrandom/src/backends/netbsd.rs +3 -3
- data/rust-vendor/getrandom/src/backends/rdrand.rs +26 -13
- data/rust-vendor/getrandom/src/backends/rndr.rs +13 -11
- data/rust-vendor/getrandom/src/backends/solaris.rs +5 -4
- data/rust-vendor/getrandom/src/backends/solid.rs +1 -1
- data/rust-vendor/getrandom/src/backends/use_file.rs +17 -28
- data/rust-vendor/getrandom/src/backends/vxworks.rs +2 -4
- data/rust-vendor/getrandom/src/backends/wasi_p1.rs +1 -1
- data/rust-vendor/getrandom/src/backends/wasi_p2_3.rs +61 -0
- data/rust-vendor/getrandom/src/backends/wasm_js.rs +1 -1
- data/rust-vendor/getrandom/src/backends/windows.rs +7 -11
- data/rust-vendor/getrandom/src/backends/windows_legacy.rs +1 -1
- data/rust-vendor/getrandom/src/backends.rs +9 -28
- data/rust-vendor/getrandom/src/error.rs +39 -6
- data/rust-vendor/getrandom/src/error_std_impls.rs +1 -3
- data/rust-vendor/getrandom/src/lib.rs +39 -18
- data/rust-vendor/getrandom/src/sys_rng.rs +55 -0
- data/rust-vendor/getrandom/src/util.rs +3 -15
- data/rust-vendor/getrandom/src/utils/get_errno.rs +29 -0
- data/rust-vendor/getrandom/src/utils/lazy.rs +64 -0
- data/rust-vendor/getrandom/src/utils/sanitizer.rs +28 -0
- data/rust-vendor/getrandom/src/utils/sys_fill_exact.rs +41 -0
- data/rust-vendor/getrandom/tests/mod.rs +6 -94
- data/rust-vendor/getrandom/tests/sys_rng.rs +18 -0
- data/rust-vendor/getrandom-0.3.4/.cargo-checksum.json +1 -0
- data/rust-vendor/getrandom-0.3.4/.cargo_vcs_info.json +6 -0
- data/rust-vendor/getrandom-0.3.4/CHANGELOG.md +673 -0
- data/rust-vendor/getrandom-0.3.4/Cargo.lock +292 -0
- data/rust-vendor/getrandom-0.3.4/Cargo.toml +133 -0
- data/rust-vendor/getrandom-0.3.4/Cargo.toml.orig +100 -0
- data/rust-vendor/getrandom-0.3.4/LICENSE-APACHE +201 -0
- data/rust-vendor/getrandom-0.3.4/LICENSE-MIT +26 -0
- data/rust-vendor/getrandom-0.3.4/README.md +386 -0
- data/rust-vendor/getrandom-0.3.4/SECURITY.md +13 -0
- data/rust-vendor/getrandom-0.3.4/benches/buffer.rs +121 -0
- data/rust-vendor/getrandom-0.3.4/build.rs +57 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/apple_other.rs +21 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/custom.rs +13 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/efi_rng.rs +124 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/esp_idf.rs +21 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/fuchsia.rs +16 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/getentropy.rs +27 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/getrandom.rs +39 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/hermit.rs +53 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/linux_android_with_fallback.rs +103 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/linux_raw.rs +143 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/netbsd.rs +78 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/rdrand.rs +182 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/rndr.rs +145 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/solaris.rs +42 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/solid.rs +19 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/unsupported.rs +9 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/use_file.rs +234 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/vxworks.rs +54 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/wasi_p1.rs +32 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/wasm_js.rs +72 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/windows.rs +61 -0
- data/rust-vendor/getrandom-0.3.4/src/backends/windows_legacy.rs +48 -0
- data/rust-vendor/getrandom-0.3.4/src/backends.rs +209 -0
- data/rust-vendor/getrandom-0.3.4/src/error.rs +212 -0
- data/rust-vendor/getrandom-0.3.4/src/error_std_impls.rs +15 -0
- data/rust-vendor/getrandom-0.3.4/src/lib.rs +138 -0
- data/rust-vendor/getrandom-0.3.4/src/util.rs +84 -0
- data/rust-vendor/getrandom-0.3.4/tests/mod.rs +297 -0
- data/rust-vendor/hashbrown-0.15.5/.cargo-checksum.json +1 -0
- data/rust-vendor/hashbrown-0.15.5/.cargo_vcs_info.json +6 -0
- data/rust-vendor/hashbrown-0.15.5/CHANGELOG.md +619 -0
- data/rust-vendor/hashbrown-0.15.5/Cargo.lock +306 -0
- data/rust-vendor/hashbrown-0.15.5/Cargo.toml +164 -0
- data/rust-vendor/hashbrown-0.15.5/Cargo.toml.orig +77 -0
- data/rust-vendor/hashbrown-0.15.5/Cross.toml +3 -0
- data/rust-vendor/hashbrown-0.15.5/LICENSE-APACHE +201 -0
- data/rust-vendor/hashbrown-0.15.5/LICENSE-MIT +25 -0
- data/rust-vendor/hashbrown-0.15.5/README.md +80 -0
- data/rust-vendor/hashbrown-0.15.5/benches/bench.rs +329 -0
- data/rust-vendor/hashbrown-0.15.5/benches/insert_unique_unchecked.rs +34 -0
- data/rust-vendor/hashbrown-0.15.5/benches/set_ops.rs +148 -0
- data/rust-vendor/hashbrown-0.15.5/clippy.toml +1 -0
- data/rust-vendor/hashbrown-0.15.5/src/control/bitmask.rs +117 -0
- data/rust-vendor/hashbrown-0.15.5/src/control/group/generic.rs +154 -0
- data/rust-vendor/hashbrown-0.15.5/src/control/group/lsx.rs +137 -0
- data/rust-vendor/hashbrown-0.15.5/src/control/group/mod.rs +43 -0
- data/rust-vendor/hashbrown-0.15.5/src/control/group/neon.rs +121 -0
- data/rust-vendor/hashbrown-0.15.5/src/control/group/sse2.rs +146 -0
- data/rust-vendor/hashbrown-0.15.5/src/control/mod.rs +10 -0
- data/rust-vendor/hashbrown-0.15.5/src/control/tag.rs +83 -0
- data/rust-vendor/hashbrown-0.15.5/src/external_trait_impls/mod.rs +4 -0
- data/rust-vendor/hashbrown-0.15.5/src/external_trait_impls/rayon/helpers.rs +27 -0
- data/rust-vendor/hashbrown-0.15.5/src/external_trait_impls/rayon/map.rs +721 -0
- data/rust-vendor/hashbrown-0.15.5/src/external_trait_impls/rayon/mod.rs +5 -0
- data/rust-vendor/hashbrown-0.15.5/src/external_trait_impls/rayon/raw.rs +230 -0
- data/rust-vendor/hashbrown-0.15.5/src/external_trait_impls/rayon/set.rs +659 -0
- data/rust-vendor/hashbrown-0.15.5/src/external_trait_impls/rayon/table.rs +249 -0
- data/rust-vendor/hashbrown-0.15.5/src/external_trait_impls/serde.rs +220 -0
- data/rust-vendor/hashbrown-0.15.5/src/lib.rs +188 -0
- data/rust-vendor/hashbrown-0.15.5/src/macros.rs +70 -0
- data/rust-vendor/hashbrown-0.15.5/src/map.rs +6583 -0
- data/rust-vendor/hashbrown-0.15.5/src/raw/alloc.rs +92 -0
- data/rust-vendor/hashbrown-0.15.5/src/raw/mod.rs +4436 -0
- data/rust-vendor/hashbrown-0.15.5/src/raw_entry.rs +1740 -0
- data/rust-vendor/hashbrown-0.15.5/src/rustc_entry.rs +567 -0
- data/rust-vendor/hashbrown-0.15.5/src/scopeguard.rs +72 -0
- data/rust-vendor/hashbrown-0.15.5/src/set.rs +3121 -0
- data/rust-vendor/hashbrown-0.15.5/src/table.rs +2380 -0
- data/rust-vendor/hashbrown-0.15.5/src/util.rs +38 -0
- data/rust-vendor/hashbrown-0.15.5/tests/equivalent_trait.rs +53 -0
- data/rust-vendor/hashbrown-0.15.5/tests/hasher.rs +65 -0
- data/rust-vendor/hashbrown-0.15.5/tests/rayon.rs +535 -0
- data/rust-vendor/hashbrown-0.15.5/tests/serde.rs +65 -0
- data/rust-vendor/hashbrown-0.15.5/tests/set.rs +34 -0
- data/rust-vendor/heck/.cargo-checksum.json +1 -0
- data/rust-vendor/heck/.cargo_vcs_info.json +6 -0
- data/rust-vendor/heck/CHANGELOG.md +25 -0
- data/rust-vendor/heck/Cargo.toml +34 -0
- data/rust-vendor/heck/Cargo.toml.orig +11 -0
- data/rust-vendor/heck/LICENSE-APACHE +201 -0
- data/rust-vendor/heck/LICENSE-MIT +25 -0
- data/rust-vendor/heck/README.md +53 -0
- data/rust-vendor/heck/src/kebab.rs +75 -0
- data/rust-vendor/heck/src/lib.rs +192 -0
- data/rust-vendor/heck/src/lower_camel.rs +88 -0
- data/rust-vendor/heck/src/shouty_kebab.rs +73 -0
- data/rust-vendor/heck/src/shouty_snake.rs +86 -0
- data/rust-vendor/heck/src/snake.rs +100 -0
- data/rust-vendor/heck/src/title.rs +75 -0
- data/rust-vendor/heck/src/train.rs +87 -0
- data/rust-vendor/heck/src/upper_camel.rs +88 -0
- data/rust-vendor/html-to-markdown-rs/src/converter/inline/semantic/typography.rs +32 -22
- data/rust-vendor/html-to-markdown-rs/tests/integration_test.rs +44 -0
- data/rust-vendor/id-arena/.cargo-checksum.json +1 -0
- data/rust-vendor/id-arena/.cargo_vcs_info.json +6 -0
- data/rust-vendor/id-arena/.travis.yml +22 -0
- data/rust-vendor/id-arena/CHANGELOG.md +71 -0
- data/rust-vendor/id-arena/Cargo.lock +61 -0
- data/rust-vendor/id-arena/Cargo.toml +54 -0
- data/rust-vendor/id-arena/Cargo.toml.orig +21 -0
- data/rust-vendor/id-arena/LICENSE-APACHE +201 -0
- data/rust-vendor/id-arena/LICENSE-MIT +25 -0
- data/rust-vendor/id-arena/README.md +101 -0
- data/rust-vendor/id-arena/README.tpl +3 -0
- data/rust-vendor/id-arena/src/lib.rs +726 -0
- data/rust-vendor/id-arena/src/rayon.rs +282 -0
- data/rust-vendor/id-arena/tests/readme_up_to_date.rs +22 -0
- data/rust-vendor/leb128fmt/.cargo-checksum.json +1 -0
- data/rust-vendor/leb128fmt/.cargo_vcs_info.json +6 -0
- data/rust-vendor/leb128fmt/CHANGELOG.md +11 -0
- data/rust-vendor/leb128fmt/Cargo.toml +55 -0
- data/rust-vendor/leb128fmt/Cargo.toml.orig +32 -0
- data/rust-vendor/leb128fmt/LICENSE-APACHE +201 -0
- data/rust-vendor/leb128fmt/LICENSE-MIT +23 -0
- data/rust-vendor/leb128fmt/README.md +162 -0
- data/rust-vendor/leb128fmt/src/lib.rs +1650 -0
- data/rust-vendor/libc/.cargo-checksum.json +1 -1
- data/rust-vendor/libc/.cargo_vcs_info.json +1 -1
- data/rust-vendor/libc/CHANGELOG.md +42 -0
- data/rust-vendor/libc/Cargo.lock +1 -1
- data/rust-vendor/libc/Cargo.toml +75 -51
- data/rust-vendor/libc/Cargo.toml.orig +85 -53
- data/rust-vendor/libc/LICENSE-MIT +1 -1
- data/rust-vendor/libc/src/fuchsia/mod.rs +12 -10
- data/rust-vendor/libc/src/macros.rs +63 -71
- data/rust-vendor/libc/src/new/linux_uapi/linux/can/error.rs +73 -0
- data/rust-vendor/libc/src/new/linux_uapi/linux/can.rs +1 -0
- data/rust-vendor/libc/src/new/mod.rs +3 -2
- data/rust-vendor/libc/src/new/qurt/dlfcn.rs +26 -0
- data/rust-vendor/libc/src/new/qurt/fcntl.rs +4 -1
- data/rust-vendor/libc/src/new/qurt/mod.rs +224 -14
- data/rust-vendor/libc/src/new/qurt/pthread.rs +1 -22
- data/rust-vendor/libc/src/new/qurt/signal.rs +54 -4
- data/rust-vendor/libc/src/new/qurt/stdio.rs +0 -5
- data/rust-vendor/libc/src/new/qurt/sys/mman.rs +55 -0
- data/rust-vendor/libc/src/new/qurt/sys/mod.rs +2 -0
- data/rust-vendor/libc/src/new/qurt/sys/sched.rs +24 -0
- data/rust-vendor/libc/src/new/qurt/sys/stat.rs +0 -6
- data/rust-vendor/libc/src/new/qurt/time.rs +4 -22
- data/rust-vendor/libc/src/new/qurt/unistd.rs +210 -20
- data/rust-vendor/libc/src/qurt/mod.rs +9 -325
- data/rust-vendor/libc/src/types.rs +2 -2
- data/rust-vendor/libc/src/unix/aix/mod.rs +11 -20
- data/rust-vendor/libc/src/unix/aix/powerpc64.rs +6 -6
- data/rust-vendor/libc/src/unix/bsd/apple/mod.rs +15 -0
- data/rust-vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs +4 -4
- data/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs +3 -3
- data/rust-vendor/libc/src/unix/bsd/freebsdlike/mod.rs +14 -0
- data/rust-vendor/libc/src/unix/bsd/mod.rs +0 -14
- data/rust-vendor/libc/src/unix/bsd/netbsdlike/mod.rs +6 -0
- data/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs +15 -7
- data/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs +41 -1
- data/rust-vendor/libc/src/unix/cygwin/mod.rs +2 -2
- data/rust-vendor/libc/src/unix/haiku/mod.rs +1 -1
- data/rust-vendor/libc/src/unix/haiku/x86_64.rs +2 -2
- data/rust-vendor/libc/src/unix/hurd/mod.rs +6 -6
- data/rust-vendor/libc/src/unix/linux_like/android/mod.rs +2 -0
- data/rust-vendor/libc/src/unix/linux_like/linux/gnu/mod.rs +3 -0
- data/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs +16 -13
- data/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs +12 -13
- data/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs +25 -16
- data/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs +16 -13
- data/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs +12 -15
- data/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs +10 -13
- data/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs +0 -15
- data/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs +0 -15
- data/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs +0 -15
- data/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs +0 -15
- data/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs +0 -15
- data/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs +0 -15
- data/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/wasm32/mod.rs +0 -15
- data/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs +9 -15
- data/rust-vendor/libc/src/unix/mod.rs +87 -11
- data/rust-vendor/libc/src/unix/newlib/arm/mod.rs +1 -1
- data/rust-vendor/libc/src/unix/newlib/horizon/mod.rs +1 -1
- data/rust-vendor/libc/src/unix/newlib/vita/mod.rs +3 -3
- data/rust-vendor/libc/src/unix/nto/mod.rs +23 -6
- data/rust-vendor/libc/src/unix/redox/mod.rs +45 -3
- data/rust-vendor/libc/src/unix/solarish/illumos.rs +2 -0
- data/rust-vendor/libc/src/vxworks/mod.rs +7 -7
- data/rust-vendor/memchr/.cargo-checksum.json +1 -1
- data/rust-vendor/memchr/.cargo_vcs_info.json +1 -1
- data/rust-vendor/memchr/Cargo.lock +13 -13
- data/rust-vendor/memchr/Cargo.toml +1 -1
- data/rust-vendor/memchr/Cargo.toml.orig +1 -1
- data/rust-vendor/memchr/src/cow.rs +3 -1
- data/rust-vendor/memchr/src/memmem/mod.rs +42 -3
- data/rust-vendor/prettyplease/.cargo-checksum.json +1 -0
- data/rust-vendor/prettyplease/.cargo_vcs_info.json +6 -0
- data/rust-vendor/prettyplease/.github/FUNDING.yml +1 -0
- data/rust-vendor/prettyplease/.github/workflows/ci.yml +123 -0
- data/rust-vendor/prettyplease/Cargo.lock +54 -0
- data/rust-vendor/prettyplease/Cargo.toml +90 -0
- data/rust-vendor/prettyplease/Cargo.toml.orig +43 -0
- data/rust-vendor/prettyplease/LICENSE-APACHE +176 -0
- data/rust-vendor/prettyplease/LICENSE-MIT +23 -0
- data/rust-vendor/prettyplease/README.md +312 -0
- data/rust-vendor/prettyplease/build.rs +21 -0
- data/rust-vendor/prettyplease/examples/.tokeignore +1 -0
- data/rust-vendor/prettyplease/examples/input.rs +1 -0
- data/rust-vendor/prettyplease/examples/output.prettyplease.rs +593 -0
- data/rust-vendor/prettyplease/examples/output.rustc.rs +506 -0
- data/rust-vendor/prettyplease/examples/output.rustfmt.rs +552 -0
- data/rust-vendor/prettyplease/src/algorithm.rs +386 -0
- data/rust-vendor/prettyplease/src/attr.rs +288 -0
- data/rust-vendor/prettyplease/src/classify.rs +324 -0
- data/rust-vendor/prettyplease/src/convenience.rs +98 -0
- data/rust-vendor/prettyplease/src/data.rs +79 -0
- data/rust-vendor/prettyplease/src/expr.rs +1533 -0
- data/rust-vendor/prettyplease/src/file.rs +17 -0
- data/rust-vendor/prettyplease/src/fixup.rs +676 -0
- data/rust-vendor/prettyplease/src/generics.rs +426 -0
- data/rust-vendor/prettyplease/src/item.rs +1813 -0
- data/rust-vendor/prettyplease/src/iter.rs +46 -0
- data/rust-vendor/prettyplease/src/lib.rs +385 -0
- data/rust-vendor/prettyplease/src/lifetime.rs +9 -0
- data/rust-vendor/prettyplease/src/lit.rs +57 -0
- data/rust-vendor/prettyplease/src/mac.rs +706 -0
- data/rust-vendor/prettyplease/src/pat.rs +254 -0
- data/rust-vendor/prettyplease/src/path.rs +194 -0
- data/rust-vendor/prettyplease/src/precedence.rs +148 -0
- data/rust-vendor/prettyplease/src/ring.rs +81 -0
- data/rust-vendor/prettyplease/src/stmt.rs +221 -0
- data/rust-vendor/prettyplease/src/token.rs +80 -0
- data/rust-vendor/prettyplease/src/ty.rs +326 -0
- data/rust-vendor/prettyplease/tests/test.rs +51 -0
- data/rust-vendor/prettyplease/tests/test_precedence.rs +900 -0
- data/rust-vendor/regex/.cargo-checksum.json +1 -1
- data/rust-vendor/regex/.cargo_vcs_info.json +1 -1
- data/rust-vendor/regex/CHANGELOG.md +13 -0
- data/rust-vendor/regex/Cargo.lock +5 -5
- data/rust-vendor/regex/Cargo.toml +15 -7
- data/rust-vendor/regex/Cargo.toml.orig +19 -2
- data/rust-vendor/regex-automata/.cargo-checksum.json +1 -1
- data/rust-vendor/regex-automata/.cargo_vcs_info.json +1 -1
- data/rust-vendor/regex-automata/Cargo.lock +3 -3
- data/rust-vendor/regex-automata/Cargo.toml +16 -1
- data/rust-vendor/regex-automata/Cargo.toml.orig +2 -1
- data/rust-vendor/regex-automata/src/dfa/onepass.rs +21 -5
- data/rust-vendor/regex-automata/tests/dfa/onepass/mod.rs +1 -0
- data/rust-vendor/regex-automata/tests/dfa/onepass/regression.rs +61 -0
- data/rust-vendor/regex-automata/tests/nfa/thompson/backtrack/mod.rs +1 -0
- data/rust-vendor/regex-automata/tests/nfa/thompson/backtrack/regression.rs +20 -0
- data/rust-vendor/regex-automata/tests/nfa/thompson/pikevm/mod.rs +1 -0
- data/rust-vendor/regex-automata/tests/nfa/thompson/pikevm/regression.rs +20 -0
- data/rust-vendor/regex-syntax/.cargo-checksum.json +1 -1
- data/rust-vendor/regex-syntax/.cargo_vcs_info.json +1 -1
- data/rust-vendor/regex-syntax/Cargo.lock +1 -1
- data/rust-vendor/regex-syntax/Cargo.toml +16 -5
- data/rust-vendor/regex-syntax/Cargo.toml.orig +2 -1
- data/rust-vendor/semver/.cargo-checksum.json +1 -0
- data/rust-vendor/semver/.cargo_vcs_info.json +6 -0
- data/rust-vendor/semver/.github/FUNDING.yml +1 -0
- data/rust-vendor/semver/.github/workflows/ci.yml +140 -0
- data/rust-vendor/semver/Cargo.lock +75 -0
- data/rust-vendor/semver/Cargo.toml +86 -0
- data/rust-vendor/semver/Cargo.toml.orig +36 -0
- data/rust-vendor/semver/LICENSE-APACHE +176 -0
- data/rust-vendor/semver/LICENSE-MIT +23 -0
- data/rust-vendor/semver/README.md +84 -0
- data/rust-vendor/semver/benches/parse.rs +24 -0
- data/rust-vendor/semver/src/display.rs +163 -0
- data/rust-vendor/semver/src/error.rs +126 -0
- data/rust-vendor/semver/src/eval.rs +179 -0
- data/rust-vendor/semver/src/identifier.rs +412 -0
- data/rust-vendor/semver/src/impls.rs +163 -0
- data/rust-vendor/semver/src/lib.rs +570 -0
- data/rust-vendor/semver/src/parse.rs +404 -0
- data/rust-vendor/semver/src/serde.rs +109 -0
- data/rust-vendor/semver/tests/node/mod.rs +43 -0
- data/rust-vendor/semver/tests/test_autotrait.rs +14 -0
- data/rust-vendor/semver/tests/test_identifier.rs +51 -0
- data/rust-vendor/semver/tests/test_version.rs +251 -0
- data/rust-vendor/semver/tests/test_version_req.rs +480 -0
- data/rust-vendor/semver/tests/util/mod.rs +54 -0
- data/rust-vendor/symbolic-common/.cargo-checksum.json +1 -1
- data/rust-vendor/symbolic-common/Cargo.lock +74 -3
- data/rust-vendor/symbolic-common/Cargo.toml +2 -2
- data/rust-vendor/symbolic-common/Cargo.toml.orig +1 -1
- data/rust-vendor/symbolic-demangle/.cargo-checksum.json +1 -1
- data/rust-vendor/symbolic-demangle/Cargo.lock +87 -9
- data/rust-vendor/symbolic-demangle/Cargo.toml +5 -5
- data/rust-vendor/symbolic-demangle/Cargo.toml.orig +2 -2
- data/rust-vendor/syn/.cargo-checksum.json +1 -1
- data/rust-vendor/syn/.cargo_vcs_info.json +1 -1
- data/rust-vendor/syn/Cargo.lock +322 -109
- data/rust-vendor/syn/Cargo.toml +2 -2
- data/rust-vendor/syn/Cargo.toml.orig +2 -2
- data/rust-vendor/syn/benches/rust.rs +1 -2
- data/rust-vendor/syn/src/lib.rs +1 -1
- data/rust-vendor/syn/src/parse.rs +2 -2
- data/rust-vendor/syn/src/path.rs +1 -5
- data/rust-vendor/syn/tests/common/eq.rs +28 -17
- data/rust-vendor/syn/tests/common/parse.rs +1 -2
- data/rust-vendor/syn/tests/repo/progress.rs +1 -1
- data/rust-vendor/syn/tests/test_round_trip.rs +5 -36
- data/rust-vendor/tempfile/.cargo-checksum.json +1 -1
- data/rust-vendor/tempfile/.cargo_vcs_info.json +1 -1
- data/rust-vendor/tempfile/CHANGELOG.md +4 -0
- data/rust-vendor/tempfile/Cargo.lock +333 -21
- data/rust-vendor/tempfile/Cargo.toml +2 -2
- data/rust-vendor/tempfile/Cargo.toml.orig +2 -2
- data/rust-vendor/unicode-ident/.cargo-checksum.json +1 -1
- data/rust-vendor/unicode-ident/.cargo_vcs_info.json +1 -1
- data/rust-vendor/unicode-ident/.github/workflows/ci.yml +10 -10
- data/rust-vendor/unicode-ident/Cargo.lock +468 -186
- data/rust-vendor/unicode-ident/Cargo.toml +8 -8
- data/rust-vendor/unicode-ident/Cargo.toml.orig +7 -5
- data/rust-vendor/unicode-ident/src/lib.rs +1 -1
- data/rust-vendor/unicode-xid/.cargo-checksum.json +1 -0
- data/rust-vendor/unicode-xid/.cargo_vcs_info.json +6 -0
- data/rust-vendor/unicode-xid/COPYRIGHT +7 -0
- data/rust-vendor/unicode-xid/Cargo.toml +65 -0
- data/rust-vendor/unicode-xid/Cargo.toml.orig +34 -0
- data/rust-vendor/unicode-xid/LICENSE-APACHE +201 -0
- data/rust-vendor/unicode-xid/LICENSE-MIT +25 -0
- data/rust-vendor/unicode-xid/README.md +61 -0
- data/rust-vendor/unicode-xid/benches/xid.rs +60 -0
- data/rust-vendor/unicode-xid/src/lib.rs +90 -0
- data/rust-vendor/unicode-xid/src/tables.rs +1537 -0
- data/rust-vendor/unicode-xid/src/tests.rs +95 -0
- data/rust-vendor/unicode-xid/tests/exhaustive_tests.rs +25 -0
- data/rust-vendor/uuid/.cargo-checksum.json +1 -1
- data/rust-vendor/uuid/.cargo_vcs_info.json +1 -1
- data/rust-vendor/uuid/Cargo.lock +298 -44
- data/rust-vendor/uuid/Cargo.toml +5 -5
- data/rust-vendor/uuid/Cargo.toml.orig +5 -5
- data/rust-vendor/uuid/README.md +3 -3
- data/rust-vendor/uuid/src/error.rs +1 -7
- data/rust-vendor/uuid/src/lib.rs +4 -4
- data/rust-vendor/wasip3/.cargo-checksum.json +1 -0
- data/rust-vendor/wasip3/.cargo_vcs_info.json +6 -0
- data/rust-vendor/wasip3/Cargo.lock +483 -0
- data/rust-vendor/wasip3/Cargo.toml +96 -0
- data/rust-vendor/wasip3/Cargo.toml.orig +49 -0
- data/rust-vendor/wasip3/README.md +56 -0
- data/rust-vendor/wasip3/examples/cli-command.rs +19 -0
- data/rust-vendor/wasip3/examples/http-proxy-compat.rs +20 -0
- data/rust-vendor/wasip3/examples/http-proxy.rs +22 -0
- data/rust-vendor/wasip3/src/command.rs +513 -0
- data/rust-vendor/wasip3/src/http_compat/body_writer.rs +145 -0
- data/rust-vendor/wasip3/src/http_compat/conversions.rs +307 -0
- data/rust-vendor/wasip3/src/http_compat/mod.rs +314 -0
- data/rust-vendor/wasip3/src/imports.rs +10543 -0
- data/rust-vendor/wasip3/src/lib.rs +280 -0
- data/rust-vendor/wasip3/src/service.rs +7274 -0
- data/rust-vendor/wasip3/wit/deps/cli.wit +256 -0
- data/rust-vendor/wasip3/wit/deps/clocks.wit +161 -0
- data/rust-vendor/wasip3/wit/deps/filesystem.wit +553 -0
- data/rust-vendor/wasip3/wit/deps/http.wit +457 -0
- data/rust-vendor/wasip3/wit/deps/random.wit +92 -0
- data/rust-vendor/wasip3/wit/deps/sockets.wit +752 -0
- data/rust-vendor/wasip3/wit/wasi-crate.wit +1 -0
- data/rust-vendor/wasm-encoder/.cargo-checksum.json +1 -0
- data/rust-vendor/wasm-encoder/.cargo_vcs_info.json +6 -0
- data/rust-vendor/wasm-encoder/Cargo.lock +348 -0
- data/rust-vendor/wasm-encoder/Cargo.toml +104 -0
- data/rust-vendor/wasm-encoder/Cargo.toml.orig +43 -0
- data/rust-vendor/wasm-encoder/README.md +81 -0
- data/rust-vendor/wasm-encoder/src/component/aliases.rs +161 -0
- data/rust-vendor/wasm-encoder/src/component/builder.rs +826 -0
- data/rust-vendor/wasm-encoder/src/component/canonicals.rs +584 -0
- data/rust-vendor/wasm-encoder/src/component/components.rs +30 -0
- data/rust-vendor/wasm-encoder/src/component/exports.rs +130 -0
- data/rust-vendor/wasm-encoder/src/component/imports.rs +170 -0
- data/rust-vendor/wasm-encoder/src/component/instances.rs +200 -0
- data/rust-vendor/wasm-encoder/src/component/modules.rs +30 -0
- data/rust-vendor/wasm-encoder/src/component/names.rs +162 -0
- data/rust-vendor/wasm-encoder/src/component/start.rs +53 -0
- data/rust-vendor/wasm-encoder/src/component/types.rs +816 -0
- data/rust-vendor/wasm-encoder/src/component.rs +169 -0
- data/rust-vendor/wasm-encoder/src/core/branch_hints.rs +127 -0
- data/rust-vendor/wasm-encoder/src/core/code.rs +2464 -0
- data/rust-vendor/wasm-encoder/src/core/custom.rs +74 -0
- data/rust-vendor/wasm-encoder/src/core/data.rs +187 -0
- data/rust-vendor/wasm-encoder/src/core/dump.rs +629 -0
- data/rust-vendor/wasm-encoder/src/core/elements.rs +225 -0
- data/rust-vendor/wasm-encoder/src/core/exports.rs +86 -0
- data/rust-vendor/wasm-encoder/src/core/functions.rs +64 -0
- data/rust-vendor/wasm-encoder/src/core/globals.rs +101 -0
- data/rust-vendor/wasm-encoder/src/core/imports.rs +230 -0
- data/rust-vendor/wasm-encoder/src/core/instructions.rs +4686 -0
- data/rust-vendor/wasm-encoder/src/core/linking.rs +264 -0
- data/rust-vendor/wasm-encoder/src/core/memories.rs +116 -0
- data/rust-vendor/wasm-encoder/src/core/names.rs +305 -0
- data/rust-vendor/wasm-encoder/src/core/producers.rs +181 -0
- data/rust-vendor/wasm-encoder/src/core/start.rs +40 -0
- data/rust-vendor/wasm-encoder/src/core/tables.rs +130 -0
- data/rust-vendor/wasm-encoder/src/core/tags.rs +86 -0
- data/rust-vendor/wasm-encoder/src/core/types.rs +753 -0
- data/rust-vendor/wasm-encoder/src/core.rs +179 -0
- data/rust-vendor/wasm-encoder/src/lib.rs +224 -0
- data/rust-vendor/wasm-encoder/src/raw.rs +32 -0
- data/rust-vendor/wasm-encoder/src/reencode/component.rs +1548 -0
- data/rust-vendor/wasm-encoder/src/reencode.rs +2134 -0
- data/rust-vendor/wasm-metadata/.cargo-checksum.json +1 -0
- data/rust-vendor/wasm-metadata/.cargo_vcs_info.json +6 -0
- data/rust-vendor/wasm-metadata/Cargo.lock +769 -0
- data/rust-vendor/wasm-metadata/Cargo.toml +152 -0
- data/rust-vendor/wasm-metadata/Cargo.toml.orig +38 -0
- data/rust-vendor/wasm-metadata/README.md +27 -0
- data/rust-vendor/wasm-metadata/src/add_metadata.rs +91 -0
- data/rust-vendor/wasm-metadata/src/clap.rs +169 -0
- data/rust-vendor/wasm-metadata/src/dependencies.rs +142 -0
- data/rust-vendor/wasm-metadata/src/lib.rs +83 -0
- data/rust-vendor/wasm-metadata/src/metadata.rs +34 -0
- data/rust-vendor/wasm-metadata/src/names/component.rs +107 -0
- data/rust-vendor/wasm-metadata/src/names/mod.rs +5 -0
- data/rust-vendor/wasm-metadata/src/names/module.rs +101 -0
- data/rust-vendor/wasm-metadata/src/oci_annotations/authors.rs +111 -0
- data/rust-vendor/wasm-metadata/src/oci_annotations/description.rs +110 -0
- data/rust-vendor/wasm-metadata/src/oci_annotations/homepage.rs +118 -0
- data/rust-vendor/wasm-metadata/src/oci_annotations/licenses.rs +122 -0
- data/rust-vendor/wasm-metadata/src/oci_annotations/mod.rs +32 -0
- data/rust-vendor/wasm-metadata/src/oci_annotations/revision.rs +113 -0
- data/rust-vendor/wasm-metadata/src/oci_annotations/source.rs +117 -0
- data/rust-vendor/wasm-metadata/src/oci_annotations/version.rs +110 -0
- data/rust-vendor/wasm-metadata/src/payload.rs +215 -0
- data/rust-vendor/wasm-metadata/src/producers.rs +254 -0
- data/rust-vendor/wasm-metadata/src/rewrite.rs +224 -0
- data/rust-vendor/wasm-metadata/src/utils.rs +21 -0
- data/rust-vendor/wasm-metadata/tests/component.rs +310 -0
- data/rust-vendor/wasm-metadata/tests/module.rs +86 -0
- data/rust-vendor/wasmparser/.cargo-checksum.json +1 -0
- data/rust-vendor/wasmparser/.cargo_vcs_info.json +6 -0
- data/rust-vendor/wasmparser/Cargo.lock +687 -0
- data/rust-vendor/wasmparser/Cargo.toml +161 -0
- data/rust-vendor/wasmparser/Cargo.toml.orig +89 -0
- data/rust-vendor/wasmparser/README.md +28 -0
- data/rust-vendor/wasmparser/benches/.gitignore +1 -0
- data/rust-vendor/wasmparser/benches/benchmark.rs +395 -0
- data/rust-vendor/wasmparser/examples/simple.rs +37 -0
- data/rust-vendor/wasmparser/src/arity.rs +318 -0
- data/rust-vendor/wasmparser/src/binary_reader.rs +2109 -0
- data/rust-vendor/wasmparser/src/collections/hash.rs +120 -0
- data/rust-vendor/wasmparser/src/collections/index_map/detail.rs +1100 -0
- data/rust-vendor/wasmparser/src/collections/index_map/tests.rs +183 -0
- data/rust-vendor/wasmparser/src/collections/index_map.rs +653 -0
- data/rust-vendor/wasmparser/src/collections/index_set.rs +316 -0
- data/rust-vendor/wasmparser/src/collections/map.rs +852 -0
- data/rust-vendor/wasmparser/src/collections/mod.rs +34 -0
- data/rust-vendor/wasmparser/src/collections/set.rs +672 -0
- data/rust-vendor/wasmparser/src/features.rs +442 -0
- data/rust-vendor/wasmparser/src/lib.rs +1340 -0
- data/rust-vendor/wasmparser/src/limits.rs +90 -0
- data/rust-vendor/wasmparser/src/parser.rs +1925 -0
- data/rust-vendor/wasmparser/src/readers/component/aliases.rs +119 -0
- data/rust-vendor/wasmparser/src/readers/component/canonicals.rs +458 -0
- data/rust-vendor/wasmparser/src/readers/component/exports.rs +135 -0
- data/rust-vendor/wasmparser/src/readers/component/imports.rs +145 -0
- data/rust-vendor/wasmparser/src/readers/component/instances.rs +166 -0
- data/rust-vendor/wasmparser/src/readers/component/names.rs +101 -0
- data/rust-vendor/wasmparser/src/readers/component/start.rs +31 -0
- data/rust-vendor/wasmparser/src/readers/component/types.rs +537 -0
- data/rust-vendor/wasmparser/src/readers/component.rs +17 -0
- data/rust-vendor/wasmparser/src/readers/core/branch_hinting.rs +59 -0
- data/rust-vendor/wasmparser/src/readers/core/code.rs +177 -0
- data/rust-vendor/wasmparser/src/readers/core/coredumps.rs +274 -0
- data/rust-vendor/wasmparser/src/readers/core/custom.rs +134 -0
- data/rust-vendor/wasmparser/src/readers/core/data.rs +94 -0
- data/rust-vendor/wasmparser/src/readers/core/dylink0.rs +117 -0
- data/rust-vendor/wasmparser/src/readers/core/elements.rs +153 -0
- data/rust-vendor/wasmparser/src/readers/core/exports.rs +75 -0
- data/rust-vendor/wasmparser/src/readers/core/functions.rs +17 -0
- data/rust-vendor/wasmparser/src/readers/core/globals.rs +51 -0
- data/rust-vendor/wasmparser/src/readers/core/imports.rs +307 -0
- data/rust-vendor/wasmparser/src/readers/core/init.rs +70 -0
- data/rust-vendor/wasmparser/src/readers/core/linking.rs +457 -0
- data/rust-vendor/wasmparser/src/readers/core/memories.rs +61 -0
- data/rust-vendor/wasmparser/src/readers/core/names.rs +162 -0
- data/rust-vendor/wasmparser/src/readers/core/operators.rs +1105 -0
- data/rust-vendor/wasmparser/src/readers/core/producers.rs +84 -0
- data/rust-vendor/wasmparser/src/readers/core/reloc.rs +300 -0
- data/rust-vendor/wasmparser/src/readers/core/tables.rs +96 -0
- data/rust-vendor/wasmparser/src/readers/core/tags.rs +32 -0
- data/rust-vendor/wasmparser/src/readers/core/types/matches.rs +321 -0
- data/rust-vendor/wasmparser/src/readers/core/types.rs +2249 -0
- data/rust-vendor/wasmparser/src/readers/core.rs +43 -0
- data/rust-vendor/wasmparser/src/readers.rs +330 -0
- data/rust-vendor/wasmparser/src/resources.rs +265 -0
- data/rust-vendor/wasmparser/src/validator/component.rs +4765 -0
- data/rust-vendor/wasmparser/src/validator/component_types.rs +4036 -0
- data/rust-vendor/wasmparser/src/validator/core/canonical.rs +552 -0
- data/rust-vendor/wasmparser/src/validator/core.rs +1313 -0
- data/rust-vendor/wasmparser/src/validator/func.rs +613 -0
- data/rust-vendor/wasmparser/src/validator/names.rs +1017 -0
- data/rust-vendor/wasmparser/src/validator/operators/simd.rs +971 -0
- data/rust-vendor/wasmparser/src/validator/operators.rs +4696 -0
- data/rust-vendor/wasmparser/src/validator/types.rs +1327 -0
- data/rust-vendor/wasmparser/src/validator.rs +1645 -0
- data/rust-vendor/wasmparser/tests/big-module.rs +62 -0
- data/rust-vendor/wit-bindgen/.cargo-checksum.json +1 -1
- data/rust-vendor/wit-bindgen/.cargo_vcs_info.json +1 -1
- data/rust-vendor/wit-bindgen/Cargo.lock +76 -66
- data/rust-vendor/wit-bindgen/Cargo.toml +25 -11
- data/rust-vendor/wit-bindgen/Cargo.toml.orig +11 -3
- data/rust-vendor/wit-bindgen/src/lib.rs +21 -15
- data/rust-vendor/wit-bindgen/src/rt/async_support/abi_buffer.rs +35 -32
- data/rust-vendor/wit-bindgen/src/rt/async_support/cabi.rs +15 -20
- data/rust-vendor/wit-bindgen/src/rt/async_support/error_context.rs +11 -22
- data/rust-vendor/wit-bindgen/src/rt/async_support/future_support.rs +406 -146
- data/rust-vendor/wit-bindgen/src/rt/async_support/inter_task_wakeup.rs +98 -0
- data/rust-vendor/wit-bindgen/src/rt/async_support/inter_task_wakeup_disabled.rs +45 -0
- data/rust-vendor/wit-bindgen/src/rt/async_support/spawn.rs +82 -0
- data/rust-vendor/wit-bindgen/src/rt/async_support/spawn_disabled.rs +30 -0
- data/rust-vendor/wit-bindgen/src/rt/async_support/stream_support.rs +262 -122
- data/rust-vendor/wit-bindgen/src/rt/async_support/subtask.rs +49 -54
- data/rust-vendor/wit-bindgen/src/rt/async_support/unit_stream.rs +81 -0
- data/rust-vendor/wit-bindgen/src/rt/async_support/waitable.rs +47 -31
- data/rust-vendor/wit-bindgen/src/rt/async_support/waitable_set.rs +17 -35
- data/rust-vendor/wit-bindgen/src/rt/async_support.rs +262 -188
- data/rust-vendor/wit-bindgen/src/rt/mod.rs +14 -12
- data/rust-vendor/wit-bindgen/src/rt/wit_bindgen_cabi_realloc.c +2 -2
- data/rust-vendor/wit-bindgen/src/rt/wit_bindgen_cabi_realloc.o +0 -0
- data/rust-vendor/wit-bindgen/src/rt/wit_bindgen_cabi_realloc.rs +2 -2
- data/rust-vendor/wit-bindgen/src/rt/wit_bindgen_cabi_wasip3.o +0 -0
- data/rust-vendor/wit-bindgen-0.46.0/.cargo-checksum.json +1 -0
- data/rust-vendor/wit-bindgen-0.46.0/.cargo_vcs_info.json +6 -0
- data/rust-vendor/wit-bindgen-0.46.0/Cargo.lock +428 -0
- data/rust-vendor/wit-bindgen-0.46.0/Cargo.toml +88 -0
- data/rust-vendor/wit-bindgen-0.46.0/Cargo.toml.orig +37 -0
- data/rust-vendor/wit-bindgen-0.46.0/LICENSE-APACHE +201 -0
- data/rust-vendor/wit-bindgen-0.46.0/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- data/rust-vendor/wit-bindgen-0.46.0/LICENSE-MIT +23 -0
- data/rust-vendor/wit-bindgen-0.46.0/README.md +45 -0
- data/rust-vendor/wit-bindgen-0.46.0/build.rs +32 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/examples/_0_world_imports.rs +17 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/examples/_1_interface_imports.rs +32 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/examples/_2_imported_resources.rs +22 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/examples/_3_world_exports.rs +47 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/examples/_4_exported_resources.rs +26 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/examples.rs +55 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/lib.rs +881 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/abi_buffer.rs +417 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/cabi.rs +112 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/error_context.rs +94 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/future_support.rs +734 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/stream_support.rs +604 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/subtask.rs +289 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/waitable.rs +466 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/waitable_set.rs +100 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support.rs +634 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/mod.rs +230 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi_realloc.c +10 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi_realloc.o +0 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi_realloc.rs +11 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi_wasip3.c +12 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi_wasip3.o +0 -0
- data/rust-vendor/wit-bindgen-0.46.0/wasi-cli@0.2.0.wasm +0 -0
- data/rust-vendor/wit-bindgen-core/.cargo-checksum.json +1 -0
- data/rust-vendor/wit-bindgen-core/.cargo_vcs_info.json +6 -0
- data/rust-vendor/wit-bindgen-core/Cargo.lock +340 -0
- data/rust-vendor/wit-bindgen-core/Cargo.toml +75 -0
- data/rust-vendor/wit-bindgen-core/Cargo.toml.orig +30 -0
- data/rust-vendor/wit-bindgen-core/LICENSE-APACHE +201 -0
- data/rust-vendor/wit-bindgen-core/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- data/rust-vendor/wit-bindgen-core/LICENSE-MIT +23 -0
- data/rust-vendor/wit-bindgen-core/src/abi.rs +2526 -0
- data/rust-vendor/wit-bindgen-core/src/async_.rs +200 -0
- data/rust-vendor/wit-bindgen-core/src/lib.rs +239 -0
- data/rust-vendor/wit-bindgen-core/src/ns.rs +27 -0
- data/rust-vendor/wit-bindgen-core/src/path.rs +47 -0
- data/rust-vendor/wit-bindgen-core/src/source.rs +222 -0
- data/rust-vendor/wit-bindgen-core/src/types.rs +232 -0
- data/rust-vendor/wit-bindgen-rust/.cargo-checksum.json +1 -0
- data/rust-vendor/wit-bindgen-rust/.cargo_vcs_info.json +6 -0
- data/rust-vendor/wit-bindgen-rust/Cargo.lock +547 -0
- data/rust-vendor/wit-bindgen-rust/Cargo.toml +112 -0
- data/rust-vendor/wit-bindgen-rust/Cargo.toml.orig +44 -0
- data/rust-vendor/wit-bindgen-rust/LICENSE-APACHE +201 -0
- data/rust-vendor/wit-bindgen-rust/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- data/rust-vendor/wit-bindgen-rust/LICENSE-MIT +23 -0
- data/rust-vendor/wit-bindgen-rust/build.rs +4 -0
- data/rust-vendor/wit-bindgen-rust/src/bindgen.rs +1215 -0
- data/rust-vendor/wit-bindgen-rust/src/interface.rs +3020 -0
- data/rust-vendor/wit-bindgen-rust/src/lib.rs +1880 -0
- data/rust-vendor/wit-bindgen-rust/tests/codegen.rs +174 -0
- data/rust-vendor/wit-bindgen-rust/tests/wit/path1/world.wit +3 -0
- data/rust-vendor/wit-bindgen-rust/tests/wit/path2/world.wit +3 -0
- data/rust-vendor/wit-bindgen-rust/tests/wit/path3/package.wit +3 -0
- data/rust-vendor/wit-bindgen-rust-macro/.cargo-checksum.json +1 -0
- data/rust-vendor/wit-bindgen-rust-macro/.cargo_vcs_info.json +6 -0
- data/rust-vendor/wit-bindgen-rust-macro/Cargo.lock +306 -0
- data/rust-vendor/wit-bindgen-rust-macro/Cargo.toml +62 -0
- data/rust-vendor/wit-bindgen-rust-macro/Cargo.toml.orig +28 -0
- data/rust-vendor/wit-bindgen-rust-macro/LICENSE-APACHE +201 -0
- data/rust-vendor/wit-bindgen-rust-macro/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- data/rust-vendor/wit-bindgen-rust-macro/LICENSE-MIT +23 -0
- data/rust-vendor/wit-bindgen-rust-macro/build.rs +5 -0
- data/rust-vendor/wit-bindgen-rust-macro/src/lib.rs +606 -0
- data/rust-vendor/wit-component/.cargo-checksum.json +1 -0
- data/rust-vendor/wit-component/.cargo_vcs_info.json +6 -0
- data/rust-vendor/wit-component/Cargo.lock +1823 -0
- data/rust-vendor/wit-component/Cargo.toml +217 -0
- data/rust-vendor/wit-component/Cargo.toml.orig +61 -0
- data/rust-vendor/wit-component/README.md +251 -0
- data/rust-vendor/wit-component/src/dummy.rs +395 -0
- data/rust-vendor/wit-component/src/encoding/dedupe.rs +164 -0
- data/rust-vendor/wit-component/src/encoding/types.rs +510 -0
- data/rust-vendor/wit-component/src/encoding/wit.rs +393 -0
- data/rust-vendor/wit-component/src/encoding/world.rs +525 -0
- data/rust-vendor/wit-component/src/encoding.rs +3231 -0
- data/rust-vendor/wit-component/src/gc.rs +1134 -0
- data/rust-vendor/wit-component/src/lib.rs +178 -0
- data/rust-vendor/wit-component/src/linking/metadata.rs +515 -0
- data/rust-vendor/wit-component/src/linking.rs +1727 -0
- data/rust-vendor/wit-component/src/metadata.rs +447 -0
- data/rust-vendor/wit-component/src/printing.rs +1485 -0
- data/rust-vendor/wit-component/src/semver_check.rs +113 -0
- data/rust-vendor/wit-component/src/targets.rs +44 -0
- data/rust-vendor/wit-component/src/validation.rs +2679 -0
- data/rust-vendor/wit-component/tests/.gitignore +2 -0
- data/rust-vendor/wit-component/tests/components/adapt-empty-interface/adapt-old.wat +3 -0
- data/rust-vendor/wit-component/tests/components/adapt-empty-interface/adapt-old.wit +5 -0
- data/rust-vendor/wit-component/tests/components/adapt-empty-interface/component.wat +60 -0
- data/rust-vendor/wit-component/tests/components/adapt-empty-interface/component.wit.print +4 -0
- data/rust-vendor/wit-component/tests/components/adapt-empty-interface/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/adapt-empty-interface/module.wit +2 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-default/adapt-old.wat +4 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-default/adapt-old.wit +3 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-default/component.wat +32 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-default/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-default/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-default/module.wit +2 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-namespaced/adapt-old.wat +4 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-namespaced/adapt-old.wit +7 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-namespaced/component.wat +42 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-namespaced/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-namespaced/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-namespaced/module.wit +3 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-reallocs/adapt-old.wat +47 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-reallocs/adapt-old.wit +6 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-reallocs/component.wat +131 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-reallocs/component.wit.print +9 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-reallocs/module.wat +8 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-reallocs/module.wit +3 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-save-args/adapt-old.wat +13 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-save-args/adapt-old.wit +3 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-save-args/component.wat +86 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-save-args/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-save-args/module.wat +4 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-save-args/module.wit +2 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-with-post-return/adapt-old.wat +33 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-with-post-return/adapt-old.wit +7 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-with-post-return/component.wat +101 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-with-post-return/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-with-post-return/module.wat +9 -0
- data/rust-vendor/wit-component/tests/components/adapt-export-with-post-return/module.wit +3 -0
- data/rust-vendor/wit-component/tests/components/adapt-import-only-used-in-adapter/adapt-unused.wat +7 -0
- data/rust-vendor/wit-component/tests/components/adapt-import-only-used-in-adapter/adapt-unused.wit +9 -0
- data/rust-vendor/wit-component/tests/components/adapt-import-only-used-in-adapter/component.wat +115 -0
- data/rust-vendor/wit-component/tests/components/adapt-import-only-used-in-adapter/component.wit.print +9 -0
- data/rust-vendor/wit-component/tests/components/adapt-import-only-used-in-adapter/module.wat +5 -0
- data/rust-vendor/wit-component/tests/components/adapt-import-only-used-in-adapter/module.wit +6 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack/adapt-old.wat +54 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack/adapt-old.wit +5 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack/component.wat +163 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack/module.wat +4 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack/module.wit +2 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-adapt-realloc/adapt-old.wat +76 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-adapt-realloc/adapt-old.wit +5 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-adapt-realloc/component.wat +174 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-adapt-realloc/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-adapt-realloc/module.wat +12 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-adapt-realloc/module.wit +2 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc/adapt-old.wat +76 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc/adapt-old.wit +5 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc/component.wat +199 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc/module.wat +38 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc/module.wit +3 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc-no-state/adapt-old.wat +68 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc-no-state/adapt-old.wit +5 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc-no-state/component.wat +216 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc-no-state/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc-no-state/module.wat +38 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc-no-state/module.wit +3 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-reallocing-adapter/adapt-old.wat +62 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-reallocing-adapter/adapt-old.wit +5 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-reallocing-adapter/component.wat +187 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-reallocing-adapter/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-reallocing-adapter/module.wat +38 -0
- data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-reallocing-adapter/module.wit +2 -0
- data/rust-vendor/wit-component/tests/components/adapt-list-return/adapt-old.wat +14 -0
- data/rust-vendor/wit-component/tests/components/adapt-list-return/adapt-old.wit +5 -0
- data/rust-vendor/wit-component/tests/components/adapt-list-return/component.wat +104 -0
- data/rust-vendor/wit-component/tests/components/adapt-list-return/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/adapt-list-return/module.wat +4 -0
- data/rust-vendor/wit-component/tests/components/adapt-list-return/module.wit +3 -0
- data/rust-vendor/wit-component/tests/components/adapt-memory-simple/adapt-old.wat +4 -0
- data/rust-vendor/wit-component/tests/components/adapt-memory-simple/adapt-old.wit +5 -0
- data/rust-vendor/wit-component/tests/components/adapt-memory-simple/component.wat +92 -0
- data/rust-vendor/wit-component/tests/components/adapt-memory-simple/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/adapt-memory-simple/module.wat +4 -0
- data/rust-vendor/wit-component/tests/components/adapt-memory-simple/module.wit +2 -0
- data/rust-vendor/wit-component/tests/components/adapt-multiple/adapt-foo.wat +10 -0
- data/rust-vendor/wit-component/tests/components/adapt-multiple/adapt-foo.wit +8 -0
- data/rust-vendor/wit-component/tests/components/adapt-multiple/component.wat +107 -0
- data/rust-vendor/wit-component/tests/components/adapt-multiple/component.wit.print +10 -0
- data/rust-vendor/wit-component/tests/components/adapt-multiple/module.wat +4 -0
- data/rust-vendor/wit-component/tests/components/adapt-multiple/module.wit +2 -0
- data/rust-vendor/wit-component/tests/components/adapt-preview1/adapt-wasi-snapshot-preview1.wat +13 -0
- data/rust-vendor/wit-component/tests/components/adapt-preview1/adapt-wasi-snapshot-preview1.wit +12 -0
- data/rust-vendor/wit-component/tests/components/adapt-preview1/component.wat +119 -0
- data/rust-vendor/wit-component/tests/components/adapt-preview1/component.wit.print +8 -0
- data/rust-vendor/wit-component/tests/components/adapt-preview1/module.wat +11 -0
- data/rust-vendor/wit-component/tests/components/adapt-preview1/module.wit +7 -0
- data/rust-vendor/wit-component/tests/components/adapt-stub-wasip2/adapt-wasip2.wat +8 -0
- data/rust-vendor/wit-component/tests/components/adapt-stub-wasip2/adapt-wasip2.wit +1 -0
- data/rust-vendor/wit-component/tests/components/adapt-stub-wasip2/component.wat +74 -0
- data/rust-vendor/wit-component/tests/components/adapt-stub-wasip2/component.wit.print +4 -0
- data/rust-vendor/wit-component/tests/components/adapt-stub-wasip2/deps/cli/environment.wit +5 -0
- data/rust-vendor/wit-component/tests/components/adapt-stub-wasip2/module.wat +11 -0
- data/rust-vendor/wit-component/tests/components/adapt-stub-wasip2/module.wit +5 -0
- data/rust-vendor/wit-component/tests/components/adapt-unused/adapt-old.wat +4 -0
- data/rust-vendor/wit-component/tests/components/adapt-unused/adapt-old.wit +5 -0
- data/rust-vendor/wit-component/tests/components/adapt-unused/component.wat +12 -0
- data/rust-vendor/wit-component/tests/components/adapt-unused/component.wit.print +4 -0
- data/rust-vendor/wit-component/tests/components/adapt-unused/module.wat +1 -0
- data/rust-vendor/wit-component/tests/components/adapt-unused/module.wit +2 -0
- data/rust-vendor/wit-component/tests/components/async-builtins/component.wat +259 -0
- data/rust-vendor/wit-component/tests/components/async-builtins/component.wit.print +6 -0
- data/rust-vendor/wit-component/tests/components/async-builtins/module.wat +28 -0
- data/rust-vendor/wit-component/tests/components/async-builtins/module.wit +10 -0
- data/rust-vendor/wit-component/tests/components/async-export/component.wat +91 -0
- data/rust-vendor/wit-component/tests/components/async-export/component.wit.print +6 -0
- data/rust-vendor/wit-component/tests/components/async-export/module.wat +8 -0
- data/rust-vendor/wit-component/tests/components/async-export/module.wit +30 -0
- data/rust-vendor/wit-component/tests/components/async-export-with-callback/component.wat +59 -0
- data/rust-vendor/wit-component/tests/components/async-export-with-callback/component.wit.print +6 -0
- data/rust-vendor/wit-component/tests/components/async-export-with-callback/module.wat +8 -0
- data/rust-vendor/wit-component/tests/components/async-export-with-callback/module.wit +10 -0
- data/rust-vendor/wit-component/tests/components/async-import/component.wat +125 -0
- data/rust-vendor/wit-component/tests/components/async-import/component.wit.print +6 -0
- data/rust-vendor/wit-component/tests/components/async-import/module.wat +8 -0
- data/rust-vendor/wit-component/tests/components/async-import/module.wit +10 -0
- data/rust-vendor/wit-component/tests/components/async-import-only-intrinsic/component.wat +34 -0
- data/rust-vendor/wit-component/tests/components/async-import-only-intrinsic/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/async-import-only-intrinsic/module.wat +4 -0
- data/rust-vendor/wit-component/tests/components/async-import-only-intrinsic/module.wit +17 -0
- data/rust-vendor/wit-component/tests/components/async-import-tricky/component.wat +39 -0
- data/rust-vendor/wit-component/tests/components/async-import-tricky/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/async-import-tricky/module.wat +6 -0
- data/rust-vendor/wit-component/tests/components/async-import-tricky/module.wit +17 -0
- data/rust-vendor/wit-component/tests/components/async-streams-and-futures/component.wat +649 -0
- data/rust-vendor/wit-component/tests/components/async-streams-and-futures/component.wit.print +9 -0
- data/rust-vendor/wit-component/tests/components/async-streams-and-futures/module.wat +92 -0
- data/rust-vendor/wit-component/tests/components/async-streams-and-futures/module.wit +12 -0
- data/rust-vendor/wit-component/tests/components/async-unit-builtins/component.wat +138 -0
- data/rust-vendor/wit-component/tests/components/async-unit-builtins/component.wit.print +4 -0
- data/rust-vendor/wit-component/tests/components/async-unit-builtins/module.wat +18 -0
- data/rust-vendor/wit-component/tests/components/async-unit-builtins/module.wit +4 -0
- data/rust-vendor/wit-component/tests/components/bare-funcs/component.wat +93 -0
- data/rust-vendor/wit-component/tests/components/bare-funcs/component.wit.print +9 -0
- data/rust-vendor/wit-component/tests/components/bare-funcs/module.wat +13 -0
- data/rust-vendor/wit-component/tests/components/bare-funcs/module.wit +7 -0
- data/rust-vendor/wit-component/tests/components/cm32-names/component.wat +366 -0
- data/rust-vendor/wit-component/tests/components/cm32-names/component.wit.print +25 -0
- data/rust-vendor/wit-component/tests/components/cm32-names/module.wat +32 -0
- data/rust-vendor/wit-component/tests/components/cm32-names/module.wit +30 -0
- data/rust-vendor/wit-component/tests/components/custom-page-sizes/component.wat +23 -0
- data/rust-vendor/wit-component/tests/components/custom-page-sizes/component.wit.print +4 -0
- data/rust-vendor/wit-component/tests/components/custom-page-sizes/module.wat +12 -0
- data/rust-vendor/wit-component/tests/components/custom-page-sizes/module.wit +3 -0
- data/rust-vendor/wit-component/tests/components/deduplicate-imports/adapt-wasi-snapshot-preview1.wat +10 -0
- data/rust-vendor/wit-component/tests/components/deduplicate-imports/adapt-wasi-snapshot-preview1.wit +10 -0
- data/rust-vendor/wit-component/tests/components/deduplicate-imports/component.wat +132 -0
- data/rust-vendor/wit-component/tests/components/deduplicate-imports/component.wit.print +9 -0
- data/rust-vendor/wit-component/tests/components/deduplicate-imports/module.wat +40 -0
- data/rust-vendor/wit-component/tests/components/deduplicate-imports/module.wit +9 -0
- data/rust-vendor/wit-component/tests/components/empty/component.wat +12 -0
- data/rust-vendor/wit-component/tests/components/empty/component.wit.print +4 -0
- data/rust-vendor/wit-component/tests/components/empty/module.wat +1 -0
- data/rust-vendor/wit-component/tests/components/empty/module.wit +2 -0
- data/rust-vendor/wit-component/tests/components/ensure-default-type-exports/component.wat +50 -0
- data/rust-vendor/wit-component/tests/components/ensure-default-type-exports/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/ensure-default-type-exports/module.wat +6 -0
- data/rust-vendor/wit-component/tests/components/ensure-default-type-exports/module.wit +17 -0
- data/rust-vendor/wit-component/tests/components/error-adapt-missing-memory/adapt-old.wat +4 -0
- data/rust-vendor/wit-component/tests/components/error-adapt-missing-memory/adapt-old.wit +5 -0
- data/rust-vendor/wit-component/tests/components/error-adapt-missing-memory/error.txt +1 -0
- data/rust-vendor/wit-component/tests/components/error-adapt-missing-memory/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/error-adapt-missing-memory/module.wit +2 -0
- data/rust-vendor/wit-component/tests/components/error-async-export-missing-callback/error.txt +1 -0
- data/rust-vendor/wit-component/tests/components/error-async-export-missing-callback/module.wat +6 -0
- data/rust-vendor/wit-component/tests/components/error-async-export-missing-callback/module.wit +10 -0
- data/rust-vendor/wit-component/tests/components/error-default-export-sig-mismatch/error.txt +1 -0
- data/rust-vendor/wit-component/tests/components/error-default-export-sig-mismatch/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/error-default-export-sig-mismatch/module.wit +5 -0
- data/rust-vendor/wit-component/tests/components/error-empty-module-import/error.txt +1 -0
- data/rust-vendor/wit-component/tests/components/error-empty-module-import/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/error-empty-module-import/module.wit +2 -0
- data/rust-vendor/wit-component/tests/components/error-export-sig-mismatch/error.txt +1 -0
- data/rust-vendor/wit-component/tests/components/error-export-sig-mismatch/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/error-export-sig-mismatch/module.wit +7 -0
- data/rust-vendor/wit-component/tests/components/error-import-resource-rep/error.txt +1 -0
- data/rust-vendor/wit-component/tests/components/error-import-resource-rep/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/error-import-resource-rep/module.wit +5 -0
- data/rust-vendor/wit-component/tests/components/error-import-resource-wrong-signature/error.txt +1 -0
- data/rust-vendor/wit-component/tests/components/error-import-resource-wrong-signature/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/error-import-resource-wrong-signature/module.wit +5 -0
- data/rust-vendor/wit-component/tests/components/error-import-sig-mismatch/error.txt +1 -0
- data/rust-vendor/wit-component/tests/components/error-import-sig-mismatch/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/error-import-sig-mismatch/module.wit +7 -0
- data/rust-vendor/wit-component/tests/components/error-invalid-module-import/error.txt +1 -0
- data/rust-vendor/wit-component/tests/components/error-invalid-module-import/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/error-invalid-module-import/module.wit +2 -0
- data/rust-vendor/wit-component/tests/components/error-link-duplicate-initializers/error.txt +1 -0
- data/rust-vendor/wit-component/tests/components/error-link-duplicate-initializers/lib-bar.wat +12 -0
- data/rust-vendor/wit-component/tests/components/error-link-duplicate-initializers/lib-bar.wit +3 -0
- data/rust-vendor/wit-component/tests/components/error-link-duplicate-initializers/lib-foo.wat +21 -0
- data/rust-vendor/wit-component/tests/components/error-link-duplicate-initializers/lib-foo.wit +10 -0
- data/rust-vendor/wit-component/tests/components/error-link-missing-needed/error.txt +2 -0
- data/rust-vendor/wit-component/tests/components/error-link-missing-needed/lib-foo.wat +15 -0
- data/rust-vendor/wit-component/tests/components/error-link-missing-needed/lib-foo.wit +10 -0
- data/rust-vendor/wit-component/tests/components/error-link-missing-symbols/error.txt +3 -0
- data/rust-vendor/wit-component/tests/components/error-link-missing-symbols/lib-foo.wat +13 -0
- data/rust-vendor/wit-component/tests/components/error-link-missing-symbols/lib-foo.wit +10 -0
- data/rust-vendor/wit-component/tests/components/error-missing-default-export/error.txt +1 -0
- data/rust-vendor/wit-component/tests/components/error-missing-default-export/module.wat +1 -0
- data/rust-vendor/wit-component/tests/components/error-missing-default-export/module.wit +4 -0
- data/rust-vendor/wit-component/tests/components/error-missing-export/error.txt +1 -0
- data/rust-vendor/wit-component/tests/components/error-missing-export/module.wat +1 -0
- data/rust-vendor/wit-component/tests/components/error-missing-export/module.wit +7 -0
- data/rust-vendor/wit-component/tests/components/error-missing-import/error.txt +1 -0
- data/rust-vendor/wit-component/tests/components/error-missing-import/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/error-missing-import/module.wit +2 -0
- data/rust-vendor/wit-component/tests/components/error-missing-import-func/error.txt +1 -0
- data/rust-vendor/wit-component/tests/components/error-missing-import-func/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/error-missing-import-func/module.wit +9 -0
- data/rust-vendor/wit-component/tests/components/error-missing-module-metadata/adapt-old.wat +4 -0
- data/rust-vendor/wit-component/tests/components/error-missing-module-metadata/adapt-old.wit +5 -0
- data/rust-vendor/wit-component/tests/components/error-missing-module-metadata/error.txt +1 -0
- data/rust-vendor/wit-component/tests/components/error-missing-module-metadata/module.wat +4 -0
- data/rust-vendor/wit-component/tests/components/error-missing-module-metadata/module.wit +4 -0
- data/rust-vendor/wit-component/tests/components/export-interface-using-import/component.wat +37 -0
- data/rust-vendor/wit-component/tests/components/export-interface-using-import/component.wit.print +9 -0
- data/rust-vendor/wit-component/tests/components/export-interface-using-import/module.wat +1 -0
- data/rust-vendor/wit-component/tests/components/export-interface-using-import/module.wit +17 -0
- data/rust-vendor/wit-component/tests/components/export-name-shuffling/component.wat +43 -0
- data/rust-vendor/wit-component/tests/components/export-name-shuffling/component.wit.print +10 -0
- data/rust-vendor/wit-component/tests/components/export-name-shuffling/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/export-name-shuffling/module.wit +17 -0
- data/rust-vendor/wit-component/tests/components/export-resource/component.wat +102 -0
- data/rust-vendor/wit-component/tests/components/export-resource/component.wit.print +10 -0
- data/rust-vendor/wit-component/tests/components/export-resource/module.wat +15 -0
- data/rust-vendor/wit-component/tests/components/export-resource/module.wit +11 -0
- data/rust-vendor/wit-component/tests/components/export-type-name-conflict/component.wat +46 -0
- data/rust-vendor/wit-component/tests/components/export-type-name-conflict/component.wit.print +11 -0
- data/rust-vendor/wit-component/tests/components/export-type-name-conflict/module.wat +5 -0
- data/rust-vendor/wit-component/tests/components/export-type-name-conflict/module.wit +15 -0
- data/rust-vendor/wit-component/tests/components/export-with-type-alias/component.wat +40 -0
- data/rust-vendor/wit-component/tests/components/export-with-type-alias/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/export-with-type-alias/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/export-with-type-alias/module.wit +11 -0
- data/rust-vendor/wit-component/tests/components/exports/component.wat +139 -0
- data/rust-vendor/wit-component/tests/components/exports/component.wit.print +29 -0
- data/rust-vendor/wit-component/tests/components/exports/module.wat +14 -0
- data/rust-vendor/wit-component/tests/components/exports/module.wit +29 -0
- data/rust-vendor/wit-component/tests/components/fallible-constructor/component.wat +73 -0
- data/rust-vendor/wit-component/tests/components/fallible-constructor/component.wit.print +9 -0
- data/rust-vendor/wit-component/tests/components/fallible-constructor/module.wat +5 -0
- data/rust-vendor/wit-component/tests/components/fallible-constructor/module.wit +9 -0
- data/rust-vendor/wit-component/tests/components/import-and-export-resource/component.wat +53 -0
- data/rust-vendor/wit-component/tests/components/import-and-export-resource/component.wit.print +8 -0
- data/rust-vendor/wit-component/tests/components/import-and-export-resource/module.wat +6 -0
- data/rust-vendor/wit-component/tests/components/import-and-export-resource/module.wit +12 -0
- data/rust-vendor/wit-component/tests/components/import-conflict/component.wat +118 -0
- data/rust-vendor/wit-component/tests/components/import-conflict/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/import-conflict/module.wat +7 -0
- data/rust-vendor/wit-component/tests/components/import-conflict/module.wit +19 -0
- data/rust-vendor/wit-component/tests/components/import-empty-interface/component.wat +12 -0
- data/rust-vendor/wit-component/tests/components/import-empty-interface/component.wit.print +4 -0
- data/rust-vendor/wit-component/tests/components/import-empty-interface/module.wat +1 -0
- data/rust-vendor/wit-component/tests/components/import-empty-interface/module.wit +5 -0
- data/rust-vendor/wit-component/tests/components/import-export/component.wat +124 -0
- data/rust-vendor/wit-component/tests/components/import-export/component.wit.print +14 -0
- data/rust-vendor/wit-component/tests/components/import-export/module.wat +10 -0
- data/rust-vendor/wit-component/tests/components/import-export/module.wit +14 -0
- data/rust-vendor/wit-component/tests/components/import-export-same-iface-name/component.wat +59 -0
- data/rust-vendor/wit-component/tests/components/import-export-same-iface-name/component.wit.print +8 -0
- data/rust-vendor/wit-component/tests/components/import-export-same-iface-name/deps/dep/foo.wit +5 -0
- data/rust-vendor/wit-component/tests/components/import-export-same-iface-name/module.wat +5 -0
- data/rust-vendor/wit-component/tests/components/import-export-same-iface-name/module.wit +11 -0
- data/rust-vendor/wit-component/tests/components/import-in-adapter-and-main-module/adapt-old.wat +23 -0
- data/rust-vendor/wit-component/tests/components/import-in-adapter-and-main-module/adapt-old.wit +9 -0
- data/rust-vendor/wit-component/tests/components/import-in-adapter-and-main-module/component.wat +220 -0
- data/rust-vendor/wit-component/tests/components/import-in-adapter-and-main-module/component.wit.print +16 -0
- data/rust-vendor/wit-component/tests/components/import-in-adapter-and-main-module/deps/shared-dependency/doc.wit +13 -0
- data/rust-vendor/wit-component/tests/components/import-in-adapter-and-main-module/deps/shared-dependency/types.wit +3 -0
- data/rust-vendor/wit-component/tests/components/import-in-adapter-and-main-module/module.wat +15 -0
- data/rust-vendor/wit-component/tests/components/import-in-adapter-and-main-module/module.wit +11 -0
- data/rust-vendor/wit-component/tests/components/import-only-resource-static-function/component.wat +30 -0
- data/rust-vendor/wit-component/tests/components/import-only-resource-static-function/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/import-only-resource-static-function/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/import-only-resource-static-function/module.wit +11 -0
- data/rust-vendor/wit-component/tests/components/import-partial-export-full/component.wat +34 -0
- data/rust-vendor/wit-component/tests/components/import-partial-export-full/component.wit.print +8 -0
- data/rust-vendor/wit-component/tests/components/import-partial-export-full/module.wat +1 -0
- data/rust-vendor/wit-component/tests/components/import-partial-export-full/module.wit +19 -0
- data/rust-vendor/wit-component/tests/components/import-resource-in-interface/component.wat +41 -0
- data/rust-vendor/wit-component/tests/components/import-resource-in-interface/component.wit.print +10 -0
- data/rust-vendor/wit-component/tests/components/import-resource-in-interface/module.wat +5 -0
- data/rust-vendor/wit-component/tests/components/import-resource-in-interface/module.wit +11 -0
- data/rust-vendor/wit-component/tests/components/import-resource-simple/component.wat +33 -0
- data/rust-vendor/wit-component/tests/components/import-resource-simple/component.wit.print +8 -0
- data/rust-vendor/wit-component/tests/components/import-resource-simple/module.wat +5 -0
- data/rust-vendor/wit-component/tests/components/import-resource-simple/module.wit +9 -0
- data/rust-vendor/wit-component/tests/components/imports/component.wat +149 -0
- data/rust-vendor/wit-component/tests/components/imports/component.wit.print +29 -0
- data/rust-vendor/wit-component/tests/components/imports/module.wat +12 -0
- data/rust-vendor/wit-component/tests/components/imports/module.wit +33 -0
- data/rust-vendor/wit-component/tests/components/initialize/component.wat +38 -0
- data/rust-vendor/wit-component/tests/components/initialize/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/initialize/module.wat +6 -0
- data/rust-vendor/wit-component/tests/components/initialize/module.wit +5 -0
- data/rust-vendor/wit-component/tests/components/lift-options/component.wat +286 -0
- data/rust-vendor/wit-component/tests/components/lift-options/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/lift-options/module.wat +24 -0
- data/rust-vendor/wit-component/tests/components/lift-options/module.wit +40 -0
- data/rust-vendor/wit-component/tests/components/link/component.wat +271 -0
- data/rust-vendor/wit-component/tests/components/link/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/link/lib-bar.wat +29 -0
- data/rust-vendor/wit-component/tests/components/link/lib-bar.wit +10 -0
- data/rust-vendor/wit-component/tests/components/link/lib-c.wat +27 -0
- data/rust-vendor/wit-component/tests/components/link/lib-c.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link/lib-foo.wat +55 -0
- data/rust-vendor/wit-component/tests/components/link/lib-foo.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link/lib-unused.wat +55 -0
- data/rust-vendor/wit-component/tests/components/link/lib-unused.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link-asyncify/component.wat +267 -0
- data/rust-vendor/wit-component/tests/components/link-asyncify/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/link-asyncify/lib-bar.wat +81 -0
- data/rust-vendor/wit-component/tests/components/link-asyncify/lib-bar.wit +9 -0
- data/rust-vendor/wit-component/tests/components/link-asyncify/lib-foo.wat +78 -0
- data/rust-vendor/wit-component/tests/components/link-asyncify/lib-foo.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link-bare-funcs/component.wat +212 -0
- data/rust-vendor/wit-component/tests/components/link-bare-funcs/component.wit.print +9 -0
- data/rust-vendor/wit-component/tests/components/link-bare-funcs/lib-c.wat +27 -0
- data/rust-vendor/wit-component/tests/components/link-bare-funcs/lib-c.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link-bare-funcs/lib-foo.wat +18 -0
- data/rust-vendor/wit-component/tests/components/link-bare-funcs/lib-foo.wit +7 -0
- data/rust-vendor/wit-component/tests/components/link-circular/component.wat +133 -0
- data/rust-vendor/wit-component/tests/components/link-circular/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/link-circular/lib-bar.wat +12 -0
- data/rust-vendor/wit-component/tests/components/link-circular/lib-bar.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link-circular/lib-foo.wat +15 -0
- data/rust-vendor/wit-component/tests/components/link-circular/lib-foo.wit +10 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable/component.wat +108 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable/dlopen-lib-foo.wat +15 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable/dlopen-lib-foo.wit +10 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl/component.wat +657 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl/dlopen-lib-foo.wat +17 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl/dlopen-lib-foo.wit +10 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl/lib-c.wat +30 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl/lib-c.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl/stub-missing-functions +0 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl/use-built-in-libdl +0 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/component.wat +654 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/dlopen-lib-foo.wat +19 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/dlopen-lib-foo.wit +10 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/lib-c.wat +39 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/lib-c.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/lib-unused.wat +55 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/lib-unused.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/use-built-in-libdl +0 -0
- data/rust-vendor/wit-component/tests/components/link-duplicate-symbols/component.wat +135 -0
- data/rust-vendor/wit-component/tests/components/link-duplicate-symbols/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/link-duplicate-symbols/lib-bar.wat +13 -0
- data/rust-vendor/wit-component/tests/components/link-duplicate-symbols/lib-bar.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link-duplicate-symbols/lib-foo.wat +15 -0
- data/rust-vendor/wit-component/tests/components/link-duplicate-symbols/lib-foo.wit +10 -0
- data/rust-vendor/wit-component/tests/components/link-got-func/component.wat +125 -0
- data/rust-vendor/wit-component/tests/components/link-got-func/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/link-got-func/lib-bar.wat +10 -0
- data/rust-vendor/wit-component/tests/components/link-got-func/lib-bar.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link-got-func/lib-foo.wat +10 -0
- data/rust-vendor/wit-component/tests/components/link-got-func/lib-foo.wit +10 -0
- data/rust-vendor/wit-component/tests/components/link-initialize/component.wat +271 -0
- data/rust-vendor/wit-component/tests/components/link-initialize/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/link-initialize/lib-bar.wat +29 -0
- data/rust-vendor/wit-component/tests/components/link-initialize/lib-bar.wit +10 -0
- data/rust-vendor/wit-component/tests/components/link-initialize/lib-c.wat +27 -0
- data/rust-vendor/wit-component/tests/components/link-initialize/lib-c.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link-initialize/lib-foo.wat +55 -0
- data/rust-vendor/wit-component/tests/components/link-initialize/lib-foo.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link-lib-with-async-export/component.wat +148 -0
- data/rust-vendor/wit-component/tests/components/link-lib-with-async-export/component.wit.print +19 -0
- data/rust-vendor/wit-component/tests/components/link-lib-with-async-export/lib-c.wat +4 -0
- data/rust-vendor/wit-component/tests/components/link-lib-with-async-export/lib-c.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link-lib-with-async-export/lib-foo.wat +12 -0
- data/rust-vendor/wit-component/tests/components/link-lib-with-async-export/lib-foo.wit +16 -0
- data/rust-vendor/wit-component/tests/components/link-resources/component.wat +150 -0
- data/rust-vendor/wit-component/tests/components/link-resources/component.wit.print +6 -0
- data/rust-vendor/wit-component/tests/components/link-resources/lib-bar.wat +15 -0
- data/rust-vendor/wit-component/tests/components/link-resources/lib-bar.wit +13 -0
- data/rust-vendor/wit-component/tests/components/link-resources/lib-foo.wat +17 -0
- data/rust-vendor/wit-component/tests/components/link-resources/lib-foo.wit +13 -0
- data/rust-vendor/wit-component/tests/components/link-stack-high-and-low/component.wat +146 -0
- data/rust-vendor/wit-component/tests/components/link-stack-high-and-low/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/link-stack-high-and-low/lib-bar.wat +19 -0
- data/rust-vendor/wit-component/tests/components/link-stack-high-and-low/lib-bar.wit +9 -0
- data/rust-vendor/wit-component/tests/components/link-stack-high-and-low/lib-foo.wat +17 -0
- data/rust-vendor/wit-component/tests/components/link-stack-high-and-low/lib-foo.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link-stub-wasip2/adapt-wasip2.wat +8 -0
- data/rust-vendor/wit-component/tests/components/link-stub-wasip2/adapt-wasip2.wit +1 -0
- data/rust-vendor/wit-component/tests/components/link-stub-wasip2/component.wat +330 -0
- data/rust-vendor/wit-component/tests/components/link-stub-wasip2/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/link-stub-wasip2/deps/cli/environment.wit +5 -0
- data/rust-vendor/wit-component/tests/components/link-stub-wasip2/lib-bar.wat +29 -0
- data/rust-vendor/wit-component/tests/components/link-stub-wasip2/lib-bar.wit +10 -0
- data/rust-vendor/wit-component/tests/components/link-stub-wasip2/lib-c.wat +29 -0
- data/rust-vendor/wit-component/tests/components/link-stub-wasip2/lib-c.wit +5 -0
- data/rust-vendor/wit-component/tests/components/link-stub-wasip2/lib-foo.wat +55 -0
- data/rust-vendor/wit-component/tests/components/link-stub-wasip2/lib-foo.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link-stub-wasip2/lib-unused.wat +55 -0
- data/rust-vendor/wit-component/tests/components/link-stub-wasip2/lib-unused.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link-stubs/component.wat +118 -0
- data/rust-vendor/wit-component/tests/components/link-stubs/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/link-stubs/lib-foo.wat +13 -0
- data/rust-vendor/wit-component/tests/components/link-stubs/lib-foo.wit +10 -0
- data/rust-vendor/wit-component/tests/components/link-stubs/stub-missing-functions +0 -0
- data/rust-vendor/wit-component/tests/components/link-tag/component.wat +123 -0
- data/rust-vendor/wit-component/tests/components/link-tag/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/link-tag/lib-bar.wat +6 -0
- data/rust-vendor/wit-component/tests/components/link-tag/lib-bar.wit +3 -0
- data/rust-vendor/wit-component/tests/components/link-tag/lib-foo.wat +7 -0
- data/rust-vendor/wit-component/tests/components/link-tag/lib-foo.wit +5 -0
- data/rust-vendor/wit-component/tests/components/link-weak-cabi-realloc/component.wat +99 -0
- data/rust-vendor/wit-component/tests/components/link-weak-cabi-realloc/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/link-weak-cabi-realloc/lib-foo.wat +14 -0
- data/rust-vendor/wit-component/tests/components/link-weak-cabi-realloc/lib-foo.wit +9 -0
- data/rust-vendor/wit-component/tests/components/link-weak-import/component.wat +120 -0
- data/rust-vendor/wit-component/tests/components/link-weak-import/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/link-weak-import/lib-foo.wat +15 -0
- data/rust-vendor/wit-component/tests/components/link-weak-import/lib-foo.wit +10 -0
- data/rust-vendor/wit-component/tests/components/live-exports-dead-imports/component.wat +38 -0
- data/rust-vendor/wit-component/tests/components/live-exports-dead-imports/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/live-exports-dead-imports/module.wat +4 -0
- data/rust-vendor/wit-component/tests/components/live-exports-dead-imports/module.wit +12 -0
- data/rust-vendor/wit-component/tests/components/lower-options/component.wat +281 -0
- data/rust-vendor/wit-component/tests/components/lower-options/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/lower-options/module.wat +20 -0
- data/rust-vendor/wit-component/tests/components/lower-options/module.wit +40 -0
- data/rust-vendor/wit-component/tests/components/many-same-names/component.wat +48 -0
- data/rust-vendor/wit-component/tests/components/many-same-names/component.wit.print +10 -0
- data/rust-vendor/wit-component/tests/components/many-same-names/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/many-same-names/module.wit +21 -0
- data/rust-vendor/wit-component/tests/components/merge-import-versions/component.wat +125 -0
- data/rust-vendor/wit-component/tests/components/merge-import-versions/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/merge-import-versions/module.wat +15 -0
- data/rust-vendor/wit-component/tests/components/merge-import-versions/module.wit +30 -0
- data/rust-vendor/wit-component/tests/components/merge-import-versions-with-adapter/adapt-old.wat +10 -0
- data/rust-vendor/wit-component/tests/components/merge-import-versions-with-adapter/adapt-old.wit +19 -0
- data/rust-vendor/wit-component/tests/components/merge-import-versions-with-adapter/component.wat +104 -0
- data/rust-vendor/wit-component/tests/components/merge-import-versions-with-adapter/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/merge-import-versions-with-adapter/module.wat +9 -0
- data/rust-vendor/wit-component/tests/components/merge-import-versions-with-adapter/module.wit +14 -0
- data/rust-vendor/wit-component/tests/components/multi-package/baz/qux/component.wat +90 -0
- data/rust-vendor/wit-component/tests/components/multi-package/baz/qux/component.wit.print +13 -0
- data/rust-vendor/wit-component/tests/components/multi-package/baz/qux/module.wat +7 -0
- data/rust-vendor/wit-component/tests/components/multi-package/component.wat +44 -0
- data/rust-vendor/wit-component/tests/components/multi-package/component.wit.print +4 -0
- data/rust-vendor/wit-component/tests/components/multi-package/foo/bar/component.wat +82 -0
- data/rust-vendor/wit-component/tests/components/multi-package/foo/bar/component.wit.print +13 -0
- data/rust-vendor/wit-component/tests/components/multi-package/foo/bar/module.wat +6 -0
- data/rust-vendor/wit-component/tests/components/multi-package/module.wit +25 -0
- data/rust-vendor/wit-component/tests/components/no-realloc-required/component.wat +67 -0
- data/rust-vendor/wit-component/tests/components/no-realloc-required/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/no-realloc-required/module.wat +4 -0
- data/rust-vendor/wit-component/tests/components/no-realloc-required/module.wit +7 -0
- data/rust-vendor/wit-component/tests/components/post-return/component.wat +36 -0
- data/rust-vendor/wit-component/tests/components/post-return/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/post-return/module.wat +6 -0
- data/rust-vendor/wit-component/tests/components/post-return/module.wit +5 -0
- data/rust-vendor/wit-component/tests/components/rename-import-interface/component.wat +29 -0
- data/rust-vendor/wit-component/tests/components/rename-import-interface/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/rename-import-interface/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/rename-import-interface/module.wit +9 -0
- data/rust-vendor/wit-component/tests/components/rename-interface/component.wat +39 -0
- data/rust-vendor/wit-component/tests/components/rename-interface/component.wit.print +10 -0
- data/rust-vendor/wit-component/tests/components/rename-interface/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/rename-interface/module.wit +18 -0
- data/rust-vendor/wit-component/tests/components/resource-intrinsics-with-just-import/component.wat +28 -0
- data/rust-vendor/wit-component/tests/components/resource-intrinsics-with-just-import/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/resource-intrinsics-with-just-import/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/resource-intrinsics-with-just-import/module.wit +7 -0
- data/rust-vendor/wit-component/tests/components/resource-used-through-import/component.wat +57 -0
- data/rust-vendor/wit-component/tests/components/resource-used-through-import/component.wit.print +11 -0
- data/rust-vendor/wit-component/tests/components/resource-used-through-import/module.wat +6 -0
- data/rust-vendor/wit-component/tests/components/resource-used-through-import/module.wit +13 -0
- data/rust-vendor/wit-component/tests/components/resource-using-export/component.wat +64 -0
- data/rust-vendor/wit-component/tests/components/resource-using-export/component.wit.print +10 -0
- data/rust-vendor/wit-component/tests/components/resource-using-export/module.wat +6 -0
- data/rust-vendor/wit-component/tests/components/resource-using-export/module.wit +16 -0
- data/rust-vendor/wit-component/tests/components/simple/component.wat +64 -0
- data/rust-vendor/wit-component/tests/components/simple/component.wit.print +7 -0
- data/rust-vendor/wit-component/tests/components/simple/module.wat +10 -0
- data/rust-vendor/wit-component/tests/components/simple/module.wit +7 -0
- data/rust-vendor/wit-component/tests/components/threading/component.wat +163 -0
- data/rust-vendor/wit-component/tests/components/threading/component.wit.print +6 -0
- data/rust-vendor/wit-component/tests/components/threading/module.wat +22 -0
- data/rust-vendor/wit-component/tests/components/threading/module.wit +10 -0
- data/rust-vendor/wit-component/tests/components/tricky-order/component.wat +44 -0
- data/rust-vendor/wit-component/tests/components/tricky-order/component.wit.print +11 -0
- data/rust-vendor/wit-component/tests/components/tricky-order/module.wat +1 -0
- data/rust-vendor/wit-component/tests/components/tricky-order/module.wit +20 -0
- data/rust-vendor/wit-component/tests/components/tricky-resources/component.wat +75 -0
- data/rust-vendor/wit-component/tests/components/tricky-resources/component.wit.print +11 -0
- data/rust-vendor/wit-component/tests/components/tricky-resources/module.wat +7 -0
- data/rust-vendor/wit-component/tests/components/tricky-resources/module.wit +19 -0
- data/rust-vendor/wit-component/tests/components/tricky-resources2/component.wat +50 -0
- data/rust-vendor/wit-component/tests/components/tricky-resources2/component.wit.print +10 -0
- data/rust-vendor/wit-component/tests/components/tricky-resources2/module.wat +4 -0
- data/rust-vendor/wit-component/tests/components/tricky-resources2/module.wit +14 -0
- data/rust-vendor/wit-component/tests/components/tricky-resources3/component.wat +44 -0
- data/rust-vendor/wit-component/tests/components/tricky-resources3/component.wit.print +9 -0
- data/rust-vendor/wit-component/tests/components/tricky-resources3/module.wat +1 -0
- data/rust-vendor/wit-component/tests/components/tricky-resources3/module.wit +17 -0
- data/rust-vendor/wit-component/tests/components/tricky-resources4/component.wat +64 -0
- data/rust-vendor/wit-component/tests/components/tricky-resources4/component.wit.print +8 -0
- data/rust-vendor/wit-component/tests/components/tricky-resources4/module.wat +6 -0
- data/rust-vendor/wit-component/tests/components/tricky-resources4/module.wit +16 -0
- data/rust-vendor/wit-component/tests/components/unused-import/component.wat +29 -0
- data/rust-vendor/wit-component/tests/components/unused-import/component.wit.print +5 -0
- data/rust-vendor/wit-component/tests/components/unused-import/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/unused-import/module.wit +12 -0
- data/rust-vendor/wit-component/tests/components/worlds-with-type-renamings/component.wat +67 -0
- data/rust-vendor/wit-component/tests/components/worlds-with-type-renamings/component.wit.print +8 -0
- data/rust-vendor/wit-component/tests/components/worlds-with-type-renamings/module.wat +12 -0
- data/rust-vendor/wit-component/tests/components/worlds-with-type-renamings/module.wit +17 -0
- data/rust-vendor/wit-component/tests/components/worlds-with-types/component.wat +25 -0
- data/rust-vendor/wit-component/tests/components/worlds-with-types/component.wit.print +11 -0
- data/rust-vendor/wit-component/tests/components/worlds-with-types/module.wat +3 -0
- data/rust-vendor/wit-component/tests/components/worlds-with-types/module.wit +10 -0
- data/rust-vendor/wit-component/tests/components.rs +291 -0
- data/rust-vendor/wit-component/tests/interfaces/console.wat +18 -0
- data/rust-vendor/wit-component/tests/interfaces/console.wit +5 -0
- data/rust-vendor/wit-component/tests/interfaces/console.wit.print +6 -0
- data/rust-vendor/wit-component/tests/interfaces/diamond-disambiguate/foo.wit.print +20 -0
- data/rust-vendor/wit-component/tests/interfaces/diamond-disambiguate/join.wit +10 -0
- data/rust-vendor/wit-component/tests/interfaces/diamond-disambiguate/shared1.wit +3 -0
- data/rust-vendor/wit-component/tests/interfaces/diamond-disambiguate/shared2.wit +3 -0
- data/rust-vendor/wit-component/tests/interfaces/diamond-disambiguate.wat +70 -0
- data/rust-vendor/wit-component/tests/interfaces/diamond.wat +107 -0
- data/rust-vendor/wit-component/tests/interfaces/diamond.wit +31 -0
- data/rust-vendor/wit-component/tests/interfaces/diamond.wit.print +34 -0
- data/rust-vendor/wit-component/tests/interfaces/doc-comments/foo.wit +79 -0
- data/rust-vendor/wit-component/tests/interfaces/doc-comments/foo.wit.print +78 -0
- data/rust-vendor/wit-component/tests/interfaces/doc-comments.wat +73 -0
- data/rust-vendor/wit-component/tests/interfaces/empty.wat +50 -0
- data/rust-vendor/wit-component/tests/interfaces/empty.wit +12 -0
- data/rust-vendor/wit-component/tests/interfaces/empty.wit.print +16 -0
- data/rust-vendor/wit-component/tests/interfaces/export-other-packages-interface/deps/the-dep/the-doc.wit +9 -0
- data/rust-vendor/wit-component/tests/interfaces/export-other-packages-interface/foo.wit +5 -0
- data/rust-vendor/wit-component/tests/interfaces/export-other-packages-interface/foo.wit.print +5 -0
- data/rust-vendor/wit-component/tests/interfaces/export-other-packages-interface.wat +23 -0
- data/rust-vendor/wit-component/tests/interfaces/exports.wat +39 -0
- data/rust-vendor/wit-component/tests/interfaces/exports.wit +13 -0
- data/rust-vendor/wit-component/tests/interfaces/exports.wit.print +13 -0
- data/rust-vendor/wit-component/tests/interfaces/flags.wat +79 -0
- data/rust-vendor/wit-component/tests/interfaces/flags.wit +100 -0
- data/rust-vendor/wit-component/tests/interfaces/flags.wit.print +100 -0
- data/rust-vendor/wit-component/tests/interfaces/floats.wat +47 -0
- data/rust-vendor/wit-component/tests/interfaces/floats.wit +12 -0
- data/rust-vendor/wit-component/tests/interfaces/floats.wit.print +15 -0
- data/rust-vendor/wit-component/tests/interfaces/foreign-use-chain/deps/bar/bar.wit +9 -0
- data/rust-vendor/wit-component/tests/interfaces/foreign-use-chain/foo.wit +5 -0
- data/rust-vendor/wit-component/tests/interfaces/foreign-use-chain/foo.wit.print +6 -0
- data/rust-vendor/wit-component/tests/interfaces/foreign-use-chain.wat +31 -0
- data/rust-vendor/wit-component/tests/interfaces/import-and-export.wat +54 -0
- data/rust-vendor/wit-component/tests/interfaces/import-and-export.wit +14 -0
- data/rust-vendor/wit-component/tests/interfaces/import-and-export.wit.print +15 -0
- data/rust-vendor/wit-component/tests/interfaces/integers.wat +107 -0
- data/rust-vendor/wit-component/tests/interfaces/integers.wit +27 -0
- data/rust-vendor/wit-component/tests/interfaces/integers.wit.print +45 -0
- data/rust-vendor/wit-component/tests/interfaces/lists.wat +211 -0
- data/rust-vendor/wit-component/tests/interfaces/lists.wit +96 -0
- data/rust-vendor/wit-component/tests/interfaces/lists.wit.print +96 -0
- data/rust-vendor/wit-component/tests/interfaces/maps.wat +186 -0
- data/rust-vendor/wit-component/tests/interfaces/maps.wit +38 -0
- data/rust-vendor/wit-component/tests/interfaces/maps.wit.print +57 -0
- data/rust-vendor/wit-component/tests/interfaces/multi-doc/a.wit +9 -0
- data/rust-vendor/wit-component/tests/interfaces/multi-doc/b.wit +9 -0
- data/rust-vendor/wit-component/tests/interfaces/multi-doc/foo.wit.print +20 -0
- data/rust-vendor/wit-component/tests/interfaces/multi-doc.wat +78 -0
- data/rust-vendor/wit-component/tests/interfaces/multiple-use.wat +67 -0
- data/rust-vendor/wit-component/tests/interfaces/multiple-use.wit +16 -0
- data/rust-vendor/wit-component/tests/interfaces/multiple-use.wit.print +18 -0
- data/rust-vendor/wit-component/tests/interfaces/pkg-use-chain/chain.wit.print +18 -0
- data/rust-vendor/wit-component/tests/interfaces/pkg-use-chain/def.wit +13 -0
- data/rust-vendor/wit-component/tests/interfaces/pkg-use-chain/the-use.wit +5 -0
- data/rust-vendor/wit-component/tests/interfaces/pkg-use-chain.wat +70 -0
- data/rust-vendor/wit-component/tests/interfaces/pkg-use-chain2/bar.wit +13 -0
- data/rust-vendor/wit-component/tests/interfaces/pkg-use-chain2/foo.wit +5 -0
- data/rust-vendor/wit-component/tests/interfaces/pkg-use-chain2/foo.wit.print +20 -0
- data/rust-vendor/wit-component/tests/interfaces/pkg-use-chain2.wat +70 -0
- data/rust-vendor/wit-component/tests/interfaces/preserve-dep-type-order/deps/dep/foo.wit +11 -0
- data/rust-vendor/wit-component/tests/interfaces/preserve-dep-type-order/foo.wit +9 -0
- data/rust-vendor/wit-component/tests/interfaces/preserve-dep-type-order/foo.wit.print +9 -0
- data/rust-vendor/wit-component/tests/interfaces/preserve-dep-type-order.wat +47 -0
- data/rust-vendor/wit-component/tests/interfaces/preserve-foreign-reexport/deps/my-dep/my-doc.wit +8 -0
- data/rust-vendor/wit-component/tests/interfaces/preserve-foreign-reexport/foo.wit +5 -0
- data/rust-vendor/wit-component/tests/interfaces/preserve-foreign-reexport/foo.wit.print +5 -0
- data/rust-vendor/wit-component/tests/interfaces/preserve-foreign-reexport.wat +24 -0
- data/rust-vendor/wit-component/tests/interfaces/print-keyword.wat +21 -0
- data/rust-vendor/wit-component/tests/interfaces/print-keyword.wit +10 -0
- data/rust-vendor/wit-component/tests/interfaces/print-keyword.wit.print +12 -0
- data/rust-vendor/wit-component/tests/interfaces/records.wat +141 -0
- data/rust-vendor/wit-component/tests/interfaces/records.wit +63 -0
- data/rust-vendor/wit-component/tests/interfaces/records.wit.print +64 -0
- data/rust-vendor/wit-component/tests/interfaces/reference-out-of-order.wat +63 -0
- data/rust-vendor/wit-component/tests/interfaces/reference-out-of-order.wit +28 -0
- data/rust-vendor/wit-component/tests/interfaces/reference-out-of-order.wit.print +31 -0
- data/rust-vendor/wit-component/tests/interfaces/resources.wat +192 -0
- data/rust-vendor/wit-component/tests/interfaces/resources.wit +80 -0
- data/rust-vendor/wit-component/tests/interfaces/resources.wit.print +81 -0
- data/rust-vendor/wit-component/tests/interfaces/simple-deps/deps/some-dep/types.wit +5 -0
- data/rust-vendor/wit-component/tests/interfaces/simple-deps/foo.wit +4 -0
- data/rust-vendor/wit-component/tests/interfaces/simple-deps/foo.wit.print +6 -0
- data/rust-vendor/wit-component/tests/interfaces/simple-deps.wat +26 -0
- data/rust-vendor/wit-component/tests/interfaces/simple-multi/bar.wit +1 -0
- data/rust-vendor/wit-component/tests/interfaces/simple-multi/foo.wit +3 -0
- data/rust-vendor/wit-component/tests/interfaces/simple-multi/foo.wit.print +8 -0
- data/rust-vendor/wit-component/tests/interfaces/simple-multi.wat +24 -0
- data/rust-vendor/wit-component/tests/interfaces/simple-use.wat +40 -0
- data/rust-vendor/wit-component/tests/interfaces/simple-use.wit +13 -0
- data/rust-vendor/wit-component/tests/interfaces/simple-use.wit.print +15 -0
- data/rust-vendor/wit-component/tests/interfaces/simple-world.wat +35 -0
- data/rust-vendor/wit-component/tests/interfaces/simple-world.wit +9 -0
- data/rust-vendor/wit-component/tests/interfaces/simple-world.wit.print +9 -0
- data/rust-vendor/wit-component/tests/interfaces/single-named-result.wat +18 -0
- data/rust-vendor/wit-component/tests/interfaces/type-alias.wat +51 -0
- data/rust-vendor/wit-component/tests/interfaces/type-alias.wit +13 -0
- data/rust-vendor/wit-component/tests/interfaces/type-alias.wit.print +15 -0
- data/rust-vendor/wit-component/tests/interfaces/type-alias2.wat +41 -0
- data/rust-vendor/wit-component/tests/interfaces/type-alias2.wit +15 -0
- data/rust-vendor/wit-component/tests/interfaces/type-alias2.wit.print +15 -0
- data/rust-vendor/wit-component/tests/interfaces/upstream-deps-same-name/deps/a/the-name.wit +4 -0
- data/rust-vendor/wit-component/tests/interfaces/upstream-deps-same-name/deps/b/the-name.wit +4 -0
- data/rust-vendor/wit-component/tests/interfaces/upstream-deps-same-name/foo.wit +6 -0
- data/rust-vendor/wit-component/tests/interfaces/upstream-deps-same-name/foo.wit.print +7 -0
- data/rust-vendor/wit-component/tests/interfaces/upstream-deps-same-name.wat +36 -0
- data/rust-vendor/wit-component/tests/interfaces/use-chain.wat +72 -0
- data/rust-vendor/wit-component/tests/interfaces/use-chain.wit +15 -0
- data/rust-vendor/wit-component/tests/interfaces/use-chain.wit.print +18 -0
- data/rust-vendor/wit-component/tests/interfaces/use-for-type.wat +49 -0
- data/rust-vendor/wit-component/tests/interfaces/use-for-type.wit +16 -0
- data/rust-vendor/wit-component/tests/interfaces/use-for-type.wit.print +17 -0
- data/rust-vendor/wit-component/tests/interfaces/variants.wat +197 -0
- data/rust-vendor/wit-component/tests/interfaces/variants.wit +78 -0
- data/rust-vendor/wit-component/tests/interfaces/variants.wit.print +95 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/cli/command.wit +7 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/cli/environment.wit +18 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/cli/exit.wit +4 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/cli/imports.wit +20 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/cli/run.wit +4 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/cli/stdio.wit +17 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/cli/terminal.wit +47 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/clocks/monotonic-clock.wit +45 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/clocks/wall-clock.wit +42 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/clocks/world.wit +6 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/filesystem/preopens.wit +8 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/filesystem/types.wit +634 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/filesystem/world.wit +6 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/io/error.wit +34 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/io/poll.wit +41 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/io/streams.wit +251 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/io/world.wit +6 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/random/insecure-seed.wit +25 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/random/insecure.wit +22 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/random/random.wit +26 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/random/world.wit +7 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/sockets/instance-network.wit +9 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/sockets/ip-name-lookup.wit +51 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/sockets/network.wit +147 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/sockets/tcp-create-socket.wit +26 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/sockets/tcp.wit +321 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/sockets/udp-create-socket.wit +26 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/sockets/udp.wit +277 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/sockets/world.wit +11 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/handler.wit +43 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/http.wit.print +571 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/proxy.wit +32 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http/types.wit +570 -0
- data/rust-vendor/wit-component/tests/interfaces/wasi-http.wat +881 -0
- data/rust-vendor/wit-component/tests/interfaces/world-inline-interface.wat +24 -0
- data/rust-vendor/wit-component/tests/interfaces/world-inline-interface.wit +6 -0
- data/rust-vendor/wit-component/tests/interfaces/world-inline-interface.wit.print +9 -0
- data/rust-vendor/wit-component/tests/interfaces/world-pkg-conflict/bar.wit +3 -0
- data/rust-vendor/wit-component/tests/interfaces/world-pkg-conflict/foo.wit +9 -0
- data/rust-vendor/wit-component/tests/interfaces/world-pkg-conflict/foo.wit.print +12 -0
- data/rust-vendor/wit-component/tests/interfaces/world-pkg-conflict.wat +47 -0
- data/rust-vendor/wit-component/tests/interfaces/world-top-level.wat +55 -0
- data/rust-vendor/wit-component/tests/interfaces/world-top-level.wit +20 -0
- data/rust-vendor/wit-component/tests/interfaces/world-top-level.wit.print +19 -0
- data/rust-vendor/wit-component/tests/interfaces/worlds-with-types.wat +56 -0
- data/rust-vendor/wit-component/tests/interfaces/worlds-with-types.wit +23 -0
- data/rust-vendor/wit-component/tests/interfaces/worlds-with-types.wit.print +23 -0
- data/rust-vendor/wit-component/tests/interfaces.rs +123 -0
- data/rust-vendor/wit-component/tests/linking.rs +299 -0
- data/rust-vendor/wit-component/tests/merge/bad-interface1/error.txt +1 -0
- data/rust-vendor/wit-component/tests/merge/bad-interface1/from/a.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/bad-interface1/from/deps/foo/a.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/bad-interface1/into/a.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/bad-interface1/into/deps/foo/a.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/bad-interface2/error.txt +1 -0
- data/rust-vendor/wit-component/tests/merge/bad-interface2/from/a.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/bad-interface2/from/deps/foo/a.wit +7 -0
- data/rust-vendor/wit-component/tests/merge/bad-interface2/into/a.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/bad-interface2/into/deps/foo/a.wit +7 -0
- data/rust-vendor/wit-component/tests/merge/bad-world1/error.txt +1 -0
- data/rust-vendor/wit-component/tests/merge/bad-world1/from/a.wit +4 -0
- data/rust-vendor/wit-component/tests/merge/bad-world1/from/deps/foo/a.wit +11 -0
- data/rust-vendor/wit-component/tests/merge/bad-world1/into/a.wit +4 -0
- data/rust-vendor/wit-component/tests/merge/bad-world1/into/deps/foo/a.wit +9 -0
- data/rust-vendor/wit-component/tests/merge/bad-world2/error.txt +1 -0
- data/rust-vendor/wit-component/tests/merge/bad-world2/from/a.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/bad-world2/from/deps/foo/a.wit +8 -0
- data/rust-vendor/wit-component/tests/merge/bad-world2/into/a.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/bad-world2/into/deps/foo/a.wit +9 -0
- data/rust-vendor/wit-component/tests/merge/bad-world3/error.txt +1 -0
- data/rust-vendor/wit-component/tests/merge/bad-world3/from/a.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/bad-world3/from/deps/foo/a.wit +8 -0
- data/rust-vendor/wit-component/tests/merge/bad-world3/into/a.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/bad-world3/into/deps/foo/a.wit +9 -0
- data/rust-vendor/wit-component/tests/merge/bad-world4/error.txt +1 -0
- data/rust-vendor/wit-component/tests/merge/bad-world4/from/a.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/bad-world4/from/deps/foo/a.wit +11 -0
- data/rust-vendor/wit-component/tests/merge/bad-world4/into/a.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/bad-world4/into/deps/foo/a.wit +9 -0
- data/rust-vendor/wit-component/tests/merge/bad-world5/error.txt +1 -0
- data/rust-vendor/wit-component/tests/merge/bad-world5/from/a.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/bad-world5/from/deps/foo/a.wit +11 -0
- data/rust-vendor/wit-component/tests/merge/bad-world5/into/a.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/bad-world5/into/deps/foo/a.wit +9 -0
- data/rust-vendor/wit-component/tests/merge/success/from/a.wit +7 -0
- data/rust-vendor/wit-component/tests/merge/success/from/deps/foo/only-from.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/success/from/deps/foo/shared.wit +46 -0
- data/rust-vendor/wit-component/tests/merge/success/from/deps/only-from-dep/a.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/success/into/b.wit +7 -0
- data/rust-vendor/wit-component/tests/merge/success/into/deps/foo/only-into.wit +5 -0
- data/rust-vendor/wit-component/tests/merge/success/into/deps/foo/shared.wit +44 -0
- data/rust-vendor/wit-component/tests/merge/success/merge/foo.wit +77 -0
- data/rust-vendor/wit-component/tests/merge/success/merge/from.wit +8 -0
- data/rust-vendor/wit-component/tests/merge/success/merge/into.wit +8 -0
- data/rust-vendor/wit-component/tests/merge/success/merge/only-from-dep.wit +6 -0
- data/rust-vendor/wit-component/tests/merge.rs +80 -0
- data/rust-vendor/wit-component/tests/targets/error-missing-export/error.txt +2 -0
- data/rust-vendor/wit-component/tests/targets/error-missing-export/test.wat +39 -0
- data/rust-vendor/wit-component/tests/targets/error-missing-export/test.wit +18 -0
- data/rust-vendor/wit-component/tests/targets/error-missing-import/error.txt +2 -0
- data/rust-vendor/wit-component/tests/targets/error-missing-import/test.wat +37 -0
- data/rust-vendor/wit-component/tests/targets/error-missing-import/test.wit +13 -0
- data/rust-vendor/wit-component/tests/targets/success/test.wat +56 -0
- data/rust-vendor/wit-component/tests/targets/success/test.wit +14 -0
- data/rust-vendor/wit-component/tests/targets/success-empty/test.wat +1 -0
- data/rust-vendor/wit-component/tests/targets/success-empty/test.wit +9 -0
- data/rust-vendor/wit-component/tests/targets.rs +89 -0
- data/rust-vendor/wit-component/tests/wit/parse-dir/wit/deps/bar/bar.wit +9 -0
- data/rust-vendor/wit-component/tests/wit/parse-dir/wit/world.wit +5 -0
- data/rust-vendor/wit-component/tests/wit.rs +49 -0
- data/rust-vendor/wit-parser/.cargo-checksum.json +1 -0
- data/rust-vendor/wit-parser/.cargo_vcs_info.json +6 -0
- data/rust-vendor/wit-parser/Cargo.lock +576 -0
- data/rust-vendor/wit-parser/Cargo.toml +157 -0
- data/rust-vendor/wit-parser/Cargo.toml.orig +56 -0
- data/rust-vendor/wit-parser/README.md +13 -0
- data/rust-vendor/wit-parser/src/abi.rs +410 -0
- data/rust-vendor/wit-parser/src/ast/lex.rs +751 -0
- data/rust-vendor/wit-parser/src/ast/resolve.rs +1813 -0
- data/rust-vendor/wit-parser/src/ast/toposort.rs +249 -0
- data/rust-vendor/wit-parser/src/ast.rs +1958 -0
- data/rust-vendor/wit-parser/src/decoding.rs +1864 -0
- data/rust-vendor/wit-parser/src/lib.rs +1413 -0
- data/rust-vendor/wit-parser/src/live.rs +264 -0
- data/rust-vendor/wit-parser/src/metadata.rs +772 -0
- data/rust-vendor/wit-parser/src/resolve/clone.rs +227 -0
- data/rust-vendor/wit-parser/src/resolve.rs +4636 -0
- data/rust-vendor/wit-parser/src/serde_.rs +140 -0
- data/rust-vendor/wit-parser/src/sizealign.rs +626 -0
- data/rust-vendor/wit-parser/tests/.gitignore +2 -0
- data/rust-vendor/wit-parser/tests/all.rs +153 -0
- data/rust-vendor/wit-parser/tests/ui/async.wit +24 -0
- data/rust-vendor/wit-parser/tests/ui/async.wit.json +151 -0
- data/rust-vendor/wit-parser/tests/ui/comments.wit +25 -0
- data/rust-vendor/wit-parser/tests/ui/comments.wit.json +46 -0
- data/rust-vendor/wit-parser/tests/ui/complex-include/deps/bar/root.wit +9 -0
- data/rust-vendor/wit-parser/tests/ui/complex-include/deps/baz/root.wit +9 -0
- data/rust-vendor/wit-parser/tests/ui/complex-include/root.wit +26 -0
- data/rust-vendor/wit-parser/tests/ui/complex-include.wit.json +200 -0
- data/rust-vendor/wit-parser/tests/ui/cross-package-resource/deps/foo/foo.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/cross-package-resource/foo.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/cross-package-resource.wit.json +67 -0
- data/rust-vendor/wit-parser/tests/ui/diamond1/deps/dep1/types.wit +2 -0
- data/rust-vendor/wit-parser/tests/ui/diamond1/deps/dep2/types.wit +2 -0
- data/rust-vendor/wit-parser/tests/ui/diamond1/join.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/diamond1.wit.json +59 -0
- data/rust-vendor/wit-parser/tests/ui/disambiguate-diamond/shared1.wit +3 -0
- data/rust-vendor/wit-parser/tests/ui/disambiguate-diamond/shared2.wit +3 -0
- data/rust-vendor/wit-parser/tests/ui/disambiguate-diamond/world.wit +13 -0
- data/rust-vendor/wit-parser/tests/ui/disambiguate-diamond.wit.json +115 -0
- data/rust-vendor/wit-parser/tests/ui/empty.wit +1 -0
- data/rust-vendor/wit-parser/tests/ui/empty.wit.json +12 -0
- data/rust-vendor/wit-parser/tests/ui/error-context.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/error-context.wit.json +59 -0
- data/rust-vendor/wit-parser/tests/ui/feature-gates.wit +118 -0
- data/rust-vendor/wit-parser/tests/ui/feature-gates.wit.json +301 -0
- data/rust-vendor/wit-parser/tests/ui/feature-types.wit +13 -0
- data/rust-vendor/wit-parser/tests/ui/feature-types.wit.json +66 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps/deps/another-pkg/other-doc.wit +3 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps/deps/corp/saas.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps/deps/different-pkg/the-doc.wit +2 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps/deps/foreign-pkg/the-doc.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps/deps/some-pkg/some-doc.wit +13 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps/deps/wasi/clocks.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps/deps/wasi/filesystem.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps/root.wit +44 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/deps/another-pkg/other-doc.wit +3 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/deps/corp/saas.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/deps/different-pkg/the-doc.wit +2 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/deps/foreign-pkg/the-doc.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/deps/some-pkg/some-doc.wit +13 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/deps/wasi/clocks.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/deps/wasi/filesystem.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/deps/wasi/wasi.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/root.wit +50 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps-union.wit.json +410 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-deps.wit.json +362 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-interface-dep-gated.wit +17 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-interface-dep-gated.wit.json +39 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-world-dep-gated.wit +17 -0
- data/rust-vendor/wit-parser/tests/ui/foreign-world-dep-gated.wit.json +39 -0
- data/rust-vendor/wit-parser/tests/ui/functions.wit +11 -0
- data/rust-vendor/wit-parser/tests/ui/functions.wit.json +115 -0
- data/rust-vendor/wit-parser/tests/ui/gated-include.wit +67 -0
- data/rust-vendor/wit-parser/tests/ui/gated-include.wit.json +346 -0
- data/rust-vendor/wit-parser/tests/ui/gated-use.wit +13 -0
- data/rust-vendor/wit-parser/tests/ui/gated-use.wit.json +34 -0
- data/rust-vendor/wit-parser/tests/ui/ignore-files-deps/deps/bar/types.wit +2 -0
- data/rust-vendor/wit-parser/tests/ui/ignore-files-deps/deps/ignore-me.txt +1 -0
- data/rust-vendor/wit-parser/tests/ui/ignore-files-deps/world.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/ignore-files-deps.wit.json +41 -0
- data/rust-vendor/wit-parser/tests/ui/import-export-overlap1.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/import-export-overlap1.wit.json +37 -0
- data/rust-vendor/wit-parser/tests/ui/import-export-overlap2.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/import-export-overlap2.wit.json +42 -0
- data/rust-vendor/wit-parser/tests/ui/include-reps.wit +15 -0
- data/rust-vendor/wit-parser/tests/ui/include-reps.wit.json +68 -0
- data/rust-vendor/wit-parser/tests/ui/kebab-name-include-with.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/kebab-name-include-with.wit.json +66 -0
- data/rust-vendor/wit-parser/tests/ui/kinds-of-deps/a.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/kinds-of-deps/deps/b/root.wit +3 -0
- data/rust-vendor/wit-parser/tests/ui/kinds-of-deps/deps/c.wit +3 -0
- data/rust-vendor/wit-parser/tests/ui/kinds-of-deps/deps/d.wat +6 -0
- data/rust-vendor/wit-parser/tests/ui/kinds-of-deps/deps/e.wasm +0 -0
- data/rust-vendor/wit-parser/tests/ui/kinds-of-deps.wit.json +95 -0
- data/rust-vendor/wit-parser/tests/ui/many-names/a.wit +2 -0
- data/rust-vendor/wit-parser/tests/ui/many-names/b.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/many-names.wit.json +42 -0
- data/rust-vendor/wit-parser/tests/ui/maps.wit +34 -0
- data/rust-vendor/wit-parser/tests/ui/maps.wit.json +255 -0
- data/rust-vendor/wit-parser/tests/ui/multi-file/bar.wit +21 -0
- data/rust-vendor/wit-parser/tests/ui/multi-file/cycle-a.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/multi-file/cycle-b.wit +3 -0
- data/rust-vendor/wit-parser/tests/ui/multi-file/foo.wit +31 -0
- data/rust-vendor/wit-parser/tests/ui/multi-file-multi-package/a.wit +24 -0
- data/rust-vendor/wit-parser/tests/ui/multi-file-multi-package/b.wit +23 -0
- data/rust-vendor/wit-parser/tests/ui/multi-file-multi-package.wit.json +255 -0
- data/rust-vendor/wit-parser/tests/ui/multi-file.wit.json +300 -0
- data/rust-vendor/wit-parser/tests/ui/multi-package-deps/deps/dep.wit +13 -0
- data/rust-vendor/wit-parser/tests/ui/multi-package-deps/root.wit +16 -0
- data/rust-vendor/wit-parser/tests/ui/multi-package-deps.wit.json +161 -0
- data/rust-vendor/wit-parser/tests/ui/multi-package-gated-include.wit +114 -0
- data/rust-vendor/wit-parser/tests/ui/multi-package-gated-include.wit.json +697 -0
- data/rust-vendor/wit-parser/tests/ui/multi-package-shared-deps/deps/dep1/types.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/multi-package-shared-deps/deps/dep2/types.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/multi-package-shared-deps/packages.wit +41 -0
- data/rust-vendor/wit-parser/tests/ui/multi-package-shared-deps.wit.json +261 -0
- data/rust-vendor/wit-parser/tests/ui/multi-package-transitive-deps/deps/dep1/types.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/multi-package-transitive-deps/deps/dep2/types.wit +14 -0
- data/rust-vendor/wit-parser/tests/ui/multi-package-transitive-deps/packages.wit +12 -0
- data/rust-vendor/wit-parser/tests/ui/multi-package-transitive-deps.wit.json +174 -0
- data/rust-vendor/wit-parser/tests/ui/name-both-resource-and-type/deps/dep/foo.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/name-both-resource-and-type/foo.wit +9 -0
- data/rust-vendor/wit-parser/tests/ui/name-both-resource-and-type.wit.json +89 -0
- data/rust-vendor/wit-parser/tests/ui/package-syntax1.wit +1 -0
- data/rust-vendor/wit-parser/tests/ui/package-syntax1.wit.json +12 -0
- data/rust-vendor/wit-parser/tests/ui/package-syntax3.wit +1 -0
- data/rust-vendor/wit-parser/tests/ui/package-syntax3.wit.json +12 -0
- data/rust-vendor/wit-parser/tests/ui/package-syntax4.wit +1 -0
- data/rust-vendor/wit-parser/tests/ui/package-syntax4.wit.json +12 -0
- data/rust-vendor/wit-parser/tests/ui/packages-multiple-nested.wit +35 -0
- data/rust-vendor/wit-parser/tests/ui/packages-multiple-nested.wit.json +184 -0
- data/rust-vendor/wit-parser/tests/ui/packages-nested-colliding-decl-names.wit +24 -0
- data/rust-vendor/wit-parser/tests/ui/packages-nested-colliding-decl-names.wit.json +135 -0
- data/rust-vendor/wit-parser/tests/ui/packages-nested-internal-references.wit +16 -0
- data/rust-vendor/wit-parser/tests/ui/packages-nested-internal-references.wit.json +91 -0
- data/rust-vendor/wit-parser/tests/ui/packages-nested-with-semver.wit +24 -0
- data/rust-vendor/wit-parser/tests/ui/packages-nested-with-semver.wit.json +135 -0
- data/rust-vendor/wit-parser/tests/ui/packages-single-nested.wit +12 -0
- data/rust-vendor/wit-parser/tests/ui/packages-single-nested.wit.json +75 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/alias-no-type.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/alias-no-type.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad-world.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad-world.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad-world2.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad-world2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad-world3.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad-world3.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad-world4.wit +11 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad-world4.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad1.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad1.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad2.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/async.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/async1.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-deprecated1.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-deprecated1.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-deprecated2.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-deprecated2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-deprecated3.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-deprecated3.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-deprecated4.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-deprecated4.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-function.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-function.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-function2.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-function2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate1.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate1.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate2.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate3.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate3.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate4.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate4.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate5.wit +11 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate5.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-include1.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-include1.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-include2.wit +9 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-include2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-include3.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-include3.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-list.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-list.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-list2.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-list2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-list3.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-list3.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-list4.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-list4.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg1/root.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg1.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg2/deps/bar/empty.wit +1 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg2/root.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg3/deps/bar/.gitkeep +0 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg3/deps/bar/baz.wit +2 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg3/root.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg3.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg4/deps/bar/.gitkeep +0 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg4/deps/bar/baz.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg4/root.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg4.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg5/deps/bar/.gitkeep +0 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg5/deps/bar/baz.wit +3 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg5/root.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg5.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg6/deps/bar/.gitkeep +0 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg6/deps/bar/baz.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg6/root.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg6.wit.result +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource1.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource1.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource10.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource10.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource11.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource11.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource12.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource12.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource13.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource13.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource14.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource14.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource15/deps/foo/foo.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource15/foo.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource15.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource16.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource16.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource17.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource17.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource2.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource3.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource3.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource4.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource4.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource5.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource5.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource6.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource6.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource7.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource7.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource8.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource8.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource9.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource9.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-since1.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-since1.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-since3.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-since3.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-world-type1.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-world-type1.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/case-insensitive-duplicates.wit +9 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/case-insensitive-duplicates.wit.result +1 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/conflicting-package/a.wit +1 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/conflicting-package/b.wit +1 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/conflicting-package.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle2.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle3.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle3.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle4.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle4.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle5.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle5.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/dangling-type.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/dangling-type.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-function-params.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-function-params.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-functions.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-functions.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-interface.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-interface.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-interface2/foo.wit +3 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-interface2/foo2.wit +3 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-interface2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-type.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-type.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/empty-enum.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/empty-enum.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/empty-variant1.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/empty-variant1.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/export-twice.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/export-twice.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export1.wit +17 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export1.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export2.wit +18 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export3.wit +37 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export3.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export4.wit +44 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export4.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export5.wit +18 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export5.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/import-twice.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/import-twice.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/include-cycle.wit +9 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/include-cycle.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/include-foreign/deps/bar/empty.wit +3 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/include-foreign/root.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/include-foreign.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/include-with-id.wit +11 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/include-with-id.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/include-with-on-id.wit +11 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/include-with-on-id.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/invalid-toplevel.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/invalid-toplevel.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/invalid-type-reference.wit +10 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/invalid-type-reference.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/invalid-type-reference2.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/invalid-type-reference2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/kebab-name-include-not-found.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/kebab-name-include-not-found.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/kebab-name-include.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/kebab-name-include.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/keyword.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/keyword.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/map-invalid-key.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/map-invalid-key.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/missing-main-declaration-initial-main.wit +23 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/missing-main-declaration-initial-main.wit.result +1 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/missing-main-declaration-initial-nested.wit +23 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/missing-main-declaration-initial-nested.wit.result +1 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/missing-package.wit +0 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/missing-package.wit.result +1 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/multi-file-missing-delimiter/observe.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/multi-file-missing-delimiter/world.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/multi-file-missing-delimiter.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/multi-package-deps-share-nest/deps/dep1/types.wit +12 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/multi-package-deps-share-nest/deps/dep2/types.wit +12 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/multi-package-deps-share-nest/root.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/multi-package-deps-share-nest.wit.result +3 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/multiple-package-docs/a.wit +2 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/multiple-package-docs/b.wit +2 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/multiple-package-docs.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/multiple-package-inline-cycle.wit +12 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/multiple-package-inline-cycle.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/multiple-packages-no-scope-blocks.wit +15 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/multiple-packages-no-scope-blocks.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/nested-packages-colliding-names.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/nested-packages-colliding-names.wit.result +3 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/nested-packages-with-error.wit +14 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/nested-packages-with-error.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/no-access-to-sibling-use/bar.wit +1 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/no-access-to-sibling-use/foo.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/no-access-to-sibling-use.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/non-existance-world-include/deps/bar/.gitkeep +0 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/non-existance-world-include/deps/bar/baz.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/non-existance-world-include/root.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/non-existance-world-include.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/old-float-types.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/old-float-types.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/pkg-cycle/deps/a1/root.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/pkg-cycle/root.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/pkg-cycle.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/pkg-cycle2/deps/a1/root.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/pkg-cycle2/deps/a2/root.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/pkg-cycle2/root.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/pkg-cycle2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/resources-multiple-returns-borrow.wit +10 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/resources-multiple-returns-borrow.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/resources-return-borrow.wit +10 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/resources-return-borrow.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow1.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow1.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow2.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow3.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow3.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow4.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow4.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow5.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow5.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow6.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow6.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow7.wit +11 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow7.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow8/deps/baz.wit +9 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow8/foo.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow8.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/type-and-resource-same-name/deps/dep/foo.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/type-and-resource-same-name/foo.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/type-and-resource-same-name.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/undefined-typed.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/undefined-typed.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unknown-interface.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unknown-interface.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-interface1.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-interface1.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-interface2.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-interface2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-interface3.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-interface3.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-interface4.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-interface4.wit.result +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use1.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use1.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use10/bar.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use10/foo.wit +2 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use10.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use2.wit +10 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use3.wit +11 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use3.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use7.wit +10 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use7.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use8.wit +9 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use8.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use9.wit +9 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use9.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/unterminated-string.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-and-include-world/deps/bar/.gitkeep +0 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-and-include-world/deps/bar/baz.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-and-include-world/root.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-and-include-world.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-conflict.wit +11 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-conflict.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-conflict2.wit +13 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-conflict2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-conflict3.wit +13 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-conflict3.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-cycle1.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-cycle1.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-cycle4.wit +14 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-cycle4.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-shadow1.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-shadow1.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-world/deps/bar/.gitkeep +0 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-world/deps/bar/baz.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-world/root.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/use-world.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/very-nested-packages.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/very-nested-packages.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/world-interface-clash.wit +3 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/world-interface-clash.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/world-same-fields2.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/world-same-fields2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/world-same-fields3.wit +8 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/world-same-fields3.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/world-top-level-func.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/world-top-level-func.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/world-top-level-func2.wit +4 -0
- data/rust-vendor/wit-parser/tests/ui/parse-fail/world-top-level-func2.wit.result +5 -0
- data/rust-vendor/wit-parser/tests/ui/random.wit +27 -0
- data/rust-vendor/wit-parser/tests/ui/random.wit.json +56 -0
- data/rust-vendor/wit-parser/tests/ui/resources-empty.wit +10 -0
- data/rust-vendor/wit-parser/tests/ui/resources-empty.wit.json +70 -0
- data/rust-vendor/wit-parser/tests/ui/resources-multiple-returns-own.wit +10 -0
- data/rust-vendor/wit-parser/tests/ui/resources-multiple-returns-own.wit.json +85 -0
- data/rust-vendor/wit-parser/tests/ui/resources-multiple.wit +17 -0
- data/rust-vendor/wit-parser/tests/ui/resources-multiple.wit.json +207 -0
- data/rust-vendor/wit-parser/tests/ui/resources-return-own.wit +10 -0
- data/rust-vendor/wit-parser/tests/ui/resources-return-own.wit.json +73 -0
- data/rust-vendor/wit-parser/tests/ui/resources.wit +55 -0
- data/rust-vendor/wit-parser/tests/ui/resources.wit.json +387 -0
- data/rust-vendor/wit-parser/tests/ui/resources1.wit +12 -0
- data/rust-vendor/wit-parser/tests/ui/resources1.wit.json +92 -0
- data/rust-vendor/wit-parser/tests/ui/same-name-import-export.wit +6 -0
- data/rust-vendor/wit-parser/tests/ui/same-name-import-export.wit.json +39 -0
- data/rust-vendor/wit-parser/tests/ui/shared-types.wit +10 -0
- data/rust-vendor/wit-parser/tests/ui/shared-types.wit.json +79 -0
- data/rust-vendor/wit-parser/tests/ui/simple-wasm-text.wat +6 -0
- data/rust-vendor/wit-parser/tests/ui/simple-wasm-text.wit.json +21 -0
- data/rust-vendor/wit-parser/tests/ui/since-and-unstable.wit +107 -0
- data/rust-vendor/wit-parser/tests/ui/since-and-unstable.wit.json +608 -0
- data/rust-vendor/wit-parser/tests/ui/streams-and-futures.wit +15 -0
- data/rust-vendor/wit-parser/tests/ui/streams-and-futures.wit.json +205 -0
- data/rust-vendor/wit-parser/tests/ui/stress-export-elaborate.wit +54 -0
- data/rust-vendor/wit-parser/tests/ui/stress-export-elaborate.wit.json +1156 -0
- data/rust-vendor/wit-parser/tests/ui/type-then-eof.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/type-then-eof.wit.json +28 -0
- data/rust-vendor/wit-parser/tests/ui/types.wit +59 -0
- data/rust-vendor/wit-parser/tests/ui/types.wit.json +768 -0
- data/rust-vendor/wit-parser/tests/ui/union-fuzz-1.wit +9 -0
- data/rust-vendor/wit-parser/tests/ui/union-fuzz-1.wit.json +35 -0
- data/rust-vendor/wit-parser/tests/ui/union-fuzz-2.wit +12 -0
- data/rust-vendor/wit-parser/tests/ui/union-fuzz-2.wit.json +62 -0
- data/rust-vendor/wit-parser/tests/ui/unstable-resource.wit +17 -0
- data/rust-vendor/wit-parser/tests/ui/unstable-resource.wit.json +44 -0
- data/rust-vendor/wit-parser/tests/ui/use-chain.wit +11 -0
- data/rust-vendor/wit-parser/tests/ui/use-chain.wit.json +53 -0
- data/rust-vendor/wit-parser/tests/ui/use.wit +34 -0
- data/rust-vendor/wit-parser/tests/ui/use.wit.json +168 -0
- data/rust-vendor/wit-parser/tests/ui/version-syntax.wit +10 -0
- data/rust-vendor/wit-parser/tests/ui/version-syntax.wit.json +57 -0
- data/rust-vendor/wit-parser/tests/ui/versions/deps/a1/foo.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/versions/deps/a2/foo.wit +5 -0
- data/rust-vendor/wit-parser/tests/ui/versions/foo.wit +7 -0
- data/rust-vendor/wit-parser/tests/ui/versions.wit.json +91 -0
- data/rust-vendor/wit-parser/tests/ui/wasi.wit +178 -0
- data/rust-vendor/wit-parser/tests/ui/wasi.wit.json +539 -0
- data/rust-vendor/wit-parser/tests/ui/with-resource-as.wit +15 -0
- data/rust-vendor/wit-parser/tests/ui/with-resource-as.wit.json +221 -0
- data/rust-vendor/wit-parser/tests/ui/world-diamond.wit +23 -0
- data/rust-vendor/wit-parser/tests/ui/world-diamond.wit.json +115 -0
- data/rust-vendor/wit-parser/tests/ui/world-iface-no-collide.wit +11 -0
- data/rust-vendor/wit-parser/tests/ui/world-iface-no-collide.wit.json +67 -0
- data/rust-vendor/wit-parser/tests/ui/world-implicit-import1.wit +12 -0
- data/rust-vendor/wit-parser/tests/ui/world-implicit-import1.wit.json +81 -0
- data/rust-vendor/wit-parser/tests/ui/world-implicit-import2.wit +11 -0
- data/rust-vendor/wit-parser/tests/ui/world-implicit-import2.wit.json +68 -0
- data/rust-vendor/wit-parser/tests/ui/world-implicit-import3.wit +11 -0
- data/rust-vendor/wit-parser/tests/ui/world-implicit-import3.wit.json +69 -0
- data/rust-vendor/wit-parser/tests/ui/world-same-fields4.wit +13 -0
- data/rust-vendor/wit-parser/tests/ui/world-same-fields4.wit.json +82 -0
- data/rust-vendor/wit-parser/tests/ui/world-top-level-funcs.wit +9 -0
- data/rust-vendor/wit-parser/tests/ui/world-top-level-funcs.wit.json +79 -0
- data/rust-vendor/wit-parser/tests/ui/world-top-level-resources.wit +24 -0
- data/rust-vendor/wit-parser/tests/ui/world-top-level-resources.wit.json +225 -0
- data/rust-vendor/wit-parser/tests/ui/worlds-union-dedup.wit +23 -0
- data/rust-vendor/wit-parser/tests/ui/worlds-union-dedup.wit.json +112 -0
- data/rust-vendor/wit-parser/tests/ui/worlds-with-types.wit +34 -0
- data/rust-vendor/wit-parser/tests/ui/worlds-with-types.wit.json +188 -0
- data/rust-vendor/zerocopy/.cargo-checksum.json +1 -1
- data/rust-vendor/zerocopy/.cargo_vcs_info.json +1 -2
- data/rust-vendor/zerocopy/Cargo.lock +3 -3
- data/rust-vendor/zerocopy/Cargo.toml +4 -4
- data/rust-vendor/zerocopy/Cargo.toml.orig +4 -4
- data/rust-vendor/zerocopy/agent_docs/reviewing.md +8 -0
- data/rust-vendor/zerocopy/build.rs +1 -0
- data/rust-vendor/zerocopy/ci/release_crate_version.sh +3 -0
- data/rust-vendor/zerocopy/src/doctests.rs +18 -2
- data/rust-vendor/zerocopy/src/impls.rs +7 -4
- data/rust-vendor/zerocopy/src/lib.rs +60 -28
- data/rust-vendor/zerocopy/src/macros.rs +24 -4
- data/rust-vendor/zerocopy/src/pointer/invariant.rs +31 -3
- data/rust-vendor/zerocopy/src/pointer/mod.rs +2 -2
- data/rust-vendor/zerocopy/src/pointer/ptr.rs +3 -3
- data/rust-vendor/zerocopy/src/util/macros.rs +21 -6
- data/rust-vendor/zerocopy/tests/trybuild.rs +3 -18
- data/rust-vendor/zerocopy-derive/.cargo-checksum.json +1 -1
- data/rust-vendor/zerocopy-derive/.cargo_vcs_info.json +1 -1
- data/rust-vendor/zerocopy-derive/Cargo.lock +1 -1
- data/rust-vendor/zerocopy-derive/Cargo.toml +9 -2
- data/rust-vendor/zerocopy-derive/Cargo.toml.orig +5 -2
- data/rust-vendor/zerocopy-derive/src/derive/from_bytes.rs +9 -7
- data/rust-vendor/zerocopy-derive/src/derive/into_bytes.rs +8 -4
- data/rust-vendor/zerocopy-derive/src/derive/try_from_bytes.rs +52 -18
- data/rust-vendor/zerocopy-derive/src/derive/unaligned.rs +3 -3
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/from_bytes_enum.expected.rs +7 -3
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/from_bytes_struct.expected.rs +7 -3
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/from_bytes_union.expected.rs +7 -3
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/from_zeros.expected.rs +7 -3
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes.expected.rs +7 -3
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes_enum_1.expected.rs +22 -10
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes_enum_2.expected.rs +22 -10
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes_enum_3.expected.rs +22 -10
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes_trivial_is_bit_valid_enum.expected.rs +7 -3
- data/rust-vendor/zerocopy-derive/src/util.rs +72 -5
- data/rust-vendor/zerocopy-derive/tests/on_error.rs +169 -0
- data/rust-vendor/zerocopy-derive/tests/trybuild.rs +9 -7
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/cfgs/on_error.rs +19 -0
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/cfgs/on_error.stderr +16 -0
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/{union_into_bytes_cfg → cfgs}/union_into_bytes_cfg.stderr +1 -1
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/cfgs/on_error.rs +19 -0
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/cfgs/on_error.stderr +31 -0
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/cfgs/union_into_bytes_cfg.stderr +8 -0
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/union.stderr +0 -14
- data/rust-vendor/zerocopy-derive/tests/ui-stable/cfgs/on_error.rs +19 -0
- data/rust-vendor/zerocopy-derive/tests/ui-stable/cfgs/on_error.stderr +27 -0
- data/rust-vendor/zerocopy-derive/tests/ui-stable/cfgs/union_into_bytes_cfg.stderr +8 -0
- data/rust-vendor/zerocopy-derive/tests/ui-stable/union.stderr +0 -14
- data/rust-vendor/zmij/.cargo-checksum.json +1 -1
- data/rust-vendor/zmij/.cargo_vcs_info.json +1 -1
- data/rust-vendor/zmij/.github/workflows/ci.yml +9 -6
- data/rust-vendor/zmij/Cargo.lock +281 -58
- data/rust-vendor/zmij/Cargo.toml +3 -3
- data/rust-vendor/zmij/Cargo.toml.orig +3 -3
- data/rust-vendor/zmij/README.md +1 -1
- data/rust-vendor/zmij/src/lib.rs +124 -79
- data/rust-vendor/zmij/src/tests.rs +11 -5
- data/rust-vendor/zmij/tests/ryu_comparison.rs +3 -3
- metadata +1841 -55
- data/rust-vendor/libc/src/qurt/hexagon.rs +0 -340
- data/rust-vendor/regex/.vim/coc-settings.json +0 -6
- data/rust-vendor/regex/Cross.toml +0 -7
- data/rust-vendor/regex/rustfmt.toml +0 -2
- data/rust-vendor/regex/test +0 -46
- data/rust-vendor/regex/testdata/README.md +0 -22
- data/rust-vendor/regex/testdata/fowler/basic.toml +0 -1611
- data/rust-vendor/regex/testdata/fowler/dat/README +0 -25
- data/rust-vendor/regex/testdata/fowler/dat/basic.dat +0 -223
- data/rust-vendor/regex/testdata/fowler/dat/nullsubexpr.dat +0 -74
- data/rust-vendor/regex/testdata/fowler/dat/repetition.dat +0 -169
- data/rust-vendor/regex/testdata/fowler/nullsubexpr.toml +0 -405
- data/rust-vendor/regex/testdata/fowler/repetition.toml +0 -746
- data/rust-vendor/regex-automata/test +0 -95
- data/rust-vendor/regex-automata/tests/fuzz/mod.rs +0 -2
- data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_dense_crash-9486fb7c8a93b12c12a62166b43d31640c0208a9 +0 -0
- data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_dense_minimized-from-9486fb7c8a93b12c12a62166b43d31640c0208a9 +0 -0
- data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_sparse_crash-0da59c0434eaf35e5a6b470fa9244bb79c72b000 +0 -0
- data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_sparse_crash-18cfc246f2ddfc3dfc92b0c7893178c7cf65efa9 +0 -0
- data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_sparse_crash-61fd8e3003bf9d99f6c1e5a8488727eefd234b98 +0 -0
- data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_sparse_crash-a1b839d899ced76d5d7d0f78f9edb7a421505838 +0 -0
- data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_sparse_crash-c383ae07ec5e191422eadc492117439011816570 +0 -0
- data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_sparse_crash-d07703ceb94b10dcd9e4acb809f2051420449e2b +0 -0
- data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_sparse_crash-dbb8172d3984e7e7d03f4b5f8bb86ecd1460eff9 +0 -0
- data/rust-vendor/regex-automata/tests/gen/README.md +0 -65
- data/rust-vendor/regex-automata/tests/gen/dense/multi_pattern_v2_fwd.bigendian.dfa +0 -0
- data/rust-vendor/regex-automata/tests/gen/dense/multi_pattern_v2_fwd.littleendian.dfa +0 -0
- data/rust-vendor/regex-automata/tests/gen/dense/multi_pattern_v2_rev.bigendian.dfa +0 -0
- data/rust-vendor/regex-automata/tests/gen/dense/multi_pattern_v2_rev.littleendian.dfa +0 -0
- data/rust-vendor/regex-automata/tests/gen/sparse/multi_pattern_v2_fwd.bigendian.dfa +0 -0
- data/rust-vendor/regex-automata/tests/gen/sparse/multi_pattern_v2_fwd.littleendian.dfa +0 -0
- data/rust-vendor/regex-automata/tests/gen/sparse/multi_pattern_v2_rev.bigendian.dfa +0 -0
- data/rust-vendor/regex-automata/tests/gen/sparse/multi_pattern_v2_rev.littleendian.dfa +0 -0
- data/rust-vendor/regex-syntax/benches/bench.rs +0 -63
- data/rust-vendor/regex-syntax/test +0 -30
- data/rust-vendor/zerocopy/tests/ui-msrv/invalid-impls/invalid-impls.rs +0 -31
- data/rust-vendor/zerocopy/tests/ui-msrv/invalid-impls/invalid-impls.stderr +0 -159
- data/rust-vendor/zerocopy/tests/ui-nightly/invalid-impls/invalid-impls.rs +0 -31
- data/rust-vendor/zerocopy/tests/ui-nightly/invalid-impls/invalid-impls.stderr +0 -139
- data/rust-vendor/zerocopy/tests/ui-stable/invalid-impls/invalid-impls.rs +0 -31
- data/rust-vendor/zerocopy/tests/ui-stable/invalid-impls/invalid-impls.stderr +0 -155
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/union_into_bytes_cfg/union_into_bytes_cfg.stderr +0 -22
- data/rust-vendor/zerocopy-derive/tests/ui-stable/union_into_bytes_cfg/union_into_bytes_cfg.stderr +0 -22
- /data/rust-vendor/{getrandom → getrandom-0.3.4}/src/backends/sanitizer.rs +0 -0
- /data/rust-vendor/{getrandom → getrandom-0.3.4}/src/backends/wasi_p2.rs +0 -0
- /data/rust-vendor/{getrandom → getrandom-0.3.4}/src/lazy.rs +0 -0
- /data/rust-vendor/{getrandom → getrandom-0.3.4}/src/util_libc.rs +0 -0
- /data/rust-vendor/{wit-bindgen → wit-bindgen-0.46.0}/src/rt/wit_bindgen_cabi.c +0 -0
- /data/rust-vendor/{wit-bindgen → wit-bindgen-0.46.0}/src/rt/wit_bindgen_cabi.o +0 -0
- /data/rust-vendor/zerocopy-derive/tests/ui-msrv/{union_into_bytes_cfg → cfgs}/union_into_bytes_cfg.rs +0 -0
- /data/rust-vendor/zerocopy-derive/tests/ui-nightly/{union_into_bytes_cfg → cfgs}/union_into_bytes_cfg.rs +0 -0
- /data/rust-vendor/zerocopy-derive/tests/ui-stable/{union_into_bytes_cfg → cfgs}/union_into_bytes_cfg.rs +0 -0
|
@@ -0,0 +1,3121 @@
|
|
|
1
|
+
use crate::{Equivalent, TryReserveError};
|
|
2
|
+
use core::hash::{BuildHasher, Hash};
|
|
3
|
+
use core::iter::{Chain, FusedIterator};
|
|
4
|
+
use core::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Sub, SubAssign};
|
|
5
|
+
use core::{fmt, mem};
|
|
6
|
+
use map::make_hash;
|
|
7
|
+
|
|
8
|
+
use super::map::{self, HashMap, Keys};
|
|
9
|
+
use crate::raw::{Allocator, Global, RawExtractIf};
|
|
10
|
+
use crate::DefaultHashBuilder;
|
|
11
|
+
|
|
12
|
+
// Future Optimization (FIXME!)
|
|
13
|
+
// =============================
|
|
14
|
+
//
|
|
15
|
+
// Iteration over zero sized values is a noop. There is no need
|
|
16
|
+
// for `bucket.val` in the case of HashSet. I suppose we would need HKT
|
|
17
|
+
// to get rid of it properly.
|
|
18
|
+
|
|
19
|
+
/// A hash set implemented as a `HashMap` where the value is `()`.
|
|
20
|
+
///
|
|
21
|
+
/// As with the [`HashMap`] type, a `HashSet` requires that the elements
|
|
22
|
+
/// implement the [`Eq`] and [`Hash`] traits. This can frequently be achieved by
|
|
23
|
+
/// using `#[derive(PartialEq, Eq, Hash)]`. If you implement these yourself,
|
|
24
|
+
/// it is important that the following property holds:
|
|
25
|
+
///
|
|
26
|
+
/// ```text
|
|
27
|
+
/// k1 == k2 -> hash(k1) == hash(k2)
|
|
28
|
+
/// ```
|
|
29
|
+
///
|
|
30
|
+
/// In other words, if two keys are equal, their hashes must be equal.
|
|
31
|
+
///
|
|
32
|
+
///
|
|
33
|
+
/// It is a logic error for an item to be modified in such a way that the
|
|
34
|
+
/// item's hash, as determined by the [`Hash`] trait, or its equality, as
|
|
35
|
+
/// determined by the [`Eq`] trait, changes while it is in the set. This is
|
|
36
|
+
/// normally only possible through [`Cell`], [`RefCell`], global state, I/O, or
|
|
37
|
+
/// unsafe code.
|
|
38
|
+
///
|
|
39
|
+
/// It is also a logic error for the [`Hash`] implementation of a key to panic.
|
|
40
|
+
/// This is generally only possible if the trait is implemented manually. If a
|
|
41
|
+
/// panic does occur then the contents of the `HashSet` may become corrupted and
|
|
42
|
+
/// some items may be dropped from the table.
|
|
43
|
+
///
|
|
44
|
+
/// # Examples
|
|
45
|
+
///
|
|
46
|
+
/// ```
|
|
47
|
+
/// use hashbrown::HashSet;
|
|
48
|
+
/// // Type inference lets us omit an explicit type signature (which
|
|
49
|
+
/// // would be `HashSet<String>` in this example).
|
|
50
|
+
/// let mut books = HashSet::new();
|
|
51
|
+
///
|
|
52
|
+
/// // Add some books.
|
|
53
|
+
/// books.insert("A Dance With Dragons".to_string());
|
|
54
|
+
/// books.insert("To Kill a Mockingbird".to_string());
|
|
55
|
+
/// books.insert("The Odyssey".to_string());
|
|
56
|
+
/// books.insert("The Great Gatsby".to_string());
|
|
57
|
+
///
|
|
58
|
+
/// // Check for a specific one.
|
|
59
|
+
/// if !books.contains("The Winds of Winter") {
|
|
60
|
+
/// println!("We have {} books, but The Winds of Winter ain't one.",
|
|
61
|
+
/// books.len());
|
|
62
|
+
/// }
|
|
63
|
+
///
|
|
64
|
+
/// // Remove a book.
|
|
65
|
+
/// books.remove("The Odyssey");
|
|
66
|
+
///
|
|
67
|
+
/// // Iterate over everything.
|
|
68
|
+
/// for book in &books {
|
|
69
|
+
/// println!("{}", book);
|
|
70
|
+
/// }
|
|
71
|
+
/// ```
|
|
72
|
+
///
|
|
73
|
+
/// The easiest way to use `HashSet` with a custom type is to derive
|
|
74
|
+
/// [`Eq`] and [`Hash`]. We must also derive [`PartialEq`]. This will in the
|
|
75
|
+
/// future be implied by [`Eq`].
|
|
76
|
+
///
|
|
77
|
+
/// ```
|
|
78
|
+
/// use hashbrown::HashSet;
|
|
79
|
+
/// #[derive(Hash, Eq, PartialEq, Debug)]
|
|
80
|
+
/// struct Viking {
|
|
81
|
+
/// name: String,
|
|
82
|
+
/// power: usize,
|
|
83
|
+
/// }
|
|
84
|
+
///
|
|
85
|
+
/// let mut vikings = HashSet::new();
|
|
86
|
+
///
|
|
87
|
+
/// vikings.insert(Viking { name: "Einar".to_string(), power: 9 });
|
|
88
|
+
/// vikings.insert(Viking { name: "Einar".to_string(), power: 9 });
|
|
89
|
+
/// vikings.insert(Viking { name: "Olaf".to_string(), power: 4 });
|
|
90
|
+
/// vikings.insert(Viking { name: "Harald".to_string(), power: 8 });
|
|
91
|
+
///
|
|
92
|
+
/// // Use derived implementation to print the vikings.
|
|
93
|
+
/// for x in &vikings {
|
|
94
|
+
/// println!("{:?}", x);
|
|
95
|
+
/// }
|
|
96
|
+
/// ```
|
|
97
|
+
///
|
|
98
|
+
/// A `HashSet` with fixed list of elements can be initialized from an array:
|
|
99
|
+
///
|
|
100
|
+
/// ```
|
|
101
|
+
/// use hashbrown::HashSet;
|
|
102
|
+
///
|
|
103
|
+
/// let viking_names: HashSet<&'static str> =
|
|
104
|
+
/// [ "Einar", "Olaf", "Harald" ].into_iter().collect();
|
|
105
|
+
/// // use the values stored in the set
|
|
106
|
+
/// ```
|
|
107
|
+
///
|
|
108
|
+
/// [`Cell`]: https://doc.rust-lang.org/std/cell/struct.Cell.html
|
|
109
|
+
/// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html
|
|
110
|
+
/// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html
|
|
111
|
+
/// [`HashMap`]: struct.HashMap.html
|
|
112
|
+
/// [`PartialEq`]: https://doc.rust-lang.org/std/cmp/trait.PartialEq.html
|
|
113
|
+
/// [`RefCell`]: https://doc.rust-lang.org/std/cell/struct.RefCell.html
|
|
114
|
+
pub struct HashSet<T, S = DefaultHashBuilder, A: Allocator = Global> {
|
|
115
|
+
pub(crate) map: HashMap<T, (), S, A>,
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
impl<T: Clone, S: Clone, A: Allocator + Clone> Clone for HashSet<T, S, A> {
|
|
119
|
+
fn clone(&self) -> Self {
|
|
120
|
+
HashSet {
|
|
121
|
+
map: self.map.clone(),
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
fn clone_from(&mut self, source: &Self) {
|
|
126
|
+
self.map.clone_from(&source.map);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
#[cfg(feature = "default-hasher")]
|
|
131
|
+
impl<T> HashSet<T, DefaultHashBuilder> {
|
|
132
|
+
/// Creates an empty `HashSet`.
|
|
133
|
+
///
|
|
134
|
+
/// The hash set is initially created with a capacity of 0, so it will not allocate until it
|
|
135
|
+
/// is first inserted into.
|
|
136
|
+
///
|
|
137
|
+
/// # HashDoS resistance
|
|
138
|
+
///
|
|
139
|
+
/// The `hash_builder` normally use a fixed key by default and that does
|
|
140
|
+
/// not allow the `HashSet` to be protected against attacks such as [`HashDoS`].
|
|
141
|
+
/// Users who require HashDoS resistance should explicitly use
|
|
142
|
+
/// [`std::collections::hash_map::RandomState`]
|
|
143
|
+
/// as the hasher when creating a [`HashSet`], for example with
|
|
144
|
+
/// [`with_hasher`](HashSet::with_hasher) method.
|
|
145
|
+
///
|
|
146
|
+
/// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack
|
|
147
|
+
/// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html
|
|
148
|
+
///
|
|
149
|
+
/// # Examples
|
|
150
|
+
///
|
|
151
|
+
/// ```
|
|
152
|
+
/// use hashbrown::HashSet;
|
|
153
|
+
/// let set: HashSet<i32> = HashSet::new();
|
|
154
|
+
/// ```
|
|
155
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
156
|
+
pub fn new() -> Self {
|
|
157
|
+
Self {
|
|
158
|
+
map: HashMap::new(),
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/// Creates an empty `HashSet` with the specified capacity.
|
|
163
|
+
///
|
|
164
|
+
/// The hash set will be able to hold at least `capacity` elements without
|
|
165
|
+
/// reallocating. If `capacity` is 0, the hash set will not allocate.
|
|
166
|
+
///
|
|
167
|
+
/// # HashDoS resistance
|
|
168
|
+
///
|
|
169
|
+
/// The `hash_builder` normally use a fixed key by default and that does
|
|
170
|
+
/// not allow the `HashSet` to be protected against attacks such as [`HashDoS`].
|
|
171
|
+
/// Users who require HashDoS resistance should explicitly use
|
|
172
|
+
/// [`std::collections::hash_map::RandomState`]
|
|
173
|
+
/// as the hasher when creating a [`HashSet`], for example with
|
|
174
|
+
/// [`with_capacity_and_hasher`](HashSet::with_capacity_and_hasher) method.
|
|
175
|
+
///
|
|
176
|
+
/// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack
|
|
177
|
+
/// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html
|
|
178
|
+
///
|
|
179
|
+
/// # Examples
|
|
180
|
+
///
|
|
181
|
+
/// ```
|
|
182
|
+
/// use hashbrown::HashSet;
|
|
183
|
+
/// let set: HashSet<i32> = HashSet::with_capacity(10);
|
|
184
|
+
/// assert!(set.capacity() >= 10);
|
|
185
|
+
/// ```
|
|
186
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
187
|
+
pub fn with_capacity(capacity: usize) -> Self {
|
|
188
|
+
Self {
|
|
189
|
+
map: HashMap::with_capacity(capacity),
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
#[cfg(feature = "default-hasher")]
|
|
195
|
+
impl<T: Hash + Eq, A: Allocator> HashSet<T, DefaultHashBuilder, A> {
|
|
196
|
+
/// Creates an empty `HashSet`.
|
|
197
|
+
///
|
|
198
|
+
/// The hash set is initially created with a capacity of 0, so it will not allocate until it
|
|
199
|
+
/// is first inserted into.
|
|
200
|
+
///
|
|
201
|
+
/// # HashDoS resistance
|
|
202
|
+
///
|
|
203
|
+
/// The `hash_builder` normally use a fixed key by default and that does
|
|
204
|
+
/// not allow the `HashSet` to be protected against attacks such as [`HashDoS`].
|
|
205
|
+
/// Users who require HashDoS resistance should explicitly use
|
|
206
|
+
/// [`std::collections::hash_map::RandomState`]
|
|
207
|
+
/// as the hasher when creating a [`HashSet`], for example with
|
|
208
|
+
/// [`with_hasher_in`](HashSet::with_hasher_in) method.
|
|
209
|
+
///
|
|
210
|
+
/// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack
|
|
211
|
+
/// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html
|
|
212
|
+
///
|
|
213
|
+
/// # Examples
|
|
214
|
+
///
|
|
215
|
+
/// ```
|
|
216
|
+
/// use hashbrown::HashSet;
|
|
217
|
+
/// let set: HashSet<i32> = HashSet::new();
|
|
218
|
+
/// ```
|
|
219
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
220
|
+
pub fn new_in(alloc: A) -> Self {
|
|
221
|
+
Self {
|
|
222
|
+
map: HashMap::new_in(alloc),
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/// Creates an empty `HashSet` with the specified capacity.
|
|
227
|
+
///
|
|
228
|
+
/// The hash set will be able to hold at least `capacity` elements without
|
|
229
|
+
/// reallocating. If `capacity` is 0, the hash set will not allocate.
|
|
230
|
+
///
|
|
231
|
+
/// # HashDoS resistance
|
|
232
|
+
///
|
|
233
|
+
/// The `hash_builder` normally use a fixed key by default and that does
|
|
234
|
+
/// not allow the `HashSet` to be protected against attacks such as [`HashDoS`].
|
|
235
|
+
/// Users who require HashDoS resistance should explicitly use
|
|
236
|
+
/// [`std::collections::hash_map::RandomState`]
|
|
237
|
+
/// as the hasher when creating a [`HashSet`], for example with
|
|
238
|
+
/// [`with_capacity_and_hasher_in`](HashSet::with_capacity_and_hasher_in) method.
|
|
239
|
+
///
|
|
240
|
+
/// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack
|
|
241
|
+
/// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html
|
|
242
|
+
///
|
|
243
|
+
/// # Examples
|
|
244
|
+
///
|
|
245
|
+
/// ```
|
|
246
|
+
/// use hashbrown::HashSet;
|
|
247
|
+
/// let set: HashSet<i32> = HashSet::with_capacity(10);
|
|
248
|
+
/// assert!(set.capacity() >= 10);
|
|
249
|
+
/// ```
|
|
250
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
251
|
+
pub fn with_capacity_in(capacity: usize, alloc: A) -> Self {
|
|
252
|
+
Self {
|
|
253
|
+
map: HashMap::with_capacity_in(capacity, alloc),
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
impl<T, S, A: Allocator> HashSet<T, S, A> {
|
|
259
|
+
/// Returns the number of elements the set can hold without reallocating.
|
|
260
|
+
///
|
|
261
|
+
/// # Examples
|
|
262
|
+
///
|
|
263
|
+
/// ```
|
|
264
|
+
/// use hashbrown::HashSet;
|
|
265
|
+
/// let set: HashSet<i32> = HashSet::with_capacity(100);
|
|
266
|
+
/// assert!(set.capacity() >= 100);
|
|
267
|
+
/// ```
|
|
268
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
269
|
+
pub fn capacity(&self) -> usize {
|
|
270
|
+
self.map.capacity()
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/// An iterator visiting all elements in arbitrary order.
|
|
274
|
+
/// The iterator element type is `&'a T`.
|
|
275
|
+
///
|
|
276
|
+
/// # Examples
|
|
277
|
+
///
|
|
278
|
+
/// ```
|
|
279
|
+
/// use hashbrown::HashSet;
|
|
280
|
+
/// let mut set = HashSet::new();
|
|
281
|
+
/// set.insert("a");
|
|
282
|
+
/// set.insert("b");
|
|
283
|
+
///
|
|
284
|
+
/// // Will print in an arbitrary order.
|
|
285
|
+
/// for x in set.iter() {
|
|
286
|
+
/// println!("{}", x);
|
|
287
|
+
/// }
|
|
288
|
+
/// ```
|
|
289
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
290
|
+
pub fn iter(&self) -> Iter<'_, T> {
|
|
291
|
+
Iter {
|
|
292
|
+
iter: self.map.keys(),
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/// Returns the number of elements in the set.
|
|
297
|
+
///
|
|
298
|
+
/// # Examples
|
|
299
|
+
///
|
|
300
|
+
/// ```
|
|
301
|
+
/// use hashbrown::HashSet;
|
|
302
|
+
///
|
|
303
|
+
/// let mut v = HashSet::new();
|
|
304
|
+
/// assert_eq!(v.len(), 0);
|
|
305
|
+
/// v.insert(1);
|
|
306
|
+
/// assert_eq!(v.len(), 1);
|
|
307
|
+
/// ```
|
|
308
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
309
|
+
pub fn len(&self) -> usize {
|
|
310
|
+
self.map.len()
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/// Returns `true` if the set contains no elements.
|
|
314
|
+
///
|
|
315
|
+
/// # Examples
|
|
316
|
+
///
|
|
317
|
+
/// ```
|
|
318
|
+
/// use hashbrown::HashSet;
|
|
319
|
+
///
|
|
320
|
+
/// let mut v = HashSet::new();
|
|
321
|
+
/// assert!(v.is_empty());
|
|
322
|
+
/// v.insert(1);
|
|
323
|
+
/// assert!(!v.is_empty());
|
|
324
|
+
/// ```
|
|
325
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
326
|
+
pub fn is_empty(&self) -> bool {
|
|
327
|
+
self.map.is_empty()
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/// Clears the set, returning all elements in an iterator.
|
|
331
|
+
///
|
|
332
|
+
/// # Examples
|
|
333
|
+
///
|
|
334
|
+
/// ```
|
|
335
|
+
/// use hashbrown::HashSet;
|
|
336
|
+
///
|
|
337
|
+
/// let mut set: HashSet<_> = [1, 2, 3].into_iter().collect();
|
|
338
|
+
/// assert!(!set.is_empty());
|
|
339
|
+
///
|
|
340
|
+
/// // print 1, 2, 3 in an arbitrary order
|
|
341
|
+
/// for i in set.drain() {
|
|
342
|
+
/// println!("{}", i);
|
|
343
|
+
/// }
|
|
344
|
+
///
|
|
345
|
+
/// assert!(set.is_empty());
|
|
346
|
+
/// ```
|
|
347
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
348
|
+
pub fn drain(&mut self) -> Drain<'_, T, A> {
|
|
349
|
+
Drain {
|
|
350
|
+
iter: self.map.drain(),
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/// Retains only the elements specified by the predicate.
|
|
355
|
+
///
|
|
356
|
+
/// In other words, remove all elements `e` such that `f(&e)` returns `false`.
|
|
357
|
+
///
|
|
358
|
+
/// # Examples
|
|
359
|
+
///
|
|
360
|
+
/// ```
|
|
361
|
+
/// use hashbrown::HashSet;
|
|
362
|
+
///
|
|
363
|
+
/// let xs = [1,2,3,4,5,6];
|
|
364
|
+
/// let mut set: HashSet<i32> = xs.into_iter().collect();
|
|
365
|
+
/// set.retain(|&k| k % 2 == 0);
|
|
366
|
+
/// assert_eq!(set.len(), 3);
|
|
367
|
+
/// ```
|
|
368
|
+
pub fn retain<F>(&mut self, mut f: F)
|
|
369
|
+
where
|
|
370
|
+
F: FnMut(&T) -> bool,
|
|
371
|
+
{
|
|
372
|
+
self.map.retain(|k, _| f(k));
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/// Drains elements which are true under the given predicate,
|
|
376
|
+
/// and returns an iterator over the removed items.
|
|
377
|
+
///
|
|
378
|
+
/// In other words, move all elements `e` such that `f(&e)` returns `true` out
|
|
379
|
+
/// into another iterator.
|
|
380
|
+
///
|
|
381
|
+
/// If the returned `ExtractIf` is not exhausted, e.g. because it is dropped without iterating
|
|
382
|
+
/// or the iteration short-circuits, then the remaining elements will be retained.
|
|
383
|
+
/// Use [`retain()`] with a negated predicate if you do not need the returned iterator.
|
|
384
|
+
///
|
|
385
|
+
/// [`retain()`]: HashSet::retain
|
|
386
|
+
///
|
|
387
|
+
/// # Examples
|
|
388
|
+
///
|
|
389
|
+
/// ```
|
|
390
|
+
/// use hashbrown::HashSet;
|
|
391
|
+
///
|
|
392
|
+
/// let mut set: HashSet<i32> = (0..8).collect();
|
|
393
|
+
/// let drained: HashSet<i32> = set.extract_if(|v| v % 2 == 0).collect();
|
|
394
|
+
///
|
|
395
|
+
/// let mut evens = drained.into_iter().collect::<Vec<_>>();
|
|
396
|
+
/// let mut odds = set.into_iter().collect::<Vec<_>>();
|
|
397
|
+
/// evens.sort();
|
|
398
|
+
/// odds.sort();
|
|
399
|
+
///
|
|
400
|
+
/// assert_eq!(evens, vec![0, 2, 4, 6]);
|
|
401
|
+
/// assert_eq!(odds, vec![1, 3, 5, 7]);
|
|
402
|
+
/// ```
|
|
403
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
404
|
+
pub fn extract_if<F>(&mut self, f: F) -> ExtractIf<'_, T, F, A>
|
|
405
|
+
where
|
|
406
|
+
F: FnMut(&T) -> bool,
|
|
407
|
+
{
|
|
408
|
+
ExtractIf {
|
|
409
|
+
f,
|
|
410
|
+
inner: RawExtractIf {
|
|
411
|
+
iter: unsafe { self.map.table.iter() },
|
|
412
|
+
table: &mut self.map.table,
|
|
413
|
+
},
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/// Clears the set, removing all values.
|
|
418
|
+
///
|
|
419
|
+
/// # Examples
|
|
420
|
+
///
|
|
421
|
+
/// ```
|
|
422
|
+
/// use hashbrown::HashSet;
|
|
423
|
+
///
|
|
424
|
+
/// let mut v = HashSet::new();
|
|
425
|
+
/// v.insert(1);
|
|
426
|
+
/// v.clear();
|
|
427
|
+
/// assert!(v.is_empty());
|
|
428
|
+
/// ```
|
|
429
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
430
|
+
pub fn clear(&mut self) {
|
|
431
|
+
self.map.clear();
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
impl<T, S> HashSet<T, S, Global> {
|
|
436
|
+
/// Creates a new empty hash set which will use the given hasher to hash
|
|
437
|
+
/// keys.
|
|
438
|
+
///
|
|
439
|
+
/// The hash set is initially created with a capacity of 0, so it will not
|
|
440
|
+
/// allocate until it is first inserted into.
|
|
441
|
+
///
|
|
442
|
+
/// # HashDoS resistance
|
|
443
|
+
///
|
|
444
|
+
/// The `hash_builder` normally use a fixed key by default and that does
|
|
445
|
+
/// not allow the `HashSet` to be protected against attacks such as [`HashDoS`].
|
|
446
|
+
/// Users who require HashDoS resistance should explicitly use
|
|
447
|
+
/// [`std::collections::hash_map::RandomState`]
|
|
448
|
+
/// as the hasher when creating a [`HashSet`].
|
|
449
|
+
///
|
|
450
|
+
/// The `hash_builder` passed should implement the [`BuildHasher`] trait for
|
|
451
|
+
/// the `HashSet` to be useful, see its documentation for details.
|
|
452
|
+
///
|
|
453
|
+
/// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack
|
|
454
|
+
/// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html
|
|
455
|
+
/// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html
|
|
456
|
+
///
|
|
457
|
+
/// # Examples
|
|
458
|
+
///
|
|
459
|
+
/// ```
|
|
460
|
+
/// use hashbrown::HashSet;
|
|
461
|
+
/// use hashbrown::DefaultHashBuilder;
|
|
462
|
+
///
|
|
463
|
+
/// let s = DefaultHashBuilder::default();
|
|
464
|
+
/// let mut set = HashSet::with_hasher(s);
|
|
465
|
+
/// set.insert(2);
|
|
466
|
+
/// ```
|
|
467
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
468
|
+
#[cfg_attr(feature = "rustc-dep-of-std", rustc_const_stable_indirect)]
|
|
469
|
+
pub const fn with_hasher(hasher: S) -> Self {
|
|
470
|
+
Self {
|
|
471
|
+
map: HashMap::with_hasher(hasher),
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/// Creates an empty `HashSet` with the specified capacity, using
|
|
476
|
+
/// `hasher` to hash the keys.
|
|
477
|
+
///
|
|
478
|
+
/// The hash set will be able to hold at least `capacity` elements without
|
|
479
|
+
/// reallocating. If `capacity` is 0, the hash set will not allocate.
|
|
480
|
+
///
|
|
481
|
+
/// # HashDoS resistance
|
|
482
|
+
///
|
|
483
|
+
/// The `hash_builder` normally use a fixed key by default and that does
|
|
484
|
+
/// not allow the `HashSet` to be protected against attacks such as [`HashDoS`].
|
|
485
|
+
/// Users who require HashDoS resistance should explicitly use
|
|
486
|
+
/// [`std::collections::hash_map::RandomState`]
|
|
487
|
+
/// as the hasher when creating a [`HashSet`].
|
|
488
|
+
///
|
|
489
|
+
/// The `hash_builder` passed should implement the [`BuildHasher`] trait for
|
|
490
|
+
/// the `HashSet` to be useful, see its documentation for details.
|
|
491
|
+
///
|
|
492
|
+
/// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack
|
|
493
|
+
/// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html
|
|
494
|
+
/// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html
|
|
495
|
+
///
|
|
496
|
+
/// # Examples
|
|
497
|
+
///
|
|
498
|
+
/// ```
|
|
499
|
+
/// use hashbrown::HashSet;
|
|
500
|
+
/// use hashbrown::DefaultHashBuilder;
|
|
501
|
+
///
|
|
502
|
+
/// let s = DefaultHashBuilder::default();
|
|
503
|
+
/// let mut set = HashSet::with_capacity_and_hasher(10, s);
|
|
504
|
+
/// set.insert(1);
|
|
505
|
+
/// ```
|
|
506
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
507
|
+
pub fn with_capacity_and_hasher(capacity: usize, hasher: S) -> Self {
|
|
508
|
+
Self {
|
|
509
|
+
map: HashMap::with_capacity_and_hasher(capacity, hasher),
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
impl<T, S, A> HashSet<T, S, A>
|
|
515
|
+
where
|
|
516
|
+
A: Allocator,
|
|
517
|
+
{
|
|
518
|
+
/// Returns a reference to the underlying allocator.
|
|
519
|
+
#[inline]
|
|
520
|
+
pub fn allocator(&self) -> &A {
|
|
521
|
+
self.map.allocator()
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/// Creates a new empty hash set which will use the given hasher to hash
|
|
525
|
+
/// keys.
|
|
526
|
+
///
|
|
527
|
+
/// The hash set is initially created with a capacity of 0, so it will not
|
|
528
|
+
/// allocate until it is first inserted into.
|
|
529
|
+
///
|
|
530
|
+
/// # HashDoS resistance
|
|
531
|
+
///
|
|
532
|
+
/// The `hash_builder` normally use a fixed key by default and that does
|
|
533
|
+
/// not allow the `HashSet` to be protected against attacks such as [`HashDoS`].
|
|
534
|
+
/// Users who require HashDoS resistance should explicitly use
|
|
535
|
+
/// [`std::collections::hash_map::RandomState`]
|
|
536
|
+
/// as the hasher when creating a [`HashSet`].
|
|
537
|
+
///
|
|
538
|
+
/// The `hash_builder` passed should implement the [`BuildHasher`] trait for
|
|
539
|
+
/// the `HashSet` to be useful, see its documentation for details.
|
|
540
|
+
///
|
|
541
|
+
/// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack
|
|
542
|
+
/// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html
|
|
543
|
+
/// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html
|
|
544
|
+
///
|
|
545
|
+
/// # Examples
|
|
546
|
+
///
|
|
547
|
+
/// ```
|
|
548
|
+
/// use hashbrown::HashSet;
|
|
549
|
+
/// use hashbrown::DefaultHashBuilder;
|
|
550
|
+
///
|
|
551
|
+
/// let s = DefaultHashBuilder::default();
|
|
552
|
+
/// let mut set = HashSet::with_hasher(s);
|
|
553
|
+
/// set.insert(2);
|
|
554
|
+
/// ```
|
|
555
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
556
|
+
#[cfg_attr(feature = "rustc-dep-of-std", rustc_const_stable_indirect)]
|
|
557
|
+
pub const fn with_hasher_in(hasher: S, alloc: A) -> Self {
|
|
558
|
+
Self {
|
|
559
|
+
map: HashMap::with_hasher_in(hasher, alloc),
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/// Creates an empty `HashSet` with the specified capacity, using
|
|
564
|
+
/// `hasher` to hash the keys.
|
|
565
|
+
///
|
|
566
|
+
/// The hash set will be able to hold at least `capacity` elements without
|
|
567
|
+
/// reallocating. If `capacity` is 0, the hash set will not allocate.
|
|
568
|
+
///
|
|
569
|
+
/// # HashDoS resistance
|
|
570
|
+
///
|
|
571
|
+
/// The `hash_builder` normally use a fixed key by default and that does
|
|
572
|
+
/// not allow the `HashSet` to be protected against attacks such as [`HashDoS`].
|
|
573
|
+
/// Users who require HashDoS resistance should explicitly use
|
|
574
|
+
/// [`std::collections::hash_map::RandomState`]
|
|
575
|
+
/// as the hasher when creating a [`HashSet`].
|
|
576
|
+
///
|
|
577
|
+
/// The `hash_builder` passed should implement the [`BuildHasher`] trait for
|
|
578
|
+
/// the `HashSet` to be useful, see its documentation for details.
|
|
579
|
+
///
|
|
580
|
+
/// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack
|
|
581
|
+
/// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html
|
|
582
|
+
/// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html
|
|
583
|
+
///
|
|
584
|
+
/// # Examples
|
|
585
|
+
///
|
|
586
|
+
/// ```
|
|
587
|
+
/// use hashbrown::HashSet;
|
|
588
|
+
/// use hashbrown::DefaultHashBuilder;
|
|
589
|
+
///
|
|
590
|
+
/// let s = DefaultHashBuilder::default();
|
|
591
|
+
/// let mut set = HashSet::with_capacity_and_hasher(10, s);
|
|
592
|
+
/// set.insert(1);
|
|
593
|
+
/// ```
|
|
594
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
595
|
+
pub fn with_capacity_and_hasher_in(capacity: usize, hasher: S, alloc: A) -> Self {
|
|
596
|
+
Self {
|
|
597
|
+
map: HashMap::with_capacity_and_hasher_in(capacity, hasher, alloc),
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/// Returns a reference to the set's [`BuildHasher`].
|
|
602
|
+
///
|
|
603
|
+
/// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html
|
|
604
|
+
///
|
|
605
|
+
/// # Examples
|
|
606
|
+
///
|
|
607
|
+
/// ```
|
|
608
|
+
/// use hashbrown::HashSet;
|
|
609
|
+
/// use hashbrown::DefaultHashBuilder;
|
|
610
|
+
///
|
|
611
|
+
/// let hasher = DefaultHashBuilder::default();
|
|
612
|
+
/// let set: HashSet<i32> = HashSet::with_hasher(hasher);
|
|
613
|
+
/// let hasher: &DefaultHashBuilder = set.hasher();
|
|
614
|
+
/// ```
|
|
615
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
616
|
+
pub fn hasher(&self) -> &S {
|
|
617
|
+
self.map.hasher()
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
impl<T, S, A> HashSet<T, S, A>
|
|
622
|
+
where
|
|
623
|
+
T: Eq + Hash,
|
|
624
|
+
S: BuildHasher,
|
|
625
|
+
A: Allocator,
|
|
626
|
+
{
|
|
627
|
+
/// Reserves capacity for at least `additional` more elements to be inserted
|
|
628
|
+
/// in the `HashSet`. The collection may reserve more space to avoid
|
|
629
|
+
/// frequent reallocations.
|
|
630
|
+
///
|
|
631
|
+
/// # Panics
|
|
632
|
+
///
|
|
633
|
+
/// Panics if the new capacity exceeds [`isize::MAX`] bytes and [`abort`] the program
|
|
634
|
+
/// in case of allocation error. Use [`try_reserve`](HashSet::try_reserve) instead
|
|
635
|
+
/// if you want to handle memory allocation failure.
|
|
636
|
+
///
|
|
637
|
+
/// [`isize::MAX`]: https://doc.rust-lang.org/std/primitive.isize.html
|
|
638
|
+
/// [`abort`]: https://doc.rust-lang.org/alloc/alloc/fn.handle_alloc_error.html
|
|
639
|
+
///
|
|
640
|
+
/// # Examples
|
|
641
|
+
///
|
|
642
|
+
/// ```
|
|
643
|
+
/// use hashbrown::HashSet;
|
|
644
|
+
/// let mut set: HashSet<i32> = HashSet::new();
|
|
645
|
+
/// set.reserve(10);
|
|
646
|
+
/// assert!(set.capacity() >= 10);
|
|
647
|
+
/// ```
|
|
648
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
649
|
+
pub fn reserve(&mut self, additional: usize) {
|
|
650
|
+
self.map.reserve(additional);
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
/// Tries to reserve capacity for at least `additional` more elements to be inserted
|
|
654
|
+
/// in the given `HashSet<K,V>`. The collection may reserve more space to avoid
|
|
655
|
+
/// frequent reallocations.
|
|
656
|
+
///
|
|
657
|
+
/// # Errors
|
|
658
|
+
///
|
|
659
|
+
/// If the capacity overflows, or the allocator reports a failure, then an error
|
|
660
|
+
/// is returned.
|
|
661
|
+
///
|
|
662
|
+
/// # Examples
|
|
663
|
+
///
|
|
664
|
+
/// ```
|
|
665
|
+
/// use hashbrown::HashSet;
|
|
666
|
+
/// let mut set: HashSet<i32> = HashSet::new();
|
|
667
|
+
/// set.try_reserve(10).expect("why is the test harness OOMing on 10 bytes?");
|
|
668
|
+
/// ```
|
|
669
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
670
|
+
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
|
|
671
|
+
self.map.try_reserve(additional)
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/// Shrinks the capacity of the set as much as possible. It will drop
|
|
675
|
+
/// down as much as possible while maintaining the internal rules
|
|
676
|
+
/// and possibly leaving some space in accordance with the resize policy.
|
|
677
|
+
///
|
|
678
|
+
/// # Examples
|
|
679
|
+
///
|
|
680
|
+
/// ```
|
|
681
|
+
/// use hashbrown::HashSet;
|
|
682
|
+
///
|
|
683
|
+
/// let mut set = HashSet::with_capacity(100);
|
|
684
|
+
/// set.insert(1);
|
|
685
|
+
/// set.insert(2);
|
|
686
|
+
/// assert!(set.capacity() >= 100);
|
|
687
|
+
/// set.shrink_to_fit();
|
|
688
|
+
/// assert!(set.capacity() >= 2);
|
|
689
|
+
/// ```
|
|
690
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
691
|
+
pub fn shrink_to_fit(&mut self) {
|
|
692
|
+
self.map.shrink_to_fit();
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
/// Shrinks the capacity of the set with a lower limit. It will drop
|
|
696
|
+
/// down no lower than the supplied limit while maintaining the internal rules
|
|
697
|
+
/// and possibly leaving some space in accordance with the resize policy.
|
|
698
|
+
///
|
|
699
|
+
/// Panics if the current capacity is smaller than the supplied
|
|
700
|
+
/// minimum capacity.
|
|
701
|
+
///
|
|
702
|
+
/// # Examples
|
|
703
|
+
///
|
|
704
|
+
/// ```
|
|
705
|
+
/// use hashbrown::HashSet;
|
|
706
|
+
///
|
|
707
|
+
/// let mut set = HashSet::with_capacity(100);
|
|
708
|
+
/// set.insert(1);
|
|
709
|
+
/// set.insert(2);
|
|
710
|
+
/// assert!(set.capacity() >= 100);
|
|
711
|
+
/// set.shrink_to(10);
|
|
712
|
+
/// assert!(set.capacity() >= 10);
|
|
713
|
+
/// set.shrink_to(0);
|
|
714
|
+
/// assert!(set.capacity() >= 2);
|
|
715
|
+
/// ```
|
|
716
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
717
|
+
pub fn shrink_to(&mut self, min_capacity: usize) {
|
|
718
|
+
self.map.shrink_to(min_capacity);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/// Visits the values representing the difference,
|
|
722
|
+
/// i.e., the values that are in `self` but not in `other`.
|
|
723
|
+
///
|
|
724
|
+
/// # Examples
|
|
725
|
+
///
|
|
726
|
+
/// ```
|
|
727
|
+
/// use hashbrown::HashSet;
|
|
728
|
+
/// let a: HashSet<_> = [1, 2, 3].into_iter().collect();
|
|
729
|
+
/// let b: HashSet<_> = [4, 2, 3, 4].into_iter().collect();
|
|
730
|
+
///
|
|
731
|
+
/// // Can be seen as `a - b`.
|
|
732
|
+
/// for x in a.difference(&b) {
|
|
733
|
+
/// println!("{}", x); // Print 1
|
|
734
|
+
/// }
|
|
735
|
+
///
|
|
736
|
+
/// let diff: HashSet<_> = a.difference(&b).collect();
|
|
737
|
+
/// assert_eq!(diff, [1].iter().collect());
|
|
738
|
+
///
|
|
739
|
+
/// // Note that difference is not symmetric,
|
|
740
|
+
/// // and `b - a` means something else:
|
|
741
|
+
/// let diff: HashSet<_> = b.difference(&a).collect();
|
|
742
|
+
/// assert_eq!(diff, [4].iter().collect());
|
|
743
|
+
/// ```
|
|
744
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
745
|
+
pub fn difference<'a>(&'a self, other: &'a Self) -> Difference<'a, T, S, A> {
|
|
746
|
+
Difference {
|
|
747
|
+
iter: self.iter(),
|
|
748
|
+
other,
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/// Visits the values representing the symmetric difference,
|
|
753
|
+
/// i.e., the values that are in `self` or in `other` but not in both.
|
|
754
|
+
///
|
|
755
|
+
/// # Examples
|
|
756
|
+
///
|
|
757
|
+
/// ```
|
|
758
|
+
/// use hashbrown::HashSet;
|
|
759
|
+
/// let a: HashSet<_> = [1, 2, 3].into_iter().collect();
|
|
760
|
+
/// let b: HashSet<_> = [4, 2, 3, 4].into_iter().collect();
|
|
761
|
+
///
|
|
762
|
+
/// // Print 1, 4 in arbitrary order.
|
|
763
|
+
/// for x in a.symmetric_difference(&b) {
|
|
764
|
+
/// println!("{}", x);
|
|
765
|
+
/// }
|
|
766
|
+
///
|
|
767
|
+
/// let diff1: HashSet<_> = a.symmetric_difference(&b).collect();
|
|
768
|
+
/// let diff2: HashSet<_> = b.symmetric_difference(&a).collect();
|
|
769
|
+
///
|
|
770
|
+
/// assert_eq!(diff1, diff2);
|
|
771
|
+
/// assert_eq!(diff1, [1, 4].iter().collect());
|
|
772
|
+
/// ```
|
|
773
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
774
|
+
pub fn symmetric_difference<'a>(&'a self, other: &'a Self) -> SymmetricDifference<'a, T, S, A> {
|
|
775
|
+
SymmetricDifference {
|
|
776
|
+
iter: self.difference(other).chain(other.difference(self)),
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
/// Visits the values representing the intersection,
|
|
781
|
+
/// i.e., the values that are both in `self` and `other`.
|
|
782
|
+
///
|
|
783
|
+
/// # Examples
|
|
784
|
+
///
|
|
785
|
+
/// ```
|
|
786
|
+
/// use hashbrown::HashSet;
|
|
787
|
+
/// let a: HashSet<_> = [1, 2, 3].into_iter().collect();
|
|
788
|
+
/// let b: HashSet<_> = [4, 2, 3, 4].into_iter().collect();
|
|
789
|
+
///
|
|
790
|
+
/// // Print 2, 3 in arbitrary order.
|
|
791
|
+
/// for x in a.intersection(&b) {
|
|
792
|
+
/// println!("{}", x);
|
|
793
|
+
/// }
|
|
794
|
+
///
|
|
795
|
+
/// let intersection: HashSet<_> = a.intersection(&b).collect();
|
|
796
|
+
/// assert_eq!(intersection, [2, 3].iter().collect());
|
|
797
|
+
/// ```
|
|
798
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
799
|
+
pub fn intersection<'a>(&'a self, other: &'a Self) -> Intersection<'a, T, S, A> {
|
|
800
|
+
let (smaller, larger) = if self.len() <= other.len() {
|
|
801
|
+
(self, other)
|
|
802
|
+
} else {
|
|
803
|
+
(other, self)
|
|
804
|
+
};
|
|
805
|
+
Intersection {
|
|
806
|
+
iter: smaller.iter(),
|
|
807
|
+
other: larger,
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/// Visits the values representing the union,
|
|
812
|
+
/// i.e., all the values in `self` or `other`, without duplicates.
|
|
813
|
+
///
|
|
814
|
+
/// # Examples
|
|
815
|
+
///
|
|
816
|
+
/// ```
|
|
817
|
+
/// use hashbrown::HashSet;
|
|
818
|
+
/// let a: HashSet<_> = [1, 2, 3].into_iter().collect();
|
|
819
|
+
/// let b: HashSet<_> = [4, 2, 3, 4].into_iter().collect();
|
|
820
|
+
///
|
|
821
|
+
/// // Print 1, 2, 3, 4 in arbitrary order.
|
|
822
|
+
/// for x in a.union(&b) {
|
|
823
|
+
/// println!("{}", x);
|
|
824
|
+
/// }
|
|
825
|
+
///
|
|
826
|
+
/// let union: HashSet<_> = a.union(&b).collect();
|
|
827
|
+
/// assert_eq!(union, [1, 2, 3, 4].iter().collect());
|
|
828
|
+
/// ```
|
|
829
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
830
|
+
pub fn union<'a>(&'a self, other: &'a Self) -> Union<'a, T, S, A> {
|
|
831
|
+
// We'll iterate one set in full, and only the remaining difference from the other.
|
|
832
|
+
// Use the smaller set for the difference in order to reduce hash lookups.
|
|
833
|
+
let (smaller, larger) = if self.len() <= other.len() {
|
|
834
|
+
(self, other)
|
|
835
|
+
} else {
|
|
836
|
+
(other, self)
|
|
837
|
+
};
|
|
838
|
+
Union {
|
|
839
|
+
iter: larger.iter().chain(smaller.difference(larger)),
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/// Returns `true` if the set contains a value.
|
|
844
|
+
///
|
|
845
|
+
/// The value may be any borrowed form of the set's value type, but
|
|
846
|
+
/// [`Hash`] and [`Eq`] on the borrowed form *must* match those for
|
|
847
|
+
/// the value type.
|
|
848
|
+
///
|
|
849
|
+
/// # Examples
|
|
850
|
+
///
|
|
851
|
+
/// ```
|
|
852
|
+
/// use hashbrown::HashSet;
|
|
853
|
+
///
|
|
854
|
+
/// let set: HashSet<_> = [1, 2, 3].into_iter().collect();
|
|
855
|
+
/// assert_eq!(set.contains(&1), true);
|
|
856
|
+
/// assert_eq!(set.contains(&4), false);
|
|
857
|
+
/// ```
|
|
858
|
+
///
|
|
859
|
+
/// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html
|
|
860
|
+
/// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html
|
|
861
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
862
|
+
pub fn contains<Q>(&self, value: &Q) -> bool
|
|
863
|
+
where
|
|
864
|
+
Q: Hash + Equivalent<T> + ?Sized,
|
|
865
|
+
{
|
|
866
|
+
self.map.contains_key(value)
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
/// Returns a reference to the value in the set, if any, that is equal to the given value.
|
|
870
|
+
///
|
|
871
|
+
/// The value may be any borrowed form of the set's value type, but
|
|
872
|
+
/// [`Hash`] and [`Eq`] on the borrowed form *must* match those for
|
|
873
|
+
/// the value type.
|
|
874
|
+
///
|
|
875
|
+
/// # Examples
|
|
876
|
+
///
|
|
877
|
+
/// ```
|
|
878
|
+
/// use hashbrown::HashSet;
|
|
879
|
+
///
|
|
880
|
+
/// let set: HashSet<_> = [1, 2, 3].into_iter().collect();
|
|
881
|
+
/// assert_eq!(set.get(&2), Some(&2));
|
|
882
|
+
/// assert_eq!(set.get(&4), None);
|
|
883
|
+
/// ```
|
|
884
|
+
///
|
|
885
|
+
/// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html
|
|
886
|
+
/// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html
|
|
887
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
888
|
+
pub fn get<Q>(&self, value: &Q) -> Option<&T>
|
|
889
|
+
where
|
|
890
|
+
Q: Hash + Equivalent<T> + ?Sized,
|
|
891
|
+
{
|
|
892
|
+
// Avoid `Option::map` because it bloats LLVM IR.
|
|
893
|
+
match self.map.get_key_value(value) {
|
|
894
|
+
Some((k, _)) => Some(k),
|
|
895
|
+
None => None,
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
/// Inserts the given `value` into the set if it is not present, then
|
|
900
|
+
/// returns a reference to the value in the set.
|
|
901
|
+
///
|
|
902
|
+
/// # Examples
|
|
903
|
+
///
|
|
904
|
+
/// ```
|
|
905
|
+
/// use hashbrown::HashSet;
|
|
906
|
+
///
|
|
907
|
+
/// let mut set: HashSet<_> = [1, 2, 3].into_iter().collect();
|
|
908
|
+
/// assert_eq!(set.len(), 3);
|
|
909
|
+
/// assert_eq!(set.get_or_insert(2), &2);
|
|
910
|
+
/// assert_eq!(set.get_or_insert(100), &100);
|
|
911
|
+
/// assert_eq!(set.len(), 4); // 100 was inserted
|
|
912
|
+
/// ```
|
|
913
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
914
|
+
pub fn get_or_insert(&mut self, value: T) -> &T {
|
|
915
|
+
let hash = make_hash(&self.map.hash_builder, &value);
|
|
916
|
+
let bucket = match self.map.find_or_find_insert_slot(hash, &value) {
|
|
917
|
+
Ok(bucket) => bucket,
|
|
918
|
+
Err(slot) => unsafe { self.map.table.insert_in_slot(hash, slot, (value, ())) },
|
|
919
|
+
};
|
|
920
|
+
unsafe { &bucket.as_ref().0 }
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
/// Inserts a value computed from `f` into the set if the given `value` is
|
|
924
|
+
/// not present, then returns a reference to the value in the set.
|
|
925
|
+
///
|
|
926
|
+
/// # Examples
|
|
927
|
+
///
|
|
928
|
+
/// ```
|
|
929
|
+
/// use hashbrown::HashSet;
|
|
930
|
+
///
|
|
931
|
+
/// let mut set: HashSet<String> = ["cat", "dog", "horse"]
|
|
932
|
+
/// .iter().map(|&pet| pet.to_owned()).collect();
|
|
933
|
+
///
|
|
934
|
+
/// assert_eq!(set.len(), 3);
|
|
935
|
+
/// for &pet in &["cat", "dog", "fish"] {
|
|
936
|
+
/// let value = set.get_or_insert_with(pet, str::to_owned);
|
|
937
|
+
/// assert_eq!(value, pet);
|
|
938
|
+
/// }
|
|
939
|
+
/// assert_eq!(set.len(), 4); // a new "fish" was inserted
|
|
940
|
+
/// ```
|
|
941
|
+
///
|
|
942
|
+
/// The following example will panic because the new value doesn't match.
|
|
943
|
+
///
|
|
944
|
+
/// ```should_panic
|
|
945
|
+
/// let mut set = hashbrown::HashSet::new();
|
|
946
|
+
/// set.get_or_insert_with("rust", |_| String::new());
|
|
947
|
+
/// ```
|
|
948
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
949
|
+
pub fn get_or_insert_with<Q, F>(&mut self, value: &Q, f: F) -> &T
|
|
950
|
+
where
|
|
951
|
+
Q: Hash + Equivalent<T> + ?Sized,
|
|
952
|
+
F: FnOnce(&Q) -> T,
|
|
953
|
+
{
|
|
954
|
+
let hash = make_hash(&self.map.hash_builder, value);
|
|
955
|
+
let bucket = match self.map.find_or_find_insert_slot(hash, value) {
|
|
956
|
+
Ok(bucket) => bucket,
|
|
957
|
+
Err(slot) => {
|
|
958
|
+
let new = f(value);
|
|
959
|
+
assert!(value.equivalent(&new), "new value is not equivalent");
|
|
960
|
+
unsafe { self.map.table.insert_in_slot(hash, slot, (new, ())) }
|
|
961
|
+
}
|
|
962
|
+
};
|
|
963
|
+
unsafe { &bucket.as_ref().0 }
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
/// Gets the given value's corresponding entry in the set for in-place manipulation.
|
|
967
|
+
///
|
|
968
|
+
/// # Examples
|
|
969
|
+
///
|
|
970
|
+
/// ```
|
|
971
|
+
/// use hashbrown::HashSet;
|
|
972
|
+
/// use hashbrown::hash_set::Entry::*;
|
|
973
|
+
///
|
|
974
|
+
/// let mut singles = HashSet::new();
|
|
975
|
+
/// let mut dupes = HashSet::new();
|
|
976
|
+
///
|
|
977
|
+
/// for ch in "a short treatise on fungi".chars() {
|
|
978
|
+
/// if let Vacant(dupe_entry) = dupes.entry(ch) {
|
|
979
|
+
/// // We haven't already seen a duplicate, so
|
|
980
|
+
/// // check if we've at least seen it once.
|
|
981
|
+
/// match singles.entry(ch) {
|
|
982
|
+
/// Vacant(single_entry) => {
|
|
983
|
+
/// // We found a new character for the first time.
|
|
984
|
+
/// single_entry.insert();
|
|
985
|
+
/// }
|
|
986
|
+
/// Occupied(single_entry) => {
|
|
987
|
+
/// // We've already seen this once, "move" it to dupes.
|
|
988
|
+
/// single_entry.remove();
|
|
989
|
+
/// dupe_entry.insert();
|
|
990
|
+
/// }
|
|
991
|
+
/// }
|
|
992
|
+
/// }
|
|
993
|
+
/// }
|
|
994
|
+
///
|
|
995
|
+
/// assert!(!singles.contains(&'t') && dupes.contains(&'t'));
|
|
996
|
+
/// assert!(singles.contains(&'u') && !dupes.contains(&'u'));
|
|
997
|
+
/// assert!(!singles.contains(&'v') && !dupes.contains(&'v'));
|
|
998
|
+
/// ```
|
|
999
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1000
|
+
pub fn entry(&mut self, value: T) -> Entry<'_, T, S, A> {
|
|
1001
|
+
match self.map.entry(value) {
|
|
1002
|
+
map::Entry::Occupied(entry) => Entry::Occupied(OccupiedEntry { inner: entry }),
|
|
1003
|
+
map::Entry::Vacant(entry) => Entry::Vacant(VacantEntry { inner: entry }),
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
/// Returns `true` if `self` has no elements in common with `other`.
|
|
1008
|
+
/// This is equivalent to checking for an empty intersection.
|
|
1009
|
+
///
|
|
1010
|
+
/// # Examples
|
|
1011
|
+
///
|
|
1012
|
+
/// ```
|
|
1013
|
+
/// use hashbrown::HashSet;
|
|
1014
|
+
///
|
|
1015
|
+
/// let a: HashSet<_> = [1, 2, 3].into_iter().collect();
|
|
1016
|
+
/// let mut b = HashSet::new();
|
|
1017
|
+
///
|
|
1018
|
+
/// assert_eq!(a.is_disjoint(&b), true);
|
|
1019
|
+
/// b.insert(4);
|
|
1020
|
+
/// assert_eq!(a.is_disjoint(&b), true);
|
|
1021
|
+
/// b.insert(1);
|
|
1022
|
+
/// assert_eq!(a.is_disjoint(&b), false);
|
|
1023
|
+
/// ```
|
|
1024
|
+
pub fn is_disjoint(&self, other: &Self) -> bool {
|
|
1025
|
+
self.intersection(other).next().is_none()
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
/// Returns `true` if the set is a subset of another,
|
|
1029
|
+
/// i.e., `other` contains at least all the values in `self`.
|
|
1030
|
+
///
|
|
1031
|
+
/// # Examples
|
|
1032
|
+
///
|
|
1033
|
+
/// ```
|
|
1034
|
+
/// use hashbrown::HashSet;
|
|
1035
|
+
///
|
|
1036
|
+
/// let sup: HashSet<_> = [1, 2, 3].into_iter().collect();
|
|
1037
|
+
/// let mut set = HashSet::new();
|
|
1038
|
+
///
|
|
1039
|
+
/// assert_eq!(set.is_subset(&sup), true);
|
|
1040
|
+
/// set.insert(2);
|
|
1041
|
+
/// assert_eq!(set.is_subset(&sup), true);
|
|
1042
|
+
/// set.insert(4);
|
|
1043
|
+
/// assert_eq!(set.is_subset(&sup), false);
|
|
1044
|
+
/// ```
|
|
1045
|
+
pub fn is_subset(&self, other: &Self) -> bool {
|
|
1046
|
+
self.len() <= other.len() && self.iter().all(|v| other.contains(v))
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
/// Returns `true` if the set is a superset of another,
|
|
1050
|
+
/// i.e., `self` contains at least all the values in `other`.
|
|
1051
|
+
///
|
|
1052
|
+
/// # Examples
|
|
1053
|
+
///
|
|
1054
|
+
/// ```
|
|
1055
|
+
/// use hashbrown::HashSet;
|
|
1056
|
+
///
|
|
1057
|
+
/// let sub: HashSet<_> = [1, 2].into_iter().collect();
|
|
1058
|
+
/// let mut set = HashSet::new();
|
|
1059
|
+
///
|
|
1060
|
+
/// assert_eq!(set.is_superset(&sub), false);
|
|
1061
|
+
///
|
|
1062
|
+
/// set.insert(0);
|
|
1063
|
+
/// set.insert(1);
|
|
1064
|
+
/// assert_eq!(set.is_superset(&sub), false);
|
|
1065
|
+
///
|
|
1066
|
+
/// set.insert(2);
|
|
1067
|
+
/// assert_eq!(set.is_superset(&sub), true);
|
|
1068
|
+
/// ```
|
|
1069
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1070
|
+
pub fn is_superset(&self, other: &Self) -> bool {
|
|
1071
|
+
other.is_subset(self)
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
/// Adds a value to the set.
|
|
1075
|
+
///
|
|
1076
|
+
/// If the set did not have this value present, `true` is returned.
|
|
1077
|
+
///
|
|
1078
|
+
/// If the set did have this value present, `false` is returned.
|
|
1079
|
+
///
|
|
1080
|
+
/// # Examples
|
|
1081
|
+
///
|
|
1082
|
+
/// ```
|
|
1083
|
+
/// use hashbrown::HashSet;
|
|
1084
|
+
///
|
|
1085
|
+
/// let mut set = HashSet::new();
|
|
1086
|
+
///
|
|
1087
|
+
/// assert_eq!(set.insert(2), true);
|
|
1088
|
+
/// assert_eq!(set.insert(2), false);
|
|
1089
|
+
/// assert_eq!(set.len(), 1);
|
|
1090
|
+
/// ```
|
|
1091
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1092
|
+
pub fn insert(&mut self, value: T) -> bool {
|
|
1093
|
+
self.map.insert(value, ()).is_none()
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
/// Insert a value the set without checking if the value already exists in the set.
|
|
1097
|
+
///
|
|
1098
|
+
/// This operation is faster than regular insert, because it does not perform
|
|
1099
|
+
/// lookup before insertion.
|
|
1100
|
+
///
|
|
1101
|
+
/// This operation is useful during initial population of the set.
|
|
1102
|
+
/// For example, when constructing a set from another set, we know
|
|
1103
|
+
/// that values are unique.
|
|
1104
|
+
///
|
|
1105
|
+
/// # Safety
|
|
1106
|
+
///
|
|
1107
|
+
/// This operation is safe if a value does not exist in the set.
|
|
1108
|
+
///
|
|
1109
|
+
/// However, if a value exists in the set already, the behavior is unspecified:
|
|
1110
|
+
/// this operation may panic, loop forever, or any following operation with the set
|
|
1111
|
+
/// may panic, loop forever or return arbitrary result.
|
|
1112
|
+
///
|
|
1113
|
+
/// That said, this operation (and following operations) are guaranteed to
|
|
1114
|
+
/// not violate memory safety.
|
|
1115
|
+
///
|
|
1116
|
+
/// However this operation is still unsafe because the resulting `HashSet`
|
|
1117
|
+
/// may be passed to unsafe code which does expect the set to behave
|
|
1118
|
+
/// correctly, and would cause unsoundness as a result.
|
|
1119
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1120
|
+
pub unsafe fn insert_unique_unchecked(&mut self, value: T) -> &T {
|
|
1121
|
+
self.map.insert_unique_unchecked(value, ()).0
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
/// Adds a value to the set, replacing the existing value, if any, that is equal to the given
|
|
1125
|
+
/// one. Returns the replaced value.
|
|
1126
|
+
///
|
|
1127
|
+
/// # Examples
|
|
1128
|
+
///
|
|
1129
|
+
/// ```
|
|
1130
|
+
/// use hashbrown::HashSet;
|
|
1131
|
+
///
|
|
1132
|
+
/// let mut set = HashSet::new();
|
|
1133
|
+
/// set.insert(Vec::<i32>::new());
|
|
1134
|
+
///
|
|
1135
|
+
/// assert_eq!(set.get(&[][..]).unwrap().capacity(), 0);
|
|
1136
|
+
/// set.replace(Vec::with_capacity(10));
|
|
1137
|
+
/// assert_eq!(set.get(&[][..]).unwrap().capacity(), 10);
|
|
1138
|
+
/// ```
|
|
1139
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1140
|
+
pub fn replace(&mut self, value: T) -> Option<T> {
|
|
1141
|
+
let hash = make_hash(&self.map.hash_builder, &value);
|
|
1142
|
+
match self.map.find_or_find_insert_slot(hash, &value) {
|
|
1143
|
+
Ok(bucket) => Some(mem::replace(unsafe { &mut bucket.as_mut().0 }, value)),
|
|
1144
|
+
Err(slot) => {
|
|
1145
|
+
unsafe {
|
|
1146
|
+
self.map.table.insert_in_slot(hash, slot, (value, ()));
|
|
1147
|
+
}
|
|
1148
|
+
None
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
/// Removes a value from the set. Returns whether the value was
|
|
1154
|
+
/// present in the set.
|
|
1155
|
+
///
|
|
1156
|
+
/// The value may be any borrowed form of the set's value type, but
|
|
1157
|
+
/// [`Hash`] and [`Eq`] on the borrowed form *must* match those for
|
|
1158
|
+
/// the value type.
|
|
1159
|
+
///
|
|
1160
|
+
/// # Examples
|
|
1161
|
+
///
|
|
1162
|
+
/// ```
|
|
1163
|
+
/// use hashbrown::HashSet;
|
|
1164
|
+
///
|
|
1165
|
+
/// let mut set = HashSet::new();
|
|
1166
|
+
///
|
|
1167
|
+
/// set.insert(2);
|
|
1168
|
+
/// assert_eq!(set.remove(&2), true);
|
|
1169
|
+
/// assert_eq!(set.remove(&2), false);
|
|
1170
|
+
/// ```
|
|
1171
|
+
///
|
|
1172
|
+
/// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html
|
|
1173
|
+
/// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html
|
|
1174
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1175
|
+
pub fn remove<Q>(&mut self, value: &Q) -> bool
|
|
1176
|
+
where
|
|
1177
|
+
Q: Hash + Equivalent<T> + ?Sized,
|
|
1178
|
+
{
|
|
1179
|
+
self.map.remove(value).is_some()
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
/// Removes and returns the value in the set, if any, that is equal to the given one.
|
|
1183
|
+
///
|
|
1184
|
+
/// The value may be any borrowed form of the set's value type, but
|
|
1185
|
+
/// [`Hash`] and [`Eq`] on the borrowed form *must* match those for
|
|
1186
|
+
/// the value type.
|
|
1187
|
+
///
|
|
1188
|
+
/// # Examples
|
|
1189
|
+
///
|
|
1190
|
+
/// ```
|
|
1191
|
+
/// use hashbrown::HashSet;
|
|
1192
|
+
///
|
|
1193
|
+
/// let mut set: HashSet<_> = [1, 2, 3].into_iter().collect();
|
|
1194
|
+
/// assert_eq!(set.take(&2), Some(2));
|
|
1195
|
+
/// assert_eq!(set.take(&2), None);
|
|
1196
|
+
/// ```
|
|
1197
|
+
///
|
|
1198
|
+
/// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html
|
|
1199
|
+
/// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html
|
|
1200
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1201
|
+
pub fn take<Q>(&mut self, value: &Q) -> Option<T>
|
|
1202
|
+
where
|
|
1203
|
+
Q: Hash + Equivalent<T> + ?Sized,
|
|
1204
|
+
{
|
|
1205
|
+
// Avoid `Option::map` because it bloats LLVM IR.
|
|
1206
|
+
match self.map.remove_entry(value) {
|
|
1207
|
+
Some((k, _)) => Some(k),
|
|
1208
|
+
None => None,
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
/// Returns the total amount of memory allocated internally by the hash
|
|
1213
|
+
/// set, in bytes.
|
|
1214
|
+
///
|
|
1215
|
+
/// The returned number is informational only. It is intended to be
|
|
1216
|
+
/// primarily used for memory profiling.
|
|
1217
|
+
#[inline]
|
|
1218
|
+
pub fn allocation_size(&self) -> usize {
|
|
1219
|
+
self.map.allocation_size()
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
impl<T, S, A> PartialEq for HashSet<T, S, A>
|
|
1224
|
+
where
|
|
1225
|
+
T: Eq + Hash,
|
|
1226
|
+
S: BuildHasher,
|
|
1227
|
+
A: Allocator,
|
|
1228
|
+
{
|
|
1229
|
+
fn eq(&self, other: &Self) -> bool {
|
|
1230
|
+
if self.len() != other.len() {
|
|
1231
|
+
return false;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
self.iter().all(|key| other.contains(key))
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
impl<T, S, A> Eq for HashSet<T, S, A>
|
|
1239
|
+
where
|
|
1240
|
+
T: Eq + Hash,
|
|
1241
|
+
S: BuildHasher,
|
|
1242
|
+
A: Allocator,
|
|
1243
|
+
{
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
impl<T, S, A> fmt::Debug for HashSet<T, S, A>
|
|
1247
|
+
where
|
|
1248
|
+
T: fmt::Debug,
|
|
1249
|
+
A: Allocator,
|
|
1250
|
+
{
|
|
1251
|
+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
1252
|
+
f.debug_set().entries(self.iter()).finish()
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
impl<T, S, A> From<HashMap<T, (), S, A>> for HashSet<T, S, A>
|
|
1257
|
+
where
|
|
1258
|
+
A: Allocator,
|
|
1259
|
+
{
|
|
1260
|
+
fn from(map: HashMap<T, (), S, A>) -> Self {
|
|
1261
|
+
Self { map }
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
impl<T, S, A> FromIterator<T> for HashSet<T, S, A>
|
|
1266
|
+
where
|
|
1267
|
+
T: Eq + Hash,
|
|
1268
|
+
S: BuildHasher + Default,
|
|
1269
|
+
A: Default + Allocator,
|
|
1270
|
+
{
|
|
1271
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1272
|
+
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self {
|
|
1273
|
+
let mut set = Self::with_hasher_in(Default::default(), Default::default());
|
|
1274
|
+
set.extend(iter);
|
|
1275
|
+
set
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
// The default hasher is used to match the std implementation signature
|
|
1280
|
+
#[cfg(feature = "default-hasher")]
|
|
1281
|
+
impl<T, A, const N: usize> From<[T; N]> for HashSet<T, DefaultHashBuilder, A>
|
|
1282
|
+
where
|
|
1283
|
+
T: Eq + Hash,
|
|
1284
|
+
A: Default + Allocator,
|
|
1285
|
+
{
|
|
1286
|
+
/// # Examples
|
|
1287
|
+
///
|
|
1288
|
+
/// ```
|
|
1289
|
+
/// use hashbrown::HashSet;
|
|
1290
|
+
///
|
|
1291
|
+
/// let set1 = HashSet::from([1, 2, 3, 4]);
|
|
1292
|
+
/// let set2: HashSet<_> = [1, 2, 3, 4].into();
|
|
1293
|
+
/// assert_eq!(set1, set2);
|
|
1294
|
+
/// ```
|
|
1295
|
+
fn from(arr: [T; N]) -> Self {
|
|
1296
|
+
arr.into_iter().collect()
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
impl<T, S, A> Extend<T> for HashSet<T, S, A>
|
|
1301
|
+
where
|
|
1302
|
+
T: Eq + Hash,
|
|
1303
|
+
S: BuildHasher,
|
|
1304
|
+
A: Allocator,
|
|
1305
|
+
{
|
|
1306
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1307
|
+
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) {
|
|
1308
|
+
self.map.extend(iter.into_iter().map(|k| (k, ())));
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
#[inline]
|
|
1312
|
+
#[cfg(feature = "nightly")]
|
|
1313
|
+
fn extend_one(&mut self, k: T) {
|
|
1314
|
+
self.map.insert(k, ());
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
#[inline]
|
|
1318
|
+
#[cfg(feature = "nightly")]
|
|
1319
|
+
fn extend_reserve(&mut self, additional: usize) {
|
|
1320
|
+
Extend::<(T, ())>::extend_reserve(&mut self.map, additional);
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
impl<'a, T, S, A> Extend<&'a T> for HashSet<T, S, A>
|
|
1325
|
+
where
|
|
1326
|
+
T: 'a + Eq + Hash + Copy,
|
|
1327
|
+
S: BuildHasher,
|
|
1328
|
+
A: Allocator,
|
|
1329
|
+
{
|
|
1330
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1331
|
+
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) {
|
|
1332
|
+
self.extend(iter.into_iter().copied());
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
#[inline]
|
|
1336
|
+
#[cfg(feature = "nightly")]
|
|
1337
|
+
fn extend_one(&mut self, k: &'a T) {
|
|
1338
|
+
self.map.insert(*k, ());
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
#[inline]
|
|
1342
|
+
#[cfg(feature = "nightly")]
|
|
1343
|
+
fn extend_reserve(&mut self, additional: usize) {
|
|
1344
|
+
Extend::<(T, ())>::extend_reserve(&mut self.map, additional);
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
impl<T, S, A> Default for HashSet<T, S, A>
|
|
1349
|
+
where
|
|
1350
|
+
S: Default,
|
|
1351
|
+
A: Default + Allocator,
|
|
1352
|
+
{
|
|
1353
|
+
/// Creates an empty `HashSet<T, S>` with the `Default` value for the hasher.
|
|
1354
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1355
|
+
fn default() -> Self {
|
|
1356
|
+
Self {
|
|
1357
|
+
map: HashMap::default(),
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
impl<T, S, A> BitOr<&HashSet<T, S, A>> for &HashSet<T, S, A>
|
|
1363
|
+
where
|
|
1364
|
+
T: Eq + Hash + Clone,
|
|
1365
|
+
S: BuildHasher + Default,
|
|
1366
|
+
A: Allocator + Default,
|
|
1367
|
+
{
|
|
1368
|
+
type Output = HashSet<T, S, A>;
|
|
1369
|
+
|
|
1370
|
+
/// Returns the union of `self` and `rhs` as a new `HashSet<T, S>`.
|
|
1371
|
+
///
|
|
1372
|
+
/// # Examples
|
|
1373
|
+
///
|
|
1374
|
+
/// ```
|
|
1375
|
+
/// use hashbrown::HashSet;
|
|
1376
|
+
///
|
|
1377
|
+
/// let a: HashSet<_> = vec![1, 2, 3].into_iter().collect();
|
|
1378
|
+
/// let b: HashSet<_> = vec![3, 4, 5].into_iter().collect();
|
|
1379
|
+
///
|
|
1380
|
+
/// let set = &a | &b;
|
|
1381
|
+
///
|
|
1382
|
+
/// let mut i = 0;
|
|
1383
|
+
/// let expected = [1, 2, 3, 4, 5];
|
|
1384
|
+
/// for x in &set {
|
|
1385
|
+
/// assert!(expected.contains(x));
|
|
1386
|
+
/// i += 1;
|
|
1387
|
+
/// }
|
|
1388
|
+
/// assert_eq!(i, expected.len());
|
|
1389
|
+
/// ```
|
|
1390
|
+
fn bitor(self, rhs: &HashSet<T, S, A>) -> HashSet<T, S, A> {
|
|
1391
|
+
self.union(rhs).cloned().collect()
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
impl<T, S, A> BitAnd<&HashSet<T, S, A>> for &HashSet<T, S, A>
|
|
1396
|
+
where
|
|
1397
|
+
T: Eq + Hash + Clone,
|
|
1398
|
+
S: BuildHasher + Default,
|
|
1399
|
+
A: Allocator + Default,
|
|
1400
|
+
{
|
|
1401
|
+
type Output = HashSet<T, S, A>;
|
|
1402
|
+
|
|
1403
|
+
/// Returns the intersection of `self` and `rhs` as a new `HashSet<T, S>`.
|
|
1404
|
+
///
|
|
1405
|
+
/// # Examples
|
|
1406
|
+
///
|
|
1407
|
+
/// ```
|
|
1408
|
+
/// use hashbrown::HashSet;
|
|
1409
|
+
///
|
|
1410
|
+
/// let a: HashSet<_> = vec![1, 2, 3].into_iter().collect();
|
|
1411
|
+
/// let b: HashSet<_> = vec![2, 3, 4].into_iter().collect();
|
|
1412
|
+
///
|
|
1413
|
+
/// let set = &a & &b;
|
|
1414
|
+
///
|
|
1415
|
+
/// let mut i = 0;
|
|
1416
|
+
/// let expected = [2, 3];
|
|
1417
|
+
/// for x in &set {
|
|
1418
|
+
/// assert!(expected.contains(x));
|
|
1419
|
+
/// i += 1;
|
|
1420
|
+
/// }
|
|
1421
|
+
/// assert_eq!(i, expected.len());
|
|
1422
|
+
/// ```
|
|
1423
|
+
fn bitand(self, rhs: &HashSet<T, S, A>) -> HashSet<T, S, A> {
|
|
1424
|
+
self.intersection(rhs).cloned().collect()
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
impl<T, S, A> BitXor<&HashSet<T, S, A>> for &HashSet<T, S, A>
|
|
1429
|
+
where
|
|
1430
|
+
T: Eq + Hash + Clone,
|
|
1431
|
+
S: BuildHasher + Default,
|
|
1432
|
+
A: Allocator + Default,
|
|
1433
|
+
{
|
|
1434
|
+
type Output = HashSet<T, S, A>;
|
|
1435
|
+
|
|
1436
|
+
/// Returns the symmetric difference of `self` and `rhs` as a new `HashSet<T, S>`.
|
|
1437
|
+
///
|
|
1438
|
+
/// # Examples
|
|
1439
|
+
///
|
|
1440
|
+
/// ```
|
|
1441
|
+
/// use hashbrown::HashSet;
|
|
1442
|
+
///
|
|
1443
|
+
/// let a: HashSet<_> = vec![1, 2, 3].into_iter().collect();
|
|
1444
|
+
/// let b: HashSet<_> = vec![3, 4, 5].into_iter().collect();
|
|
1445
|
+
///
|
|
1446
|
+
/// let set = &a ^ &b;
|
|
1447
|
+
///
|
|
1448
|
+
/// let mut i = 0;
|
|
1449
|
+
/// let expected = [1, 2, 4, 5];
|
|
1450
|
+
/// for x in &set {
|
|
1451
|
+
/// assert!(expected.contains(x));
|
|
1452
|
+
/// i += 1;
|
|
1453
|
+
/// }
|
|
1454
|
+
/// assert_eq!(i, expected.len());
|
|
1455
|
+
/// ```
|
|
1456
|
+
fn bitxor(self, rhs: &HashSet<T, S, A>) -> HashSet<T, S, A> {
|
|
1457
|
+
self.symmetric_difference(rhs).cloned().collect()
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
impl<T, S, A> Sub<&HashSet<T, S, A>> for &HashSet<T, S, A>
|
|
1462
|
+
where
|
|
1463
|
+
T: Eq + Hash + Clone,
|
|
1464
|
+
S: BuildHasher + Default,
|
|
1465
|
+
A: Allocator + Default,
|
|
1466
|
+
{
|
|
1467
|
+
type Output = HashSet<T, S, A>;
|
|
1468
|
+
|
|
1469
|
+
/// Returns the difference of `self` and `rhs` as a new `HashSet<T, S>`.
|
|
1470
|
+
///
|
|
1471
|
+
/// # Examples
|
|
1472
|
+
///
|
|
1473
|
+
/// ```
|
|
1474
|
+
/// use hashbrown::HashSet;
|
|
1475
|
+
///
|
|
1476
|
+
/// let a: HashSet<_> = vec![1, 2, 3].into_iter().collect();
|
|
1477
|
+
/// let b: HashSet<_> = vec![3, 4, 5].into_iter().collect();
|
|
1478
|
+
///
|
|
1479
|
+
/// let set = &a - &b;
|
|
1480
|
+
///
|
|
1481
|
+
/// let mut i = 0;
|
|
1482
|
+
/// let expected = [1, 2];
|
|
1483
|
+
/// for x in &set {
|
|
1484
|
+
/// assert!(expected.contains(x));
|
|
1485
|
+
/// i += 1;
|
|
1486
|
+
/// }
|
|
1487
|
+
/// assert_eq!(i, expected.len());
|
|
1488
|
+
/// ```
|
|
1489
|
+
fn sub(self, rhs: &HashSet<T, S, A>) -> HashSet<T, S, A> {
|
|
1490
|
+
self.difference(rhs).cloned().collect()
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
impl<T, S, A> BitOrAssign<&HashSet<T, S, A>> for HashSet<T, S, A>
|
|
1495
|
+
where
|
|
1496
|
+
T: Eq + Hash + Clone,
|
|
1497
|
+
S: BuildHasher,
|
|
1498
|
+
A: Allocator,
|
|
1499
|
+
{
|
|
1500
|
+
/// Modifies this set to contain the union of `self` and `rhs`.
|
|
1501
|
+
///
|
|
1502
|
+
/// # Examples
|
|
1503
|
+
///
|
|
1504
|
+
/// ```
|
|
1505
|
+
/// use hashbrown::HashSet;
|
|
1506
|
+
///
|
|
1507
|
+
/// let mut a: HashSet<_> = vec![1, 2, 3].into_iter().collect();
|
|
1508
|
+
/// let b: HashSet<_> = vec![3, 4, 5].into_iter().collect();
|
|
1509
|
+
///
|
|
1510
|
+
/// a |= &b;
|
|
1511
|
+
///
|
|
1512
|
+
/// let mut i = 0;
|
|
1513
|
+
/// let expected = [1, 2, 3, 4, 5];
|
|
1514
|
+
/// for x in &a {
|
|
1515
|
+
/// assert!(expected.contains(x));
|
|
1516
|
+
/// i += 1;
|
|
1517
|
+
/// }
|
|
1518
|
+
/// assert_eq!(i, expected.len());
|
|
1519
|
+
/// ```
|
|
1520
|
+
fn bitor_assign(&mut self, rhs: &HashSet<T, S, A>) {
|
|
1521
|
+
for item in rhs {
|
|
1522
|
+
if !self.contains(item) {
|
|
1523
|
+
self.insert(item.clone());
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
impl<T, S, A> BitAndAssign<&HashSet<T, S, A>> for HashSet<T, S, A>
|
|
1530
|
+
where
|
|
1531
|
+
T: Eq + Hash + Clone,
|
|
1532
|
+
S: BuildHasher,
|
|
1533
|
+
A: Allocator,
|
|
1534
|
+
{
|
|
1535
|
+
/// Modifies this set to contain the intersection of `self` and `rhs`.
|
|
1536
|
+
///
|
|
1537
|
+
/// # Examples
|
|
1538
|
+
///
|
|
1539
|
+
/// ```
|
|
1540
|
+
/// use hashbrown::HashSet;
|
|
1541
|
+
///
|
|
1542
|
+
/// let mut a: HashSet<_> = vec![1, 2, 3].into_iter().collect();
|
|
1543
|
+
/// let b: HashSet<_> = vec![2, 3, 4].into_iter().collect();
|
|
1544
|
+
///
|
|
1545
|
+
/// a &= &b;
|
|
1546
|
+
///
|
|
1547
|
+
/// let mut i = 0;
|
|
1548
|
+
/// let expected = [2, 3];
|
|
1549
|
+
/// for x in &a {
|
|
1550
|
+
/// assert!(expected.contains(x));
|
|
1551
|
+
/// i += 1;
|
|
1552
|
+
/// }
|
|
1553
|
+
/// assert_eq!(i, expected.len());
|
|
1554
|
+
/// ```
|
|
1555
|
+
fn bitand_assign(&mut self, rhs: &HashSet<T, S, A>) {
|
|
1556
|
+
self.retain(|item| rhs.contains(item));
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
impl<T, S, A> BitXorAssign<&HashSet<T, S, A>> for HashSet<T, S, A>
|
|
1561
|
+
where
|
|
1562
|
+
T: Eq + Hash + Clone,
|
|
1563
|
+
S: BuildHasher,
|
|
1564
|
+
A: Allocator,
|
|
1565
|
+
{
|
|
1566
|
+
/// Modifies this set to contain the symmetric difference of `self` and `rhs`.
|
|
1567
|
+
///
|
|
1568
|
+
/// # Examples
|
|
1569
|
+
///
|
|
1570
|
+
/// ```
|
|
1571
|
+
/// use hashbrown::HashSet;
|
|
1572
|
+
///
|
|
1573
|
+
/// let mut a: HashSet<_> = vec![1, 2, 3].into_iter().collect();
|
|
1574
|
+
/// let b: HashSet<_> = vec![3, 4, 5].into_iter().collect();
|
|
1575
|
+
///
|
|
1576
|
+
/// a ^= &b;
|
|
1577
|
+
///
|
|
1578
|
+
/// let mut i = 0;
|
|
1579
|
+
/// let expected = [1, 2, 4, 5];
|
|
1580
|
+
/// for x in &a {
|
|
1581
|
+
/// assert!(expected.contains(x));
|
|
1582
|
+
/// i += 1;
|
|
1583
|
+
/// }
|
|
1584
|
+
/// assert_eq!(i, expected.len());
|
|
1585
|
+
/// ```
|
|
1586
|
+
fn bitxor_assign(&mut self, rhs: &HashSet<T, S, A>) {
|
|
1587
|
+
for item in rhs {
|
|
1588
|
+
let hash = make_hash(&self.map.hash_builder, item);
|
|
1589
|
+
match self.map.find_or_find_insert_slot(hash, item) {
|
|
1590
|
+
Ok(bucket) => unsafe {
|
|
1591
|
+
self.map.table.remove(bucket);
|
|
1592
|
+
},
|
|
1593
|
+
Err(slot) => unsafe {
|
|
1594
|
+
self.map
|
|
1595
|
+
.table
|
|
1596
|
+
.insert_in_slot(hash, slot, (item.clone(), ()));
|
|
1597
|
+
},
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
impl<T, S, A> SubAssign<&HashSet<T, S, A>> for HashSet<T, S, A>
|
|
1604
|
+
where
|
|
1605
|
+
T: Eq + Hash + Clone,
|
|
1606
|
+
S: BuildHasher,
|
|
1607
|
+
A: Allocator,
|
|
1608
|
+
{
|
|
1609
|
+
/// Modifies this set to contain the difference of `self` and `rhs`.
|
|
1610
|
+
///
|
|
1611
|
+
/// # Examples
|
|
1612
|
+
///
|
|
1613
|
+
/// ```
|
|
1614
|
+
/// use hashbrown::HashSet;
|
|
1615
|
+
///
|
|
1616
|
+
/// let mut a: HashSet<_> = vec![1, 2, 3].into_iter().collect();
|
|
1617
|
+
/// let b: HashSet<_> = vec![3, 4, 5].into_iter().collect();
|
|
1618
|
+
///
|
|
1619
|
+
/// a -= &b;
|
|
1620
|
+
///
|
|
1621
|
+
/// let mut i = 0;
|
|
1622
|
+
/// let expected = [1, 2];
|
|
1623
|
+
/// for x in &a {
|
|
1624
|
+
/// assert!(expected.contains(x));
|
|
1625
|
+
/// i += 1;
|
|
1626
|
+
/// }
|
|
1627
|
+
/// assert_eq!(i, expected.len());
|
|
1628
|
+
/// ```
|
|
1629
|
+
fn sub_assign(&mut self, rhs: &HashSet<T, S, A>) {
|
|
1630
|
+
if rhs.len() < self.len() {
|
|
1631
|
+
for item in rhs {
|
|
1632
|
+
self.remove(item);
|
|
1633
|
+
}
|
|
1634
|
+
} else {
|
|
1635
|
+
self.retain(|item| !rhs.contains(item));
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
/// An iterator over the items of a `HashSet`.
|
|
1641
|
+
///
|
|
1642
|
+
/// This `struct` is created by the [`iter`] method on [`HashSet`].
|
|
1643
|
+
/// See its documentation for more.
|
|
1644
|
+
///
|
|
1645
|
+
/// [`HashSet`]: struct.HashSet.html
|
|
1646
|
+
/// [`iter`]: struct.HashSet.html#method.iter
|
|
1647
|
+
pub struct Iter<'a, K> {
|
|
1648
|
+
iter: Keys<'a, K, ()>,
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
/// An owning iterator over the items of a `HashSet`.
|
|
1652
|
+
///
|
|
1653
|
+
/// This `struct` is created by the [`into_iter`] method on [`HashSet`]
|
|
1654
|
+
/// (provided by the `IntoIterator` trait). See its documentation for more.
|
|
1655
|
+
///
|
|
1656
|
+
/// [`HashSet`]: struct.HashSet.html
|
|
1657
|
+
/// [`into_iter`]: struct.HashSet.html#method.into_iter
|
|
1658
|
+
pub struct IntoIter<K, A: Allocator = Global> {
|
|
1659
|
+
iter: map::IntoIter<K, (), A>,
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
/// A draining iterator over the items of a `HashSet`.
|
|
1663
|
+
///
|
|
1664
|
+
/// This `struct` is created by the [`drain`] method on [`HashSet`].
|
|
1665
|
+
/// See its documentation for more.
|
|
1666
|
+
///
|
|
1667
|
+
/// [`HashSet`]: struct.HashSet.html
|
|
1668
|
+
/// [`drain`]: struct.HashSet.html#method.drain
|
|
1669
|
+
pub struct Drain<'a, K, A: Allocator = Global> {
|
|
1670
|
+
iter: map::Drain<'a, K, (), A>,
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
/// A draining iterator over entries of a `HashSet` which don't satisfy the predicate `f`.
|
|
1674
|
+
///
|
|
1675
|
+
/// This `struct` is created by the [`extract_if`] method on [`HashSet`]. See its
|
|
1676
|
+
/// documentation for more.
|
|
1677
|
+
///
|
|
1678
|
+
/// [`extract_if`]: struct.HashSet.html#method.extract_if
|
|
1679
|
+
/// [`HashSet`]: struct.HashSet.html
|
|
1680
|
+
#[must_use = "Iterators are lazy unless consumed"]
|
|
1681
|
+
pub struct ExtractIf<'a, K, F, A: Allocator = Global> {
|
|
1682
|
+
f: F,
|
|
1683
|
+
inner: RawExtractIf<'a, (K, ()), A>,
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
/// A lazy iterator producing elements in the intersection of `HashSet`s.
|
|
1687
|
+
///
|
|
1688
|
+
/// This `struct` is created by the [`intersection`] method on [`HashSet`].
|
|
1689
|
+
/// See its documentation for more.
|
|
1690
|
+
///
|
|
1691
|
+
/// [`HashSet`]: struct.HashSet.html
|
|
1692
|
+
/// [`intersection`]: struct.HashSet.html#method.intersection
|
|
1693
|
+
pub struct Intersection<'a, T, S, A: Allocator = Global> {
|
|
1694
|
+
// iterator of the first set
|
|
1695
|
+
iter: Iter<'a, T>,
|
|
1696
|
+
// the second set
|
|
1697
|
+
other: &'a HashSet<T, S, A>,
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
/// A lazy iterator producing elements in the difference of `HashSet`s.
|
|
1701
|
+
///
|
|
1702
|
+
/// This `struct` is created by the [`difference`] method on [`HashSet`].
|
|
1703
|
+
/// See its documentation for more.
|
|
1704
|
+
///
|
|
1705
|
+
/// [`HashSet`]: struct.HashSet.html
|
|
1706
|
+
/// [`difference`]: struct.HashSet.html#method.difference
|
|
1707
|
+
pub struct Difference<'a, T, S, A: Allocator = Global> {
|
|
1708
|
+
// iterator of the first set
|
|
1709
|
+
iter: Iter<'a, T>,
|
|
1710
|
+
// the second set
|
|
1711
|
+
other: &'a HashSet<T, S, A>,
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
/// A lazy iterator producing elements in the symmetric difference of `HashSet`s.
|
|
1715
|
+
///
|
|
1716
|
+
/// This `struct` is created by the [`symmetric_difference`] method on
|
|
1717
|
+
/// [`HashSet`]. See its documentation for more.
|
|
1718
|
+
///
|
|
1719
|
+
/// [`HashSet`]: struct.HashSet.html
|
|
1720
|
+
/// [`symmetric_difference`]: struct.HashSet.html#method.symmetric_difference
|
|
1721
|
+
pub struct SymmetricDifference<'a, T, S, A: Allocator = Global> {
|
|
1722
|
+
iter: Chain<Difference<'a, T, S, A>, Difference<'a, T, S, A>>,
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
/// A lazy iterator producing elements in the union of `HashSet`s.
|
|
1726
|
+
///
|
|
1727
|
+
/// This `struct` is created by the [`union`] method on [`HashSet`].
|
|
1728
|
+
/// See its documentation for more.
|
|
1729
|
+
///
|
|
1730
|
+
/// [`HashSet`]: struct.HashSet.html
|
|
1731
|
+
/// [`union`]: struct.HashSet.html#method.union
|
|
1732
|
+
pub struct Union<'a, T, S, A: Allocator = Global> {
|
|
1733
|
+
iter: Chain<Iter<'a, T>, Difference<'a, T, S, A>>,
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
impl<'a, T, S, A: Allocator> IntoIterator for &'a HashSet<T, S, A> {
|
|
1737
|
+
type Item = &'a T;
|
|
1738
|
+
type IntoIter = Iter<'a, T>;
|
|
1739
|
+
|
|
1740
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1741
|
+
fn into_iter(self) -> Iter<'a, T> {
|
|
1742
|
+
self.iter()
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
impl<T, S, A: Allocator> IntoIterator for HashSet<T, S, A> {
|
|
1747
|
+
type Item = T;
|
|
1748
|
+
type IntoIter = IntoIter<T, A>;
|
|
1749
|
+
|
|
1750
|
+
/// Creates a consuming iterator, that is, one that moves each value out
|
|
1751
|
+
/// of the set in arbitrary order. The set cannot be used after calling
|
|
1752
|
+
/// this.
|
|
1753
|
+
///
|
|
1754
|
+
/// # Examples
|
|
1755
|
+
///
|
|
1756
|
+
/// ```
|
|
1757
|
+
/// use hashbrown::HashSet;
|
|
1758
|
+
/// let mut set = HashSet::new();
|
|
1759
|
+
/// set.insert("a".to_string());
|
|
1760
|
+
/// set.insert("b".to_string());
|
|
1761
|
+
///
|
|
1762
|
+
/// // Not possible to collect to a Vec<String> with a regular `.iter()`.
|
|
1763
|
+
/// let v: Vec<String> = set.into_iter().collect();
|
|
1764
|
+
///
|
|
1765
|
+
/// // Will print in an arbitrary order.
|
|
1766
|
+
/// for x in &v {
|
|
1767
|
+
/// println!("{}", x);
|
|
1768
|
+
/// }
|
|
1769
|
+
/// ```
|
|
1770
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1771
|
+
fn into_iter(self) -> IntoIter<T, A> {
|
|
1772
|
+
IntoIter {
|
|
1773
|
+
iter: self.map.into_iter(),
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
impl<K> Clone for Iter<'_, K> {
|
|
1779
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1780
|
+
fn clone(&self) -> Self {
|
|
1781
|
+
Iter {
|
|
1782
|
+
iter: self.iter.clone(),
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
impl<K> Default for Iter<'_, K> {
|
|
1787
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1788
|
+
fn default() -> Self {
|
|
1789
|
+
Iter {
|
|
1790
|
+
iter: Default::default(),
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
impl<'a, K> Iterator for Iter<'a, K> {
|
|
1795
|
+
type Item = &'a K;
|
|
1796
|
+
|
|
1797
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1798
|
+
fn next(&mut self) -> Option<&'a K> {
|
|
1799
|
+
self.iter.next()
|
|
1800
|
+
}
|
|
1801
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1802
|
+
fn size_hint(&self) -> (usize, Option<usize>) {
|
|
1803
|
+
self.iter.size_hint()
|
|
1804
|
+
}
|
|
1805
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1806
|
+
fn fold<B, F>(self, init: B, f: F) -> B
|
|
1807
|
+
where
|
|
1808
|
+
Self: Sized,
|
|
1809
|
+
F: FnMut(B, Self::Item) -> B,
|
|
1810
|
+
{
|
|
1811
|
+
self.iter.fold(init, f)
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
impl<K> ExactSizeIterator for Iter<'_, K> {
|
|
1815
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1816
|
+
fn len(&self) -> usize {
|
|
1817
|
+
self.iter.len()
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
impl<K> FusedIterator for Iter<'_, K> {}
|
|
1821
|
+
|
|
1822
|
+
impl<K: fmt::Debug> fmt::Debug for Iter<'_, K> {
|
|
1823
|
+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
1824
|
+
f.debug_list().entries(self.clone()).finish()
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
impl<K, A: Allocator> Default for IntoIter<K, A> {
|
|
1829
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1830
|
+
fn default() -> Self {
|
|
1831
|
+
IntoIter {
|
|
1832
|
+
iter: Default::default(),
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
impl<K, A: Allocator> Iterator for IntoIter<K, A> {
|
|
1837
|
+
type Item = K;
|
|
1838
|
+
|
|
1839
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1840
|
+
fn next(&mut self) -> Option<K> {
|
|
1841
|
+
// Avoid `Option::map` because it bloats LLVM IR.
|
|
1842
|
+
match self.iter.next() {
|
|
1843
|
+
Some((k, _)) => Some(k),
|
|
1844
|
+
None => None,
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1848
|
+
fn size_hint(&self) -> (usize, Option<usize>) {
|
|
1849
|
+
self.iter.size_hint()
|
|
1850
|
+
}
|
|
1851
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1852
|
+
fn fold<B, F>(self, init: B, mut f: F) -> B
|
|
1853
|
+
where
|
|
1854
|
+
Self: Sized,
|
|
1855
|
+
F: FnMut(B, Self::Item) -> B,
|
|
1856
|
+
{
|
|
1857
|
+
self.iter.fold(init, |acc, (k, ())| f(acc, k))
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
impl<K, A: Allocator> ExactSizeIterator for IntoIter<K, A> {
|
|
1861
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1862
|
+
fn len(&self) -> usize {
|
|
1863
|
+
self.iter.len()
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
impl<K, A: Allocator> FusedIterator for IntoIter<K, A> {}
|
|
1867
|
+
|
|
1868
|
+
impl<K: fmt::Debug, A: Allocator> fmt::Debug for IntoIter<K, A> {
|
|
1869
|
+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
1870
|
+
let entries_iter = self.iter.iter().map(|(k, _)| k);
|
|
1871
|
+
f.debug_list().entries(entries_iter).finish()
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
impl<K, A: Allocator> Iterator for Drain<'_, K, A> {
|
|
1876
|
+
type Item = K;
|
|
1877
|
+
|
|
1878
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1879
|
+
fn next(&mut self) -> Option<K> {
|
|
1880
|
+
// Avoid `Option::map` because it bloats LLVM IR.
|
|
1881
|
+
match self.iter.next() {
|
|
1882
|
+
Some((k, _)) => Some(k),
|
|
1883
|
+
None => None,
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1887
|
+
fn size_hint(&self) -> (usize, Option<usize>) {
|
|
1888
|
+
self.iter.size_hint()
|
|
1889
|
+
}
|
|
1890
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1891
|
+
fn fold<B, F>(self, init: B, mut f: F) -> B
|
|
1892
|
+
where
|
|
1893
|
+
Self: Sized,
|
|
1894
|
+
F: FnMut(B, Self::Item) -> B,
|
|
1895
|
+
{
|
|
1896
|
+
self.iter.fold(init, |acc, (k, ())| f(acc, k))
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
impl<K, A: Allocator> ExactSizeIterator for Drain<'_, K, A> {
|
|
1900
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1901
|
+
fn len(&self) -> usize {
|
|
1902
|
+
self.iter.len()
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
impl<K, A: Allocator> FusedIterator for Drain<'_, K, A> {}
|
|
1906
|
+
|
|
1907
|
+
impl<K: fmt::Debug, A: Allocator> fmt::Debug for Drain<'_, K, A> {
|
|
1908
|
+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
1909
|
+
let entries_iter = self.iter.iter().map(|(k, _)| k);
|
|
1910
|
+
f.debug_list().entries(entries_iter).finish()
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
impl<K, F, A: Allocator> Iterator for ExtractIf<'_, K, F, A>
|
|
1915
|
+
where
|
|
1916
|
+
F: FnMut(&K) -> bool,
|
|
1917
|
+
{
|
|
1918
|
+
type Item = K;
|
|
1919
|
+
|
|
1920
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1921
|
+
fn next(&mut self) -> Option<Self::Item> {
|
|
1922
|
+
self.inner
|
|
1923
|
+
.next(|&mut (ref k, ())| (self.f)(k))
|
|
1924
|
+
.map(|(k, ())| k)
|
|
1925
|
+
}
|
|
1926
|
+
|
|
1927
|
+
#[inline]
|
|
1928
|
+
fn size_hint(&self) -> (usize, Option<usize>) {
|
|
1929
|
+
(0, self.inner.iter.size_hint().1)
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
impl<K, F, A: Allocator> FusedIterator for ExtractIf<'_, K, F, A> where F: FnMut(&K) -> bool {}
|
|
1934
|
+
|
|
1935
|
+
impl<T, S, A: Allocator> Clone for Intersection<'_, T, S, A> {
|
|
1936
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1937
|
+
fn clone(&self) -> Self {
|
|
1938
|
+
Intersection {
|
|
1939
|
+
iter: self.iter.clone(),
|
|
1940
|
+
..*self
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
impl<'a, T, S, A> Iterator for Intersection<'a, T, S, A>
|
|
1946
|
+
where
|
|
1947
|
+
T: Eq + Hash,
|
|
1948
|
+
S: BuildHasher,
|
|
1949
|
+
A: Allocator,
|
|
1950
|
+
{
|
|
1951
|
+
type Item = &'a T;
|
|
1952
|
+
|
|
1953
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1954
|
+
fn next(&mut self) -> Option<&'a T> {
|
|
1955
|
+
loop {
|
|
1956
|
+
let elt = self.iter.next()?;
|
|
1957
|
+
if self.other.contains(elt) {
|
|
1958
|
+
return Some(elt);
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1964
|
+
fn size_hint(&self) -> (usize, Option<usize>) {
|
|
1965
|
+
let (_, upper) = self.iter.size_hint();
|
|
1966
|
+
(0, upper)
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
1970
|
+
fn fold<B, F>(self, init: B, mut f: F) -> B
|
|
1971
|
+
where
|
|
1972
|
+
Self: Sized,
|
|
1973
|
+
F: FnMut(B, Self::Item) -> B,
|
|
1974
|
+
{
|
|
1975
|
+
self.iter.fold(init, |acc, elt| {
|
|
1976
|
+
if self.other.contains(elt) {
|
|
1977
|
+
f(acc, elt)
|
|
1978
|
+
} else {
|
|
1979
|
+
acc
|
|
1980
|
+
}
|
|
1981
|
+
})
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
impl<T, S, A> fmt::Debug for Intersection<'_, T, S, A>
|
|
1986
|
+
where
|
|
1987
|
+
T: fmt::Debug + Eq + Hash,
|
|
1988
|
+
S: BuildHasher,
|
|
1989
|
+
A: Allocator,
|
|
1990
|
+
{
|
|
1991
|
+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
1992
|
+
f.debug_list().entries(self.clone()).finish()
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
impl<T, S, A> FusedIterator for Intersection<'_, T, S, A>
|
|
1997
|
+
where
|
|
1998
|
+
T: Eq + Hash,
|
|
1999
|
+
S: BuildHasher,
|
|
2000
|
+
A: Allocator,
|
|
2001
|
+
{
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
impl<T, S, A: Allocator> Clone for Difference<'_, T, S, A> {
|
|
2005
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2006
|
+
fn clone(&self) -> Self {
|
|
2007
|
+
Difference {
|
|
2008
|
+
iter: self.iter.clone(),
|
|
2009
|
+
..*self
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
|
|
2014
|
+
impl<'a, T, S, A> Iterator for Difference<'a, T, S, A>
|
|
2015
|
+
where
|
|
2016
|
+
T: Eq + Hash,
|
|
2017
|
+
S: BuildHasher,
|
|
2018
|
+
A: Allocator,
|
|
2019
|
+
{
|
|
2020
|
+
type Item = &'a T;
|
|
2021
|
+
|
|
2022
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2023
|
+
fn next(&mut self) -> Option<&'a T> {
|
|
2024
|
+
loop {
|
|
2025
|
+
let elt = self.iter.next()?;
|
|
2026
|
+
if !self.other.contains(elt) {
|
|
2027
|
+
return Some(elt);
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2033
|
+
fn size_hint(&self) -> (usize, Option<usize>) {
|
|
2034
|
+
let (lower, upper) = self.iter.size_hint();
|
|
2035
|
+
(lower.saturating_sub(self.other.len()), upper)
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2039
|
+
fn fold<B, F>(self, init: B, mut f: F) -> B
|
|
2040
|
+
where
|
|
2041
|
+
Self: Sized,
|
|
2042
|
+
F: FnMut(B, Self::Item) -> B,
|
|
2043
|
+
{
|
|
2044
|
+
self.iter.fold(init, |acc, elt| {
|
|
2045
|
+
if self.other.contains(elt) {
|
|
2046
|
+
acc
|
|
2047
|
+
} else {
|
|
2048
|
+
f(acc, elt)
|
|
2049
|
+
}
|
|
2050
|
+
})
|
|
2051
|
+
}
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
impl<T, S, A> FusedIterator for Difference<'_, T, S, A>
|
|
2055
|
+
where
|
|
2056
|
+
T: Eq + Hash,
|
|
2057
|
+
S: BuildHasher,
|
|
2058
|
+
A: Allocator,
|
|
2059
|
+
{
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
impl<T, S, A> fmt::Debug for Difference<'_, T, S, A>
|
|
2063
|
+
where
|
|
2064
|
+
T: fmt::Debug + Eq + Hash,
|
|
2065
|
+
S: BuildHasher,
|
|
2066
|
+
A: Allocator,
|
|
2067
|
+
{
|
|
2068
|
+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
2069
|
+
f.debug_list().entries(self.clone()).finish()
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
impl<T, S, A: Allocator> Clone for SymmetricDifference<'_, T, S, A> {
|
|
2074
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2075
|
+
fn clone(&self) -> Self {
|
|
2076
|
+
SymmetricDifference {
|
|
2077
|
+
iter: self.iter.clone(),
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
impl<'a, T, S, A> Iterator for SymmetricDifference<'a, T, S, A>
|
|
2083
|
+
where
|
|
2084
|
+
T: Eq + Hash,
|
|
2085
|
+
S: BuildHasher,
|
|
2086
|
+
A: Allocator,
|
|
2087
|
+
{
|
|
2088
|
+
type Item = &'a T;
|
|
2089
|
+
|
|
2090
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2091
|
+
fn next(&mut self) -> Option<&'a T> {
|
|
2092
|
+
self.iter.next()
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2096
|
+
fn size_hint(&self) -> (usize, Option<usize>) {
|
|
2097
|
+
self.iter.size_hint()
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2101
|
+
fn fold<B, F>(self, init: B, f: F) -> B
|
|
2102
|
+
where
|
|
2103
|
+
Self: Sized,
|
|
2104
|
+
F: FnMut(B, Self::Item) -> B,
|
|
2105
|
+
{
|
|
2106
|
+
self.iter.fold(init, f)
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2110
|
+
impl<T, S, A> FusedIterator for SymmetricDifference<'_, T, S, A>
|
|
2111
|
+
where
|
|
2112
|
+
T: Eq + Hash,
|
|
2113
|
+
S: BuildHasher,
|
|
2114
|
+
A: Allocator,
|
|
2115
|
+
{
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2118
|
+
impl<T, S, A> fmt::Debug for SymmetricDifference<'_, T, S, A>
|
|
2119
|
+
where
|
|
2120
|
+
T: fmt::Debug + Eq + Hash,
|
|
2121
|
+
S: BuildHasher,
|
|
2122
|
+
A: Allocator,
|
|
2123
|
+
{
|
|
2124
|
+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
2125
|
+
f.debug_list().entries(self.clone()).finish()
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
impl<T, S, A: Allocator> Clone for Union<'_, T, S, A> {
|
|
2130
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2131
|
+
fn clone(&self) -> Self {
|
|
2132
|
+
Union {
|
|
2133
|
+
iter: self.iter.clone(),
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
|
|
2138
|
+
impl<T, S, A> FusedIterator for Union<'_, T, S, A>
|
|
2139
|
+
where
|
|
2140
|
+
T: Eq + Hash,
|
|
2141
|
+
S: BuildHasher,
|
|
2142
|
+
A: Allocator,
|
|
2143
|
+
{
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
impl<T, S, A> fmt::Debug for Union<'_, T, S, A>
|
|
2147
|
+
where
|
|
2148
|
+
T: fmt::Debug + Eq + Hash,
|
|
2149
|
+
S: BuildHasher,
|
|
2150
|
+
A: Allocator,
|
|
2151
|
+
{
|
|
2152
|
+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
2153
|
+
f.debug_list().entries(self.clone()).finish()
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
impl<'a, T, S, A> Iterator for Union<'a, T, S, A>
|
|
2158
|
+
where
|
|
2159
|
+
T: Eq + Hash,
|
|
2160
|
+
S: BuildHasher,
|
|
2161
|
+
A: Allocator,
|
|
2162
|
+
{
|
|
2163
|
+
type Item = &'a T;
|
|
2164
|
+
|
|
2165
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2166
|
+
fn next(&mut self) -> Option<&'a T> {
|
|
2167
|
+
self.iter.next()
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2171
|
+
fn size_hint(&self) -> (usize, Option<usize>) {
|
|
2172
|
+
self.iter.size_hint()
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2176
|
+
fn fold<B, F>(self, init: B, f: F) -> B
|
|
2177
|
+
where
|
|
2178
|
+
Self: Sized,
|
|
2179
|
+
F: FnMut(B, Self::Item) -> B,
|
|
2180
|
+
{
|
|
2181
|
+
self.iter.fold(init, f)
|
|
2182
|
+
}
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
/// A view into a single entry in a set, which may either be vacant or occupied.
|
|
2186
|
+
///
|
|
2187
|
+
/// This `enum` is constructed from the [`entry`] method on [`HashSet`].
|
|
2188
|
+
///
|
|
2189
|
+
/// [`HashSet`]: struct.HashSet.html
|
|
2190
|
+
/// [`entry`]: struct.HashSet.html#method.entry
|
|
2191
|
+
///
|
|
2192
|
+
/// # Examples
|
|
2193
|
+
///
|
|
2194
|
+
/// ```
|
|
2195
|
+
/// use hashbrown::hash_set::{Entry, HashSet, OccupiedEntry};
|
|
2196
|
+
///
|
|
2197
|
+
/// let mut set = HashSet::new();
|
|
2198
|
+
/// set.extend(["a", "b", "c"]);
|
|
2199
|
+
/// assert_eq!(set.len(), 3);
|
|
2200
|
+
///
|
|
2201
|
+
/// // Existing value (insert)
|
|
2202
|
+
/// let entry: Entry<_, _> = set.entry("a");
|
|
2203
|
+
/// let _raw_o: OccupiedEntry<_, _> = entry.insert();
|
|
2204
|
+
/// assert_eq!(set.len(), 3);
|
|
2205
|
+
/// // Nonexistent value (insert)
|
|
2206
|
+
/// set.entry("d").insert();
|
|
2207
|
+
///
|
|
2208
|
+
/// // Existing value (or_insert)
|
|
2209
|
+
/// set.entry("b").or_insert();
|
|
2210
|
+
/// // Nonexistent value (or_insert)
|
|
2211
|
+
/// set.entry("e").or_insert();
|
|
2212
|
+
///
|
|
2213
|
+
/// println!("Our HashSet: {:?}", set);
|
|
2214
|
+
///
|
|
2215
|
+
/// let mut vec: Vec<_> = set.iter().copied().collect();
|
|
2216
|
+
/// // The `Iter` iterator produces items in arbitrary order, so the
|
|
2217
|
+
/// // items must be sorted to test them against a sorted array.
|
|
2218
|
+
/// vec.sort_unstable();
|
|
2219
|
+
/// assert_eq!(vec, ["a", "b", "c", "d", "e"]);
|
|
2220
|
+
/// ```
|
|
2221
|
+
pub enum Entry<'a, T, S, A = Global>
|
|
2222
|
+
where
|
|
2223
|
+
A: Allocator,
|
|
2224
|
+
{
|
|
2225
|
+
/// An occupied entry.
|
|
2226
|
+
///
|
|
2227
|
+
/// # Examples
|
|
2228
|
+
///
|
|
2229
|
+
/// ```
|
|
2230
|
+
/// use hashbrown::hash_set::{Entry, HashSet};
|
|
2231
|
+
/// let mut set: HashSet<_> = ["a", "b"].into();
|
|
2232
|
+
///
|
|
2233
|
+
/// match set.entry("a") {
|
|
2234
|
+
/// Entry::Vacant(_) => unreachable!(),
|
|
2235
|
+
/// Entry::Occupied(_) => { }
|
|
2236
|
+
/// }
|
|
2237
|
+
/// ```
|
|
2238
|
+
Occupied(OccupiedEntry<'a, T, S, A>),
|
|
2239
|
+
|
|
2240
|
+
/// A vacant entry.
|
|
2241
|
+
///
|
|
2242
|
+
/// # Examples
|
|
2243
|
+
///
|
|
2244
|
+
/// ```
|
|
2245
|
+
/// use hashbrown::hash_set::{Entry, HashSet};
|
|
2246
|
+
/// let mut set: HashSet<&str> = HashSet::new();
|
|
2247
|
+
///
|
|
2248
|
+
/// match set.entry("a") {
|
|
2249
|
+
/// Entry::Occupied(_) => unreachable!(),
|
|
2250
|
+
/// Entry::Vacant(_) => { }
|
|
2251
|
+
/// }
|
|
2252
|
+
/// ```
|
|
2253
|
+
Vacant(VacantEntry<'a, T, S, A>),
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2256
|
+
impl<T: fmt::Debug, S, A: Allocator> fmt::Debug for Entry<'_, T, S, A> {
|
|
2257
|
+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
2258
|
+
match *self {
|
|
2259
|
+
Entry::Vacant(ref v) => f.debug_tuple("Entry").field(v).finish(),
|
|
2260
|
+
Entry::Occupied(ref o) => f.debug_tuple("Entry").field(o).finish(),
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
/// A view into an occupied entry in a `HashSet`.
|
|
2266
|
+
/// It is part of the [`Entry`] enum.
|
|
2267
|
+
///
|
|
2268
|
+
/// [`Entry`]: enum.Entry.html
|
|
2269
|
+
///
|
|
2270
|
+
/// # Examples
|
|
2271
|
+
///
|
|
2272
|
+
/// ```
|
|
2273
|
+
/// use hashbrown::hash_set::{Entry, HashSet, OccupiedEntry};
|
|
2274
|
+
///
|
|
2275
|
+
/// let mut set = HashSet::new();
|
|
2276
|
+
/// set.extend(["a", "b", "c"]);
|
|
2277
|
+
///
|
|
2278
|
+
/// let _entry_o: OccupiedEntry<_, _> = set.entry("a").insert();
|
|
2279
|
+
/// assert_eq!(set.len(), 3);
|
|
2280
|
+
///
|
|
2281
|
+
/// // Existing key
|
|
2282
|
+
/// match set.entry("a") {
|
|
2283
|
+
/// Entry::Vacant(_) => unreachable!(),
|
|
2284
|
+
/// Entry::Occupied(view) => {
|
|
2285
|
+
/// assert_eq!(view.get(), &"a");
|
|
2286
|
+
/// }
|
|
2287
|
+
/// }
|
|
2288
|
+
///
|
|
2289
|
+
/// assert_eq!(set.len(), 3);
|
|
2290
|
+
///
|
|
2291
|
+
/// // Existing key (take)
|
|
2292
|
+
/// match set.entry("c") {
|
|
2293
|
+
/// Entry::Vacant(_) => unreachable!(),
|
|
2294
|
+
/// Entry::Occupied(view) => {
|
|
2295
|
+
/// assert_eq!(view.remove(), "c");
|
|
2296
|
+
/// }
|
|
2297
|
+
/// }
|
|
2298
|
+
/// assert_eq!(set.get(&"c"), None);
|
|
2299
|
+
/// assert_eq!(set.len(), 2);
|
|
2300
|
+
/// ```
|
|
2301
|
+
pub struct OccupiedEntry<'a, T, S, A: Allocator = Global> {
|
|
2302
|
+
inner: map::OccupiedEntry<'a, T, (), S, A>,
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
impl<T: fmt::Debug, S, A: Allocator> fmt::Debug for OccupiedEntry<'_, T, S, A> {
|
|
2306
|
+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
2307
|
+
f.debug_struct("OccupiedEntry")
|
|
2308
|
+
.field("value", self.get())
|
|
2309
|
+
.finish()
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
|
|
2313
|
+
/// A view into a vacant entry in a `HashSet`.
|
|
2314
|
+
/// It is part of the [`Entry`] enum.
|
|
2315
|
+
///
|
|
2316
|
+
/// [`Entry`]: enum.Entry.html
|
|
2317
|
+
///
|
|
2318
|
+
/// # Examples
|
|
2319
|
+
///
|
|
2320
|
+
/// ```
|
|
2321
|
+
/// use hashbrown::hash_set::{Entry, HashSet, VacantEntry};
|
|
2322
|
+
///
|
|
2323
|
+
/// let mut set = HashSet::<&str>::new();
|
|
2324
|
+
///
|
|
2325
|
+
/// let entry_v: VacantEntry<_, _> = match set.entry("a") {
|
|
2326
|
+
/// Entry::Vacant(view) => view,
|
|
2327
|
+
/// Entry::Occupied(_) => unreachable!(),
|
|
2328
|
+
/// };
|
|
2329
|
+
/// entry_v.insert();
|
|
2330
|
+
/// assert!(set.contains("a") && set.len() == 1);
|
|
2331
|
+
///
|
|
2332
|
+
/// // Nonexistent key (insert)
|
|
2333
|
+
/// match set.entry("b") {
|
|
2334
|
+
/// Entry::Vacant(view) => { view.insert(); },
|
|
2335
|
+
/// Entry::Occupied(_) => unreachable!(),
|
|
2336
|
+
/// }
|
|
2337
|
+
/// assert!(set.contains("b") && set.len() == 2);
|
|
2338
|
+
/// ```
|
|
2339
|
+
pub struct VacantEntry<'a, T, S, A: Allocator = Global> {
|
|
2340
|
+
inner: map::VacantEntry<'a, T, (), S, A>,
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
impl<T: fmt::Debug, S, A: Allocator> fmt::Debug for VacantEntry<'_, T, S, A> {
|
|
2344
|
+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
2345
|
+
f.debug_tuple("VacantEntry").field(self.get()).finish()
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
impl<'a, T, S, A: Allocator> Entry<'a, T, S, A> {
|
|
2350
|
+
/// Sets the value of the entry, and returns an `OccupiedEntry`.
|
|
2351
|
+
///
|
|
2352
|
+
/// # Examples
|
|
2353
|
+
///
|
|
2354
|
+
/// ```
|
|
2355
|
+
/// use hashbrown::HashSet;
|
|
2356
|
+
///
|
|
2357
|
+
/// let mut set: HashSet<&str> = HashSet::new();
|
|
2358
|
+
/// let entry = set.entry("horseyland").insert();
|
|
2359
|
+
///
|
|
2360
|
+
/// assert_eq!(entry.get(), &"horseyland");
|
|
2361
|
+
/// ```
|
|
2362
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2363
|
+
pub fn insert(self) -> OccupiedEntry<'a, T, S, A>
|
|
2364
|
+
where
|
|
2365
|
+
T: Hash,
|
|
2366
|
+
S: BuildHasher,
|
|
2367
|
+
{
|
|
2368
|
+
match self {
|
|
2369
|
+
Entry::Occupied(entry) => entry,
|
|
2370
|
+
Entry::Vacant(entry) => entry.insert(),
|
|
2371
|
+
}
|
|
2372
|
+
}
|
|
2373
|
+
|
|
2374
|
+
/// Ensures a value is in the entry by inserting if it was vacant.
|
|
2375
|
+
///
|
|
2376
|
+
/// # Examples
|
|
2377
|
+
///
|
|
2378
|
+
/// ```
|
|
2379
|
+
/// use hashbrown::HashSet;
|
|
2380
|
+
///
|
|
2381
|
+
/// let mut set: HashSet<&str> = HashSet::new();
|
|
2382
|
+
///
|
|
2383
|
+
/// // nonexistent key
|
|
2384
|
+
/// set.entry("poneyland").or_insert();
|
|
2385
|
+
/// assert!(set.contains("poneyland"));
|
|
2386
|
+
///
|
|
2387
|
+
/// // existing key
|
|
2388
|
+
/// set.entry("poneyland").or_insert();
|
|
2389
|
+
/// assert!(set.contains("poneyland"));
|
|
2390
|
+
/// assert_eq!(set.len(), 1);
|
|
2391
|
+
/// ```
|
|
2392
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2393
|
+
pub fn or_insert(self)
|
|
2394
|
+
where
|
|
2395
|
+
T: Hash,
|
|
2396
|
+
S: BuildHasher,
|
|
2397
|
+
{
|
|
2398
|
+
if let Entry::Vacant(entry) = self {
|
|
2399
|
+
entry.insert();
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
/// Returns a reference to this entry's value.
|
|
2404
|
+
///
|
|
2405
|
+
/// # Examples
|
|
2406
|
+
///
|
|
2407
|
+
/// ```
|
|
2408
|
+
/// use hashbrown::HashSet;
|
|
2409
|
+
///
|
|
2410
|
+
/// let mut set: HashSet<&str> = HashSet::new();
|
|
2411
|
+
/// set.entry("poneyland").or_insert();
|
|
2412
|
+
/// // existing key
|
|
2413
|
+
/// assert_eq!(set.entry("poneyland").get(), &"poneyland");
|
|
2414
|
+
/// // nonexistent key
|
|
2415
|
+
/// assert_eq!(set.entry("horseland").get(), &"horseland");
|
|
2416
|
+
/// ```
|
|
2417
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2418
|
+
pub fn get(&self) -> &T {
|
|
2419
|
+
match *self {
|
|
2420
|
+
Entry::Occupied(ref entry) => entry.get(),
|
|
2421
|
+
Entry::Vacant(ref entry) => entry.get(),
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
impl<T, S, A: Allocator> OccupiedEntry<'_, T, S, A> {
|
|
2427
|
+
/// Gets a reference to the value in the entry.
|
|
2428
|
+
///
|
|
2429
|
+
/// # Examples
|
|
2430
|
+
///
|
|
2431
|
+
/// ```
|
|
2432
|
+
/// use hashbrown::hash_set::{Entry, HashSet};
|
|
2433
|
+
///
|
|
2434
|
+
/// let mut set: HashSet<&str> = HashSet::new();
|
|
2435
|
+
/// set.entry("poneyland").or_insert();
|
|
2436
|
+
///
|
|
2437
|
+
/// match set.entry("poneyland") {
|
|
2438
|
+
/// Entry::Vacant(_) => panic!(),
|
|
2439
|
+
/// Entry::Occupied(entry) => assert_eq!(entry.get(), &"poneyland"),
|
|
2440
|
+
/// }
|
|
2441
|
+
/// ```
|
|
2442
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2443
|
+
pub fn get(&self) -> &T {
|
|
2444
|
+
self.inner.key()
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
/// Takes the value out of the entry, and returns it.
|
|
2448
|
+
/// Keeps the allocated memory for reuse.
|
|
2449
|
+
///
|
|
2450
|
+
/// # Examples
|
|
2451
|
+
///
|
|
2452
|
+
/// ```
|
|
2453
|
+
/// use hashbrown::HashSet;
|
|
2454
|
+
/// use hashbrown::hash_set::Entry;
|
|
2455
|
+
///
|
|
2456
|
+
/// let mut set: HashSet<&str> = HashSet::new();
|
|
2457
|
+
/// // The set is empty
|
|
2458
|
+
/// assert!(set.is_empty() && set.capacity() == 0);
|
|
2459
|
+
///
|
|
2460
|
+
/// set.entry("poneyland").or_insert();
|
|
2461
|
+
/// let capacity_before_remove = set.capacity();
|
|
2462
|
+
///
|
|
2463
|
+
/// if let Entry::Occupied(o) = set.entry("poneyland") {
|
|
2464
|
+
/// assert_eq!(o.remove(), "poneyland");
|
|
2465
|
+
/// }
|
|
2466
|
+
///
|
|
2467
|
+
/// assert_eq!(set.contains("poneyland"), false);
|
|
2468
|
+
/// // Now set hold none elements but capacity is equal to the old one
|
|
2469
|
+
/// assert!(set.len() == 0 && set.capacity() == capacity_before_remove);
|
|
2470
|
+
/// ```
|
|
2471
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2472
|
+
pub fn remove(self) -> T {
|
|
2473
|
+
self.inner.remove_entry().0
|
|
2474
|
+
}
|
|
2475
|
+
}
|
|
2476
|
+
|
|
2477
|
+
impl<'a, T, S, A: Allocator> VacantEntry<'a, T, S, A> {
|
|
2478
|
+
/// Gets a reference to the value that would be used when inserting
|
|
2479
|
+
/// through the `VacantEntry`.
|
|
2480
|
+
///
|
|
2481
|
+
/// # Examples
|
|
2482
|
+
///
|
|
2483
|
+
/// ```
|
|
2484
|
+
/// use hashbrown::HashSet;
|
|
2485
|
+
///
|
|
2486
|
+
/// let mut set: HashSet<&str> = HashSet::new();
|
|
2487
|
+
/// assert_eq!(set.entry("poneyland").get(), &"poneyland");
|
|
2488
|
+
/// ```
|
|
2489
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2490
|
+
pub fn get(&self) -> &T {
|
|
2491
|
+
self.inner.key()
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
/// Take ownership of the value.
|
|
2495
|
+
///
|
|
2496
|
+
/// # Examples
|
|
2497
|
+
///
|
|
2498
|
+
/// ```
|
|
2499
|
+
/// use hashbrown::hash_set::{Entry, HashSet};
|
|
2500
|
+
///
|
|
2501
|
+
/// let mut set: HashSet<&str> = HashSet::new();
|
|
2502
|
+
///
|
|
2503
|
+
/// match set.entry("poneyland") {
|
|
2504
|
+
/// Entry::Occupied(_) => panic!(),
|
|
2505
|
+
/// Entry::Vacant(v) => assert_eq!(v.into_value(), "poneyland"),
|
|
2506
|
+
/// }
|
|
2507
|
+
/// ```
|
|
2508
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2509
|
+
pub fn into_value(self) -> T {
|
|
2510
|
+
self.inner.into_key()
|
|
2511
|
+
}
|
|
2512
|
+
|
|
2513
|
+
/// Sets the value of the entry with the `VacantEntry`'s value.
|
|
2514
|
+
///
|
|
2515
|
+
/// # Examples
|
|
2516
|
+
///
|
|
2517
|
+
/// ```
|
|
2518
|
+
/// use hashbrown::HashSet;
|
|
2519
|
+
/// use hashbrown::hash_set::Entry;
|
|
2520
|
+
///
|
|
2521
|
+
/// let mut set: HashSet<&str> = HashSet::new();
|
|
2522
|
+
///
|
|
2523
|
+
/// if let Entry::Vacant(o) = set.entry("poneyland") {
|
|
2524
|
+
/// o.insert();
|
|
2525
|
+
/// }
|
|
2526
|
+
/// assert!(set.contains("poneyland"));
|
|
2527
|
+
/// ```
|
|
2528
|
+
#[cfg_attr(feature = "inline-more", inline)]
|
|
2529
|
+
pub fn insert(self) -> OccupiedEntry<'a, T, S, A>
|
|
2530
|
+
where
|
|
2531
|
+
T: Hash,
|
|
2532
|
+
S: BuildHasher,
|
|
2533
|
+
{
|
|
2534
|
+
OccupiedEntry {
|
|
2535
|
+
inner: self.inner.insert_entry(()),
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
#[allow(dead_code)]
|
|
2541
|
+
fn assert_covariance() {
|
|
2542
|
+
fn set<'new>(v: HashSet<&'static str>) -> HashSet<&'new str> {
|
|
2543
|
+
v
|
|
2544
|
+
}
|
|
2545
|
+
fn iter<'a, 'new>(v: Iter<'a, &'static str>) -> Iter<'a, &'new str> {
|
|
2546
|
+
v
|
|
2547
|
+
}
|
|
2548
|
+
fn into_iter<'new, A: Allocator>(v: IntoIter<&'static str, A>) -> IntoIter<&'new str, A> {
|
|
2549
|
+
v
|
|
2550
|
+
}
|
|
2551
|
+
fn difference<'a, 'new, A: Allocator>(
|
|
2552
|
+
v: Difference<'a, &'static str, DefaultHashBuilder, A>,
|
|
2553
|
+
) -> Difference<'a, &'new str, DefaultHashBuilder, A> {
|
|
2554
|
+
v
|
|
2555
|
+
}
|
|
2556
|
+
fn symmetric_difference<'a, 'new, A: Allocator>(
|
|
2557
|
+
v: SymmetricDifference<'a, &'static str, DefaultHashBuilder, A>,
|
|
2558
|
+
) -> SymmetricDifference<'a, &'new str, DefaultHashBuilder, A> {
|
|
2559
|
+
v
|
|
2560
|
+
}
|
|
2561
|
+
fn intersection<'a, 'new, A: Allocator>(
|
|
2562
|
+
v: Intersection<'a, &'static str, DefaultHashBuilder, A>,
|
|
2563
|
+
) -> Intersection<'a, &'new str, DefaultHashBuilder, A> {
|
|
2564
|
+
v
|
|
2565
|
+
}
|
|
2566
|
+
fn union<'a, 'new, A: Allocator>(
|
|
2567
|
+
v: Union<'a, &'static str, DefaultHashBuilder, A>,
|
|
2568
|
+
) -> Union<'a, &'new str, DefaultHashBuilder, A> {
|
|
2569
|
+
v
|
|
2570
|
+
}
|
|
2571
|
+
fn drain<'new, A: Allocator>(d: Drain<'static, &'static str, A>) -> Drain<'new, &'new str, A> {
|
|
2572
|
+
d
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
|
|
2576
|
+
#[cfg(test)]
|
|
2577
|
+
mod test_set {
|
|
2578
|
+
use super::{make_hash, Equivalent, HashSet};
|
|
2579
|
+
use crate::DefaultHashBuilder;
|
|
2580
|
+
use std::vec::Vec;
|
|
2581
|
+
|
|
2582
|
+
#[test]
|
|
2583
|
+
fn test_zero_capacities() {
|
|
2584
|
+
type HS = HashSet<i32>;
|
|
2585
|
+
|
|
2586
|
+
let s = HS::new();
|
|
2587
|
+
assert_eq!(s.capacity(), 0);
|
|
2588
|
+
|
|
2589
|
+
let s = HS::default();
|
|
2590
|
+
assert_eq!(s.capacity(), 0);
|
|
2591
|
+
|
|
2592
|
+
let s = HS::with_hasher(DefaultHashBuilder::default());
|
|
2593
|
+
assert_eq!(s.capacity(), 0);
|
|
2594
|
+
|
|
2595
|
+
let s = HS::with_capacity(0);
|
|
2596
|
+
assert_eq!(s.capacity(), 0);
|
|
2597
|
+
|
|
2598
|
+
let s = HS::with_capacity_and_hasher(0, DefaultHashBuilder::default());
|
|
2599
|
+
assert_eq!(s.capacity(), 0);
|
|
2600
|
+
|
|
2601
|
+
let mut s = HS::new();
|
|
2602
|
+
s.insert(1);
|
|
2603
|
+
s.insert(2);
|
|
2604
|
+
s.remove(&1);
|
|
2605
|
+
s.remove(&2);
|
|
2606
|
+
s.shrink_to_fit();
|
|
2607
|
+
assert_eq!(s.capacity(), 0);
|
|
2608
|
+
|
|
2609
|
+
let mut s = HS::new();
|
|
2610
|
+
s.reserve(0);
|
|
2611
|
+
assert_eq!(s.capacity(), 0);
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
#[test]
|
|
2615
|
+
fn test_disjoint() {
|
|
2616
|
+
let mut xs = HashSet::new();
|
|
2617
|
+
let mut ys = HashSet::new();
|
|
2618
|
+
assert!(xs.is_disjoint(&ys));
|
|
2619
|
+
assert!(ys.is_disjoint(&xs));
|
|
2620
|
+
assert!(xs.insert(5));
|
|
2621
|
+
assert!(ys.insert(11));
|
|
2622
|
+
assert!(xs.is_disjoint(&ys));
|
|
2623
|
+
assert!(ys.is_disjoint(&xs));
|
|
2624
|
+
assert!(xs.insert(7));
|
|
2625
|
+
assert!(xs.insert(19));
|
|
2626
|
+
assert!(xs.insert(4));
|
|
2627
|
+
assert!(ys.insert(2));
|
|
2628
|
+
assert!(ys.insert(-11));
|
|
2629
|
+
assert!(xs.is_disjoint(&ys));
|
|
2630
|
+
assert!(ys.is_disjoint(&xs));
|
|
2631
|
+
assert!(ys.insert(7));
|
|
2632
|
+
assert!(!xs.is_disjoint(&ys));
|
|
2633
|
+
assert!(!ys.is_disjoint(&xs));
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2636
|
+
#[test]
|
|
2637
|
+
fn test_subset_and_superset() {
|
|
2638
|
+
let mut a = HashSet::new();
|
|
2639
|
+
assert!(a.insert(0));
|
|
2640
|
+
assert!(a.insert(5));
|
|
2641
|
+
assert!(a.insert(11));
|
|
2642
|
+
assert!(a.insert(7));
|
|
2643
|
+
|
|
2644
|
+
let mut b = HashSet::new();
|
|
2645
|
+
assert!(b.insert(0));
|
|
2646
|
+
assert!(b.insert(7));
|
|
2647
|
+
assert!(b.insert(19));
|
|
2648
|
+
assert!(b.insert(250));
|
|
2649
|
+
assert!(b.insert(11));
|
|
2650
|
+
assert!(b.insert(200));
|
|
2651
|
+
|
|
2652
|
+
assert!(!a.is_subset(&b));
|
|
2653
|
+
assert!(!a.is_superset(&b));
|
|
2654
|
+
assert!(!b.is_subset(&a));
|
|
2655
|
+
assert!(!b.is_superset(&a));
|
|
2656
|
+
|
|
2657
|
+
assert!(b.insert(5));
|
|
2658
|
+
|
|
2659
|
+
assert!(a.is_subset(&b));
|
|
2660
|
+
assert!(!a.is_superset(&b));
|
|
2661
|
+
assert!(!b.is_subset(&a));
|
|
2662
|
+
assert!(b.is_superset(&a));
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2665
|
+
#[test]
|
|
2666
|
+
fn test_iterate() {
|
|
2667
|
+
let mut a = HashSet::new();
|
|
2668
|
+
for i in 0..32 {
|
|
2669
|
+
assert!(a.insert(i));
|
|
2670
|
+
}
|
|
2671
|
+
let mut observed: u32 = 0;
|
|
2672
|
+
for k in &a {
|
|
2673
|
+
observed |= 1 << *k;
|
|
2674
|
+
}
|
|
2675
|
+
assert_eq!(observed, 0xFFFF_FFFF);
|
|
2676
|
+
}
|
|
2677
|
+
|
|
2678
|
+
#[test]
|
|
2679
|
+
fn test_intersection() {
|
|
2680
|
+
let mut a = HashSet::new();
|
|
2681
|
+
let mut b = HashSet::new();
|
|
2682
|
+
|
|
2683
|
+
assert!(a.insert(11));
|
|
2684
|
+
assert!(a.insert(1));
|
|
2685
|
+
assert!(a.insert(3));
|
|
2686
|
+
assert!(a.insert(77));
|
|
2687
|
+
assert!(a.insert(103));
|
|
2688
|
+
assert!(a.insert(5));
|
|
2689
|
+
assert!(a.insert(-5));
|
|
2690
|
+
|
|
2691
|
+
assert!(b.insert(2));
|
|
2692
|
+
assert!(b.insert(11));
|
|
2693
|
+
assert!(b.insert(77));
|
|
2694
|
+
assert!(b.insert(-9));
|
|
2695
|
+
assert!(b.insert(-42));
|
|
2696
|
+
assert!(b.insert(5));
|
|
2697
|
+
assert!(b.insert(3));
|
|
2698
|
+
|
|
2699
|
+
let mut i = 0;
|
|
2700
|
+
let expected = [3, 5, 11, 77];
|
|
2701
|
+
for x in a.intersection(&b) {
|
|
2702
|
+
assert!(expected.contains(x));
|
|
2703
|
+
i += 1;
|
|
2704
|
+
}
|
|
2705
|
+
assert_eq!(i, expected.len());
|
|
2706
|
+
}
|
|
2707
|
+
|
|
2708
|
+
#[test]
|
|
2709
|
+
fn test_difference() {
|
|
2710
|
+
let mut a = HashSet::new();
|
|
2711
|
+
let mut b = HashSet::new();
|
|
2712
|
+
|
|
2713
|
+
assert!(a.insert(1));
|
|
2714
|
+
assert!(a.insert(3));
|
|
2715
|
+
assert!(a.insert(5));
|
|
2716
|
+
assert!(a.insert(9));
|
|
2717
|
+
assert!(a.insert(11));
|
|
2718
|
+
|
|
2719
|
+
assert!(b.insert(3));
|
|
2720
|
+
assert!(b.insert(9));
|
|
2721
|
+
|
|
2722
|
+
let mut i = 0;
|
|
2723
|
+
let expected = [1, 5, 11];
|
|
2724
|
+
for x in a.difference(&b) {
|
|
2725
|
+
assert!(expected.contains(x));
|
|
2726
|
+
i += 1;
|
|
2727
|
+
}
|
|
2728
|
+
assert_eq!(i, expected.len());
|
|
2729
|
+
}
|
|
2730
|
+
|
|
2731
|
+
#[test]
|
|
2732
|
+
fn test_symmetric_difference() {
|
|
2733
|
+
let mut a = HashSet::new();
|
|
2734
|
+
let mut b = HashSet::new();
|
|
2735
|
+
|
|
2736
|
+
assert!(a.insert(1));
|
|
2737
|
+
assert!(a.insert(3));
|
|
2738
|
+
assert!(a.insert(5));
|
|
2739
|
+
assert!(a.insert(9));
|
|
2740
|
+
assert!(a.insert(11));
|
|
2741
|
+
|
|
2742
|
+
assert!(b.insert(-2));
|
|
2743
|
+
assert!(b.insert(3));
|
|
2744
|
+
assert!(b.insert(9));
|
|
2745
|
+
assert!(b.insert(14));
|
|
2746
|
+
assert!(b.insert(22));
|
|
2747
|
+
|
|
2748
|
+
let mut i = 0;
|
|
2749
|
+
let expected = [-2, 1, 5, 11, 14, 22];
|
|
2750
|
+
for x in a.symmetric_difference(&b) {
|
|
2751
|
+
assert!(expected.contains(x));
|
|
2752
|
+
i += 1;
|
|
2753
|
+
}
|
|
2754
|
+
assert_eq!(i, expected.len());
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2757
|
+
#[test]
|
|
2758
|
+
fn test_sub_assign() {
|
|
2759
|
+
let mut a: HashSet<_> = vec![1, 2, 3, 4, 5].into_iter().collect();
|
|
2760
|
+
let b: HashSet<_> = vec![4, 5, 6].into_iter().collect();
|
|
2761
|
+
|
|
2762
|
+
a -= &b;
|
|
2763
|
+
|
|
2764
|
+
let mut i = 0;
|
|
2765
|
+
let expected = [1, 2, 3];
|
|
2766
|
+
for x in &a {
|
|
2767
|
+
assert!(expected.contains(x));
|
|
2768
|
+
i += 1;
|
|
2769
|
+
}
|
|
2770
|
+
assert_eq!(i, expected.len());
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
#[test]
|
|
2774
|
+
fn test_union() {
|
|
2775
|
+
let mut a = HashSet::new();
|
|
2776
|
+
let mut b = HashSet::new();
|
|
2777
|
+
|
|
2778
|
+
assert!(a.insert(1));
|
|
2779
|
+
assert!(a.insert(3));
|
|
2780
|
+
assert!(a.insert(5));
|
|
2781
|
+
assert!(a.insert(9));
|
|
2782
|
+
assert!(a.insert(11));
|
|
2783
|
+
assert!(a.insert(16));
|
|
2784
|
+
assert!(a.insert(19));
|
|
2785
|
+
assert!(a.insert(24));
|
|
2786
|
+
|
|
2787
|
+
assert!(b.insert(-2));
|
|
2788
|
+
assert!(b.insert(1));
|
|
2789
|
+
assert!(b.insert(5));
|
|
2790
|
+
assert!(b.insert(9));
|
|
2791
|
+
assert!(b.insert(13));
|
|
2792
|
+
assert!(b.insert(19));
|
|
2793
|
+
|
|
2794
|
+
let mut i = 0;
|
|
2795
|
+
let expected = [-2, 1, 3, 5, 9, 11, 13, 16, 19, 24];
|
|
2796
|
+
for x in a.union(&b) {
|
|
2797
|
+
assert!(expected.contains(x));
|
|
2798
|
+
i += 1;
|
|
2799
|
+
}
|
|
2800
|
+
assert_eq!(i, expected.len());
|
|
2801
|
+
}
|
|
2802
|
+
|
|
2803
|
+
#[test]
|
|
2804
|
+
fn test_from_map() {
|
|
2805
|
+
let mut a = crate::HashMap::new();
|
|
2806
|
+
a.insert(1, ());
|
|
2807
|
+
a.insert(2, ());
|
|
2808
|
+
a.insert(3, ());
|
|
2809
|
+
a.insert(4, ());
|
|
2810
|
+
|
|
2811
|
+
let a: HashSet<_> = a.into();
|
|
2812
|
+
|
|
2813
|
+
assert_eq!(a.len(), 4);
|
|
2814
|
+
assert!(a.contains(&1));
|
|
2815
|
+
assert!(a.contains(&2));
|
|
2816
|
+
assert!(a.contains(&3));
|
|
2817
|
+
assert!(a.contains(&4));
|
|
2818
|
+
}
|
|
2819
|
+
|
|
2820
|
+
#[test]
|
|
2821
|
+
fn test_from_iter() {
|
|
2822
|
+
let xs = [1, 2, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
2823
|
+
|
|
2824
|
+
let set: HashSet<_> = xs.iter().copied().collect();
|
|
2825
|
+
|
|
2826
|
+
for x in &xs {
|
|
2827
|
+
assert!(set.contains(x));
|
|
2828
|
+
}
|
|
2829
|
+
|
|
2830
|
+
assert_eq!(set.iter().len(), xs.len() - 1);
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2833
|
+
#[test]
|
|
2834
|
+
fn test_move_iter() {
|
|
2835
|
+
let hs = {
|
|
2836
|
+
let mut hs = HashSet::new();
|
|
2837
|
+
|
|
2838
|
+
hs.insert('a');
|
|
2839
|
+
hs.insert('b');
|
|
2840
|
+
|
|
2841
|
+
hs
|
|
2842
|
+
};
|
|
2843
|
+
|
|
2844
|
+
let v = hs.into_iter().collect::<Vec<char>>();
|
|
2845
|
+
assert!(v == ['a', 'b'] || v == ['b', 'a']);
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2848
|
+
#[test]
|
|
2849
|
+
fn test_eq() {
|
|
2850
|
+
// These constants once happened to expose a bug in insert().
|
|
2851
|
+
// I'm keeping them around to prevent a regression.
|
|
2852
|
+
let mut s1 = HashSet::new();
|
|
2853
|
+
|
|
2854
|
+
s1.insert(1);
|
|
2855
|
+
s1.insert(2);
|
|
2856
|
+
s1.insert(3);
|
|
2857
|
+
|
|
2858
|
+
let mut s2 = HashSet::new();
|
|
2859
|
+
|
|
2860
|
+
s2.insert(1);
|
|
2861
|
+
s2.insert(2);
|
|
2862
|
+
|
|
2863
|
+
assert!(s1 != s2);
|
|
2864
|
+
|
|
2865
|
+
s2.insert(3);
|
|
2866
|
+
|
|
2867
|
+
assert_eq!(s1, s2);
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
#[test]
|
|
2871
|
+
fn test_show() {
|
|
2872
|
+
let mut set = HashSet::new();
|
|
2873
|
+
let empty = HashSet::<i32>::new();
|
|
2874
|
+
|
|
2875
|
+
set.insert(1);
|
|
2876
|
+
set.insert(2);
|
|
2877
|
+
|
|
2878
|
+
let set_str = format!("{set:?}");
|
|
2879
|
+
|
|
2880
|
+
assert!(set_str == "{1, 2}" || set_str == "{2, 1}");
|
|
2881
|
+
assert_eq!(format!("{empty:?}"), "{}");
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
#[test]
|
|
2885
|
+
fn test_trivial_drain() {
|
|
2886
|
+
let mut s = HashSet::<i32>::new();
|
|
2887
|
+
for _ in s.drain() {}
|
|
2888
|
+
assert!(s.is_empty());
|
|
2889
|
+
drop(s);
|
|
2890
|
+
|
|
2891
|
+
let mut s = HashSet::<i32>::new();
|
|
2892
|
+
drop(s.drain());
|
|
2893
|
+
assert!(s.is_empty());
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
#[test]
|
|
2897
|
+
fn test_drain() {
|
|
2898
|
+
let mut s: HashSet<_> = (1..100).collect();
|
|
2899
|
+
|
|
2900
|
+
// try this a bunch of times to make sure we don't screw up internal state.
|
|
2901
|
+
for _ in 0..20 {
|
|
2902
|
+
assert_eq!(s.len(), 99);
|
|
2903
|
+
|
|
2904
|
+
{
|
|
2905
|
+
let mut last_i = 0;
|
|
2906
|
+
let mut d = s.drain();
|
|
2907
|
+
for (i, x) in d.by_ref().take(50).enumerate() {
|
|
2908
|
+
last_i = i;
|
|
2909
|
+
assert!(x != 0);
|
|
2910
|
+
}
|
|
2911
|
+
assert_eq!(last_i, 49);
|
|
2912
|
+
}
|
|
2913
|
+
|
|
2914
|
+
if !s.is_empty() {
|
|
2915
|
+
panic!("s should be empty!");
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
// reset to try again.
|
|
2919
|
+
s.extend(1..100);
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
#[test]
|
|
2924
|
+
fn test_replace() {
|
|
2925
|
+
use core::hash;
|
|
2926
|
+
|
|
2927
|
+
#[derive(Debug)]
|
|
2928
|
+
#[allow(dead_code)]
|
|
2929
|
+
struct Foo(&'static str, i32);
|
|
2930
|
+
|
|
2931
|
+
impl PartialEq for Foo {
|
|
2932
|
+
fn eq(&self, other: &Self) -> bool {
|
|
2933
|
+
self.0 == other.0
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2937
|
+
impl Eq for Foo {}
|
|
2938
|
+
|
|
2939
|
+
impl hash::Hash for Foo {
|
|
2940
|
+
fn hash<H: hash::Hasher>(&self, h: &mut H) {
|
|
2941
|
+
self.0.hash(h);
|
|
2942
|
+
}
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2945
|
+
let mut s = HashSet::new();
|
|
2946
|
+
assert_eq!(s.replace(Foo("a", 1)), None);
|
|
2947
|
+
assert_eq!(s.len(), 1);
|
|
2948
|
+
assert_eq!(s.replace(Foo("a", 2)), Some(Foo("a", 1)));
|
|
2949
|
+
assert_eq!(s.len(), 1);
|
|
2950
|
+
|
|
2951
|
+
let mut it = s.iter();
|
|
2952
|
+
assert_eq!(it.next(), Some(&Foo("a", 2)));
|
|
2953
|
+
assert_eq!(it.next(), None);
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
#[test]
|
|
2957
|
+
#[allow(clippy::needless_borrow)]
|
|
2958
|
+
fn test_extend_ref() {
|
|
2959
|
+
let mut a = HashSet::new();
|
|
2960
|
+
a.insert(1);
|
|
2961
|
+
|
|
2962
|
+
a.extend([2, 3, 4]);
|
|
2963
|
+
|
|
2964
|
+
assert_eq!(a.len(), 4);
|
|
2965
|
+
assert!(a.contains(&1));
|
|
2966
|
+
assert!(a.contains(&2));
|
|
2967
|
+
assert!(a.contains(&3));
|
|
2968
|
+
assert!(a.contains(&4));
|
|
2969
|
+
|
|
2970
|
+
let mut b = HashSet::new();
|
|
2971
|
+
b.insert(5);
|
|
2972
|
+
b.insert(6);
|
|
2973
|
+
|
|
2974
|
+
a.extend(&b);
|
|
2975
|
+
|
|
2976
|
+
assert_eq!(a.len(), 6);
|
|
2977
|
+
assert!(a.contains(&1));
|
|
2978
|
+
assert!(a.contains(&2));
|
|
2979
|
+
assert!(a.contains(&3));
|
|
2980
|
+
assert!(a.contains(&4));
|
|
2981
|
+
assert!(a.contains(&5));
|
|
2982
|
+
assert!(a.contains(&6));
|
|
2983
|
+
}
|
|
2984
|
+
|
|
2985
|
+
#[test]
|
|
2986
|
+
fn test_retain() {
|
|
2987
|
+
let xs = [1, 2, 3, 4, 5, 6];
|
|
2988
|
+
let mut set: HashSet<i32> = xs.iter().copied().collect();
|
|
2989
|
+
set.retain(|&k| k % 2 == 0);
|
|
2990
|
+
assert_eq!(set.len(), 3);
|
|
2991
|
+
assert!(set.contains(&2));
|
|
2992
|
+
assert!(set.contains(&4));
|
|
2993
|
+
assert!(set.contains(&6));
|
|
2994
|
+
}
|
|
2995
|
+
|
|
2996
|
+
#[test]
|
|
2997
|
+
fn test_extract_if() {
|
|
2998
|
+
{
|
|
2999
|
+
let mut set: HashSet<i32> = (0..8).collect();
|
|
3000
|
+
let drained = set.extract_if(|&k| k % 2 == 0);
|
|
3001
|
+
let mut out = drained.collect::<Vec<_>>();
|
|
3002
|
+
out.sort_unstable();
|
|
3003
|
+
assert_eq!(vec![0, 2, 4, 6], out);
|
|
3004
|
+
assert_eq!(set.len(), 4);
|
|
3005
|
+
}
|
|
3006
|
+
{
|
|
3007
|
+
let mut set: HashSet<i32> = (0..8).collect();
|
|
3008
|
+
set.extract_if(|&k| k % 2 == 0).for_each(drop);
|
|
3009
|
+
assert_eq!(set.len(), 4, "Removes non-matching items on drop");
|
|
3010
|
+
}
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
#[test]
|
|
3014
|
+
fn test_const_with_hasher() {
|
|
3015
|
+
use core::hash::BuildHasher;
|
|
3016
|
+
use std::collections::hash_map::DefaultHasher;
|
|
3017
|
+
|
|
3018
|
+
#[derive(Clone)]
|
|
3019
|
+
struct MyHasher;
|
|
3020
|
+
impl BuildHasher for MyHasher {
|
|
3021
|
+
type Hasher = DefaultHasher;
|
|
3022
|
+
|
|
3023
|
+
fn build_hasher(&self) -> DefaultHasher {
|
|
3024
|
+
DefaultHasher::new()
|
|
3025
|
+
}
|
|
3026
|
+
}
|
|
3027
|
+
|
|
3028
|
+
const EMPTY_SET: HashSet<u32, MyHasher> = HashSet::with_hasher(MyHasher);
|
|
3029
|
+
|
|
3030
|
+
let mut set = EMPTY_SET;
|
|
3031
|
+
set.insert(19);
|
|
3032
|
+
assert!(set.contains(&19));
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
#[test]
|
|
3036
|
+
fn rehash_in_place() {
|
|
3037
|
+
let mut set = HashSet::new();
|
|
3038
|
+
|
|
3039
|
+
for i in 0..224 {
|
|
3040
|
+
set.insert(i);
|
|
3041
|
+
}
|
|
3042
|
+
|
|
3043
|
+
assert_eq!(
|
|
3044
|
+
set.capacity(),
|
|
3045
|
+
224,
|
|
3046
|
+
"The set must be at or close to capacity to trigger a re hashing"
|
|
3047
|
+
);
|
|
3048
|
+
|
|
3049
|
+
for i in 100..1400 {
|
|
3050
|
+
set.remove(&(i - 100));
|
|
3051
|
+
set.insert(i);
|
|
3052
|
+
}
|
|
3053
|
+
}
|
|
3054
|
+
|
|
3055
|
+
#[test]
|
|
3056
|
+
fn collect() {
|
|
3057
|
+
// At the time of writing, this hits the ZST case in from_base_index
|
|
3058
|
+
// (and without the `map`, it does not).
|
|
3059
|
+
let mut _set: HashSet<_> = (0..3).map(|_| ()).collect();
|
|
3060
|
+
}
|
|
3061
|
+
|
|
3062
|
+
#[test]
|
|
3063
|
+
fn test_allocation_info() {
|
|
3064
|
+
assert_eq!(HashSet::<()>::new().allocation_size(), 0);
|
|
3065
|
+
assert_eq!(HashSet::<u32>::new().allocation_size(), 0);
|
|
3066
|
+
assert!(HashSet::<u32>::with_capacity(1).allocation_size() > core::mem::size_of::<u32>());
|
|
3067
|
+
}
|
|
3068
|
+
|
|
3069
|
+
#[test]
|
|
3070
|
+
fn duplicate_insert() {
|
|
3071
|
+
let mut set = HashSet::new();
|
|
3072
|
+
set.insert(1);
|
|
3073
|
+
set.get_or_insert_with(&1, |_| 1);
|
|
3074
|
+
set.get_or_insert_with(&1, |_| 1);
|
|
3075
|
+
assert!([1].iter().eq(set.iter()));
|
|
3076
|
+
}
|
|
3077
|
+
|
|
3078
|
+
#[test]
|
|
3079
|
+
#[should_panic]
|
|
3080
|
+
fn some_invalid_equivalent() {
|
|
3081
|
+
use core::hash::{Hash, Hasher};
|
|
3082
|
+
struct Invalid {
|
|
3083
|
+
count: u32,
|
|
3084
|
+
other: u32,
|
|
3085
|
+
}
|
|
3086
|
+
|
|
3087
|
+
struct InvalidRef {
|
|
3088
|
+
count: u32,
|
|
3089
|
+
other: u32,
|
|
3090
|
+
}
|
|
3091
|
+
|
|
3092
|
+
impl PartialEq for Invalid {
|
|
3093
|
+
fn eq(&self, other: &Self) -> bool {
|
|
3094
|
+
self.count == other.count && self.other == other.other
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
3097
|
+
impl Eq for Invalid {}
|
|
3098
|
+
|
|
3099
|
+
impl Equivalent<Invalid> for InvalidRef {
|
|
3100
|
+
fn equivalent(&self, key: &Invalid) -> bool {
|
|
3101
|
+
self.count == key.count && self.other == key.other
|
|
3102
|
+
}
|
|
3103
|
+
}
|
|
3104
|
+
impl Hash for Invalid {
|
|
3105
|
+
fn hash<H: Hasher>(&self, state: &mut H) {
|
|
3106
|
+
self.count.hash(state);
|
|
3107
|
+
}
|
|
3108
|
+
}
|
|
3109
|
+
impl Hash for InvalidRef {
|
|
3110
|
+
fn hash<H: Hasher>(&self, state: &mut H) {
|
|
3111
|
+
self.count.hash(state);
|
|
3112
|
+
}
|
|
3113
|
+
}
|
|
3114
|
+
let mut set: HashSet<Invalid> = HashSet::new();
|
|
3115
|
+
let key = InvalidRef { count: 1, other: 1 };
|
|
3116
|
+
let value = Invalid { count: 1, other: 2 };
|
|
3117
|
+
if make_hash(set.hasher(), &key) == make_hash(set.hasher(), &value) {
|
|
3118
|
+
set.get_or_insert_with(&key, |_| value);
|
|
3119
|
+
}
|
|
3120
|
+
}
|
|
3121
|
+
}
|