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,2679 @@
|
|
|
1
|
+
use crate::encoding::{Instance, Item, LibraryInfo, MainOrAdapter, ModuleImportMap};
|
|
2
|
+
use crate::{ComponentEncoder, StringEncoding};
|
|
3
|
+
use anyhow::{Context, Result, anyhow, bail};
|
|
4
|
+
use indexmap::{IndexMap, IndexSet, map::Entry};
|
|
5
|
+
use std::fmt;
|
|
6
|
+
use std::hash::Hash;
|
|
7
|
+
use std::mem;
|
|
8
|
+
use wasm_encoder::ExportKind;
|
|
9
|
+
use wasmparser::names::{ComponentName, ComponentNameKind};
|
|
10
|
+
use wasmparser::{
|
|
11
|
+
Encoding, ExternalKind, FuncType, Parser, Payload, TypeRef, ValType, ValidPayload, Validator,
|
|
12
|
+
WasmFeatures, types::TypesRef,
|
|
13
|
+
};
|
|
14
|
+
use wit_parser::{
|
|
15
|
+
Function, InterfaceId, PackageName, Resolve, Type, TypeDefKind, TypeId, World, WorldId,
|
|
16
|
+
WorldItem, WorldKey,
|
|
17
|
+
abi::{AbiVariant, WasmSignature, WasmType},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
fn wasm_sig_to_func_type(signature: WasmSignature) -> FuncType {
|
|
21
|
+
fn from_wasm_type(ty: &WasmType) -> ValType {
|
|
22
|
+
match ty {
|
|
23
|
+
WasmType::I32 => ValType::I32,
|
|
24
|
+
WasmType::I64 => ValType::I64,
|
|
25
|
+
WasmType::F32 => ValType::F32,
|
|
26
|
+
WasmType::F64 => ValType::F64,
|
|
27
|
+
WasmType::Pointer => ValType::I32,
|
|
28
|
+
WasmType::PointerOrI64 => ValType::I64,
|
|
29
|
+
WasmType::Length => ValType::I32,
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
FuncType::new(
|
|
34
|
+
signature.params.iter().map(from_wasm_type),
|
|
35
|
+
signature.results.iter().map(from_wasm_type),
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/// Metadata about a validated module and what was found internally.
|
|
40
|
+
///
|
|
41
|
+
/// This structure houses information about `imports` and `exports` to the
|
|
42
|
+
/// module. Each of these specialized types contains "connection" information
|
|
43
|
+
/// between a module's imports/exports and the WIT or component-level constructs
|
|
44
|
+
/// they correspond to.
|
|
45
|
+
|
|
46
|
+
#[derive(Default)]
|
|
47
|
+
pub struct ValidatedModule {
|
|
48
|
+
/// Information about a module's imports.
|
|
49
|
+
pub imports: ImportMap,
|
|
50
|
+
|
|
51
|
+
/// Information about a module's exports.
|
|
52
|
+
pub exports: ExportMap,
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
impl ValidatedModule {
|
|
56
|
+
fn new(
|
|
57
|
+
encoder: &ComponentEncoder,
|
|
58
|
+
bytes: &[u8],
|
|
59
|
+
exports: &IndexSet<WorldKey>,
|
|
60
|
+
import_map: Option<&ModuleImportMap>,
|
|
61
|
+
info: Option<&LibraryInfo>,
|
|
62
|
+
) -> Result<ValidatedModule> {
|
|
63
|
+
let mut validator = Validator::new_with_features(WasmFeatures::all());
|
|
64
|
+
let mut ret = ValidatedModule::default();
|
|
65
|
+
|
|
66
|
+
for payload in Parser::new(0).parse_all(bytes) {
|
|
67
|
+
let payload = payload?;
|
|
68
|
+
if let ValidPayload::End(_) = validator.payload(&payload)? {
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
let types = validator.types(0).unwrap();
|
|
73
|
+
|
|
74
|
+
match payload {
|
|
75
|
+
Payload::Version { encoding, .. } if encoding != Encoding::Module => {
|
|
76
|
+
bail!("data is not a WebAssembly module");
|
|
77
|
+
}
|
|
78
|
+
Payload::ImportSection(s) => {
|
|
79
|
+
for import in s.into_imports() {
|
|
80
|
+
let import = import?;
|
|
81
|
+
ret.imports.add(import, encoder, import_map, info, types)?;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
Payload::ExportSection(s) => {
|
|
85
|
+
for export in s {
|
|
86
|
+
let export = export?;
|
|
87
|
+
ret.exports.add(export, encoder, &exports, types)?;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
_ => continue,
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
ret.exports.validate(encoder, exports)?;
|
|
95
|
+
|
|
96
|
+
Ok(ret)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/// Metadata information about a module's imports.
|
|
101
|
+
///
|
|
102
|
+
/// This structure maintains the connection between component model "things" and
|
|
103
|
+
/// core wasm "things" by ensuring that all imports to the core wasm module are
|
|
104
|
+
/// classified by the `Import` enumeration.
|
|
105
|
+
#[derive(Default)]
|
|
106
|
+
pub struct ImportMap {
|
|
107
|
+
/// The first level of the map here is the module namespace of the import
|
|
108
|
+
/// and the second level of the map is the field namespace. The item is then
|
|
109
|
+
/// how the import is satisfied.
|
|
110
|
+
names: IndexMap<String, ImportInstance>,
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
pub enum ImportInstance {
|
|
114
|
+
/// This import is satisfied by an entire instance of another
|
|
115
|
+
/// adapter/module.
|
|
116
|
+
Whole(MainOrAdapter),
|
|
117
|
+
|
|
118
|
+
/// This import is satisfied by filling out each name possibly differently.
|
|
119
|
+
Names(IndexMap<String, Import>),
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/// Represents metadata about a `stream<T>` or `future<T>` type for a specific
|
|
123
|
+
/// payload type `T`.
|
|
124
|
+
///
|
|
125
|
+
/// Currently, the name mangling scheme we use to represent `stream` and
|
|
126
|
+
/// `future` intrinsics as core module function imports refers to a specific
|
|
127
|
+
/// `stream` or `future` type by naming an imported or exported component
|
|
128
|
+
/// function which has that type as a parameter or return type (where the
|
|
129
|
+
/// specific type is referred to using an ordinal numbering scheme). Not only
|
|
130
|
+
/// does this approach unambiguously indicate the type of interest, but it
|
|
131
|
+
/// allows us to reuse the `realloc`, string encoding, memory, etc. used by that
|
|
132
|
+
/// function when emitting intrinsic declarations.
|
|
133
|
+
///
|
|
134
|
+
/// TODO: Rather than reusing the same canon opts as the function in which the
|
|
135
|
+
/// type appears, consider encoding them in the name mangling stream on an
|
|
136
|
+
/// individual basis, similar to how we encode `error-context.*` built-in
|
|
137
|
+
/// imports.
|
|
138
|
+
#[derive(Debug, Eq, PartialEq, Clone, Hash)]
|
|
139
|
+
pub struct PayloadInfo {
|
|
140
|
+
/// The original, mangled import name used to import this built-in
|
|
141
|
+
/// (currently used only for hashing and debugging).
|
|
142
|
+
pub name: String,
|
|
143
|
+
/// The resolved type id for the `stream` or `future` type of interest.
|
|
144
|
+
///
|
|
145
|
+
/// If `Unit{Future,Stream}` this means that it's a "unit" payload or has no associated
|
|
146
|
+
/// type being sent.
|
|
147
|
+
pub ty: PayloadType,
|
|
148
|
+
/// The world key representing the import or export context of `function`.
|
|
149
|
+
pub key: WorldKey,
|
|
150
|
+
/// The interface that `function` was imported from or exported in, if any.
|
|
151
|
+
pub interface: Option<InterfaceId>,
|
|
152
|
+
/// Whether `function` is being imported or exported.
|
|
153
|
+
///
|
|
154
|
+
/// This may affect how we emit the declaration of the built-in, e.g. if the
|
|
155
|
+
/// payload type is an exported resource.
|
|
156
|
+
pub imported: bool,
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/// The type of future/stream referenced by a `PayloadInfo`
|
|
160
|
+
#[derive(Debug, Eq, PartialEq, Clone, Hash)]
|
|
161
|
+
pub enum PayloadType {
|
|
162
|
+
/// This is a future or stream located in a `Resolve` where `id` points to
|
|
163
|
+
/// either of `TypeDefKind::{Future, Stream}`.
|
|
164
|
+
Type {
|
|
165
|
+
id: TypeId,
|
|
166
|
+
/// The component-level function import or export where the type
|
|
167
|
+
/// appeared as a parameter or result type.
|
|
168
|
+
function: String,
|
|
169
|
+
},
|
|
170
|
+
/// This is a `future` (no type)
|
|
171
|
+
UnitFuture,
|
|
172
|
+
/// This is a `stream` (no type)
|
|
173
|
+
UnitStream,
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
impl PayloadInfo {
|
|
177
|
+
/// Returns the payload type that this future/stream type is using.
|
|
178
|
+
pub fn payload(&self, resolve: &Resolve) -> Option<Type> {
|
|
179
|
+
let id = match self.ty {
|
|
180
|
+
PayloadType::Type { id, .. } => id,
|
|
181
|
+
PayloadType::UnitFuture | PayloadType::UnitStream => return None,
|
|
182
|
+
};
|
|
183
|
+
match resolve.types[id].kind {
|
|
184
|
+
TypeDefKind::Future(payload) | TypeDefKind::Stream(payload) => payload,
|
|
185
|
+
_ => unreachable!(),
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/// The different kinds of items that a module or an adapter can import.
|
|
191
|
+
///
|
|
192
|
+
/// This is intended to be an exhaustive definition of what can be imported into
|
|
193
|
+
/// core modules within a component that wit-component supports. This doesn't
|
|
194
|
+
/// get down to the level of storing any idx numbers; at its most specific, it
|
|
195
|
+
/// gives a name.
|
|
196
|
+
#[derive(Debug, Clone)]
|
|
197
|
+
pub enum Import {
|
|
198
|
+
/// A top-level world function, with the name provided here, is imported
|
|
199
|
+
/// into the module.
|
|
200
|
+
WorldFunc(WorldKey, String, AbiVariant),
|
|
201
|
+
|
|
202
|
+
/// An interface's function is imported into the module.
|
|
203
|
+
///
|
|
204
|
+
/// The `WorldKey` here is the name of the interface in the world in
|
|
205
|
+
/// question. The `InterfaceId` is the interface that was imported from and
|
|
206
|
+
/// `String` is the WIT name of the function.
|
|
207
|
+
InterfaceFunc(WorldKey, InterfaceId, String, AbiVariant),
|
|
208
|
+
|
|
209
|
+
/// An imported resource's destructor is imported.
|
|
210
|
+
///
|
|
211
|
+
/// The key provided indicates whether it's for the top-level types of the
|
|
212
|
+
/// world (`None`) or an interface (`Some` with the name of the interface).
|
|
213
|
+
/// The `TypeId` is what resource is being dropped.
|
|
214
|
+
ImportedResourceDrop(WorldKey, Option<InterfaceId>, TypeId),
|
|
215
|
+
|
|
216
|
+
/// A `canon resource.drop` intrinsic for an exported item is being
|
|
217
|
+
/// imported.
|
|
218
|
+
///
|
|
219
|
+
/// This lists the key of the interface that's exporting the resource plus
|
|
220
|
+
/// the id within that interface.
|
|
221
|
+
ExportedResourceDrop(WorldKey, TypeId),
|
|
222
|
+
|
|
223
|
+
/// A `canon resource.new` intrinsic for an exported item is being
|
|
224
|
+
/// imported.
|
|
225
|
+
///
|
|
226
|
+
/// This lists the key of the interface that's exporting the resource plus
|
|
227
|
+
/// the id within that interface.
|
|
228
|
+
ExportedResourceNew(WorldKey, TypeId),
|
|
229
|
+
|
|
230
|
+
/// A `canon resource.rep` intrinsic for an exported item is being
|
|
231
|
+
/// imported.
|
|
232
|
+
///
|
|
233
|
+
/// This lists the key of the interface that's exporting the resource plus
|
|
234
|
+
/// the id within that interface.
|
|
235
|
+
ExportedResourceRep(WorldKey, TypeId),
|
|
236
|
+
|
|
237
|
+
/// An export of an adapter is being imported with the specified type.
|
|
238
|
+
///
|
|
239
|
+
/// This is used for when the main module imports an adapter function. The
|
|
240
|
+
/// adapter name and function name match the module's own import, and the
|
|
241
|
+
/// type must match that listed here.
|
|
242
|
+
AdapterExport {
|
|
243
|
+
adapter: String,
|
|
244
|
+
func: String,
|
|
245
|
+
ty: FuncType,
|
|
246
|
+
},
|
|
247
|
+
|
|
248
|
+
/// An adapter is importing the memory of the main module.
|
|
249
|
+
///
|
|
250
|
+
/// (should be combined with `MainModuleExport` below one day)
|
|
251
|
+
MainModuleMemory,
|
|
252
|
+
|
|
253
|
+
/// An adapter is importing an arbitrary item from the main module.
|
|
254
|
+
MainModuleExport { name: String, kind: ExportKind },
|
|
255
|
+
|
|
256
|
+
/// An arbitrary item from either the main module or an adapter is being
|
|
257
|
+
/// imported.
|
|
258
|
+
///
|
|
259
|
+
/// (should probably subsume `MainModule*` and maybe `AdapterExport` above
|
|
260
|
+
/// one day.
|
|
261
|
+
Item(Item),
|
|
262
|
+
|
|
263
|
+
/// A `canon task.return` intrinsic for an exported function.
|
|
264
|
+
///
|
|
265
|
+
/// This allows an exported function to return a value and then continue
|
|
266
|
+
/// running.
|
|
267
|
+
///
|
|
268
|
+
/// As of this writing, only async-lifted exports use `task.return`, but the
|
|
269
|
+
/// plan is to also support it for sync-lifted exports in the future as
|
|
270
|
+
/// well.
|
|
271
|
+
ExportedTaskReturn(WorldKey, Option<InterfaceId>, String, Option<Type>),
|
|
272
|
+
|
|
273
|
+
/// A `canon task.cancel` intrinsic for an exported function.
|
|
274
|
+
///
|
|
275
|
+
/// This allows an exported function to acknowledge a `CANCELLED` event.
|
|
276
|
+
ExportedTaskCancel,
|
|
277
|
+
|
|
278
|
+
/// The `context.get` intrinsic for the nth slot of storage.
|
|
279
|
+
ContextGet(u32),
|
|
280
|
+
/// The `context.set` intrinsic for the nth slot of storage.
|
|
281
|
+
ContextSet(u32),
|
|
282
|
+
|
|
283
|
+
/// A `canon backpressure.inc` intrinsic.
|
|
284
|
+
BackpressureInc,
|
|
285
|
+
|
|
286
|
+
/// A `canon backpressure.dec` intrinsic.
|
|
287
|
+
BackpressureDec,
|
|
288
|
+
|
|
289
|
+
/// A `waitable-set.new` intrinsic.
|
|
290
|
+
WaitableSetNew,
|
|
291
|
+
|
|
292
|
+
/// A `canon waitable-set.wait` intrinsic.
|
|
293
|
+
///
|
|
294
|
+
/// This allows the guest to wait for any pending calls to async-lowered
|
|
295
|
+
/// imports and/or `stream` and `future` operations to complete without
|
|
296
|
+
/// unwinding the current Wasm stack.
|
|
297
|
+
WaitableSetWait { cancellable: bool },
|
|
298
|
+
|
|
299
|
+
/// A `canon waitable.poll` intrinsic.
|
|
300
|
+
///
|
|
301
|
+
/// This allows the guest to check whether any pending calls to
|
|
302
|
+
/// async-lowered imports and/or `stream` and `future` operations have
|
|
303
|
+
/// completed without unwinding the current Wasm stack and without blocking.
|
|
304
|
+
WaitableSetPoll { cancellable: bool },
|
|
305
|
+
|
|
306
|
+
/// A `waitable-set.drop` intrinsic.
|
|
307
|
+
WaitableSetDrop,
|
|
308
|
+
|
|
309
|
+
/// A `waitable.join` intrinsic.
|
|
310
|
+
WaitableJoin,
|
|
311
|
+
|
|
312
|
+
/// A `canon thread.yield` intrinsic.
|
|
313
|
+
///
|
|
314
|
+
/// This allows the guest to yield (e.g. during an computationally-intensive
|
|
315
|
+
/// operation) and allow other subtasks to make progress.
|
|
316
|
+
ThreadYield { cancellable: bool },
|
|
317
|
+
|
|
318
|
+
/// A `canon subtask.drop` intrinsic.
|
|
319
|
+
///
|
|
320
|
+
/// This allows the guest to release its handle to a completed subtask.
|
|
321
|
+
SubtaskDrop,
|
|
322
|
+
|
|
323
|
+
/// A `canon subtask.cancel` intrinsic.
|
|
324
|
+
///
|
|
325
|
+
/// This allows the guest to cancel an in-progress subtask.
|
|
326
|
+
SubtaskCancel { async_: bool },
|
|
327
|
+
|
|
328
|
+
/// A `canon stream.new` intrinsic.
|
|
329
|
+
///
|
|
330
|
+
/// This allows the guest to create a new `stream` of the specified type.
|
|
331
|
+
StreamNew(PayloadInfo),
|
|
332
|
+
|
|
333
|
+
/// A `canon stream.read` intrinsic.
|
|
334
|
+
///
|
|
335
|
+
/// This allows the guest to read the next values (if any) from the specified
|
|
336
|
+
/// stream.
|
|
337
|
+
StreamRead { async_: bool, info: PayloadInfo },
|
|
338
|
+
|
|
339
|
+
/// A `canon stream.write` intrinsic.
|
|
340
|
+
///
|
|
341
|
+
/// This allows the guest to write one or more values to the specified
|
|
342
|
+
/// stream.
|
|
343
|
+
StreamWrite { async_: bool, info: PayloadInfo },
|
|
344
|
+
|
|
345
|
+
/// A `canon stream.cancel-read` intrinsic.
|
|
346
|
+
///
|
|
347
|
+
/// This allows the guest to cancel a pending read it initiated earlier (but
|
|
348
|
+
/// which may have already partially or entirely completed).
|
|
349
|
+
StreamCancelRead { info: PayloadInfo, async_: bool },
|
|
350
|
+
|
|
351
|
+
/// A `canon stream.cancel-write` intrinsic.
|
|
352
|
+
///
|
|
353
|
+
/// This allows the guest to cancel a pending write it initiated earlier
|
|
354
|
+
/// (but which may have already partially or entirely completed).
|
|
355
|
+
StreamCancelWrite { info: PayloadInfo, async_: bool },
|
|
356
|
+
|
|
357
|
+
/// A `canon stream.drop-readable` intrinsic.
|
|
358
|
+
///
|
|
359
|
+
/// This allows the guest to drop the readable end of a `stream`.
|
|
360
|
+
StreamDropReadable(PayloadInfo),
|
|
361
|
+
|
|
362
|
+
/// A `canon stream.drop-writable` intrinsic.
|
|
363
|
+
///
|
|
364
|
+
/// This allows the guest to drop the writable end of a `stream`.
|
|
365
|
+
StreamDropWritable(PayloadInfo),
|
|
366
|
+
|
|
367
|
+
/// A `canon future.new` intrinsic.
|
|
368
|
+
///
|
|
369
|
+
/// This allows the guest to create a new `future` of the specified type.
|
|
370
|
+
FutureNew(PayloadInfo),
|
|
371
|
+
|
|
372
|
+
/// A `canon future.read` intrinsic.
|
|
373
|
+
///
|
|
374
|
+
/// This allows the guest to read the value (if any) from the specified
|
|
375
|
+
/// future.
|
|
376
|
+
FutureRead { async_: bool, info: PayloadInfo },
|
|
377
|
+
|
|
378
|
+
/// A `canon future.write` intrinsic.
|
|
379
|
+
///
|
|
380
|
+
/// This allows the guest to write a value to the specified future.
|
|
381
|
+
FutureWrite { async_: bool, info: PayloadInfo },
|
|
382
|
+
|
|
383
|
+
/// A `canon future.cancel-read` intrinsic.
|
|
384
|
+
///
|
|
385
|
+
/// This allows the guest to cancel a pending read it initiated earlier (but
|
|
386
|
+
/// which may have already completed).
|
|
387
|
+
FutureCancelRead { info: PayloadInfo, async_: bool },
|
|
388
|
+
|
|
389
|
+
/// A `canon future.cancel-write` intrinsic.
|
|
390
|
+
///
|
|
391
|
+
/// This allows the guest to cancel a pending write it initiated earlier
|
|
392
|
+
/// (but which may have already completed).
|
|
393
|
+
FutureCancelWrite { info: PayloadInfo, async_: bool },
|
|
394
|
+
|
|
395
|
+
/// A `canon future.drop-readable` intrinsic.
|
|
396
|
+
///
|
|
397
|
+
/// This allows the guest to drop the readable end of a `future`.
|
|
398
|
+
FutureDropReadable(PayloadInfo),
|
|
399
|
+
|
|
400
|
+
/// A `canon future.drop-writable` intrinsic.
|
|
401
|
+
///
|
|
402
|
+
/// This allows the guest to drop the writable end of a `future`.
|
|
403
|
+
FutureDropWritable(PayloadInfo),
|
|
404
|
+
|
|
405
|
+
/// A `canon error-context.new` intrinsic.
|
|
406
|
+
///
|
|
407
|
+
/// This allows the guest to create a new `error-context` instance with a
|
|
408
|
+
/// specified debug message.
|
|
409
|
+
ErrorContextNew { encoding: StringEncoding },
|
|
410
|
+
|
|
411
|
+
/// A `canon error-context.debug-message` intrinsic.
|
|
412
|
+
///
|
|
413
|
+
/// This allows the guest to retrieve the debug message from a
|
|
414
|
+
/// `error-context` instance. Note that the content of this message might
|
|
415
|
+
/// not be identical to what was passed in to `error-context.new`.
|
|
416
|
+
ErrorContextDebugMessage { encoding: StringEncoding },
|
|
417
|
+
|
|
418
|
+
/// A `canon error-context.drop` intrinsic.
|
|
419
|
+
///
|
|
420
|
+
/// This allows the guest to release its handle to the specified
|
|
421
|
+
/// `error-context` instance.
|
|
422
|
+
ErrorContextDrop,
|
|
423
|
+
|
|
424
|
+
/// A `canon thread.index` intrinsic.
|
|
425
|
+
///
|
|
426
|
+
/// This allows the guest to get the index of the current thread.
|
|
427
|
+
ThreadIndex,
|
|
428
|
+
|
|
429
|
+
/// A `canon thread.new-indirect` intrinsic.
|
|
430
|
+
///
|
|
431
|
+
/// This allows the guest to create a new thread running a specified function.
|
|
432
|
+
ThreadNewIndirect,
|
|
433
|
+
|
|
434
|
+
/// A `canon thread.switch-to` intrinsic.
|
|
435
|
+
///
|
|
436
|
+
/// This allows the guest to switch execution to another thread.
|
|
437
|
+
ThreadSwitchTo { cancellable: bool },
|
|
438
|
+
|
|
439
|
+
/// A `canon thread.suspend` intrinsic.
|
|
440
|
+
///
|
|
441
|
+
/// This allows the guest to suspend the current thread, switching execution to
|
|
442
|
+
/// an unspecified thread.
|
|
443
|
+
ThreadSuspend { cancellable: bool },
|
|
444
|
+
|
|
445
|
+
/// A `canon thread.resume-later` intrinsic.
|
|
446
|
+
///
|
|
447
|
+
/// This allows the guest to mark a suspended thread for later resumption.
|
|
448
|
+
ThreadResumeLater,
|
|
449
|
+
|
|
450
|
+
/// A `canon thread.yield-to` intrinsic.
|
|
451
|
+
///
|
|
452
|
+
/// This allows the guest to suspend, yielding execution to a specified thread.
|
|
453
|
+
ThreadYieldTo { cancellable: bool },
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
impl ImportMap {
|
|
457
|
+
/// Returns the list of items that the adapter named `name` must export.
|
|
458
|
+
pub fn required_from_adapter(&self, name: &str) -> IndexMap<String, FuncType> {
|
|
459
|
+
let names = match self.names.get(name) {
|
|
460
|
+
Some(ImportInstance::Names(names)) => names,
|
|
461
|
+
_ => return IndexMap::new(),
|
|
462
|
+
};
|
|
463
|
+
names
|
|
464
|
+
.iter()
|
|
465
|
+
.map(|(_, import)| match import {
|
|
466
|
+
Import::AdapterExport { ty, func, adapter } => {
|
|
467
|
+
assert_eq!(adapter, name);
|
|
468
|
+
(func.clone(), ty.clone())
|
|
469
|
+
}
|
|
470
|
+
_ => unreachable!(),
|
|
471
|
+
})
|
|
472
|
+
.collect()
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/// Returns an iterator over all individual imports registered in this map.
|
|
476
|
+
///
|
|
477
|
+
/// Note that this doesn't iterate over the "whole instance" imports.
|
|
478
|
+
pub fn imports(&self) -> impl Iterator<Item = (&str, &str, &Import)> + '_ {
|
|
479
|
+
self.names
|
|
480
|
+
.iter()
|
|
481
|
+
.filter_map(|(module, m)| match m {
|
|
482
|
+
ImportInstance::Names(names) => Some((module, names)),
|
|
483
|
+
ImportInstance::Whole(_) => None,
|
|
484
|
+
})
|
|
485
|
+
.flat_map(|(module, m)| {
|
|
486
|
+
m.iter()
|
|
487
|
+
.map(move |(field, import)| (module.as_str(), field.as_str(), import))
|
|
488
|
+
})
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/// Returns the map for how all imports must be satisfied.
|
|
492
|
+
pub fn modules(&self) -> &IndexMap<String, ImportInstance> {
|
|
493
|
+
&self.names
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/// Classify an import and call `insert_import()` on it. Used during
|
|
497
|
+
/// validation to build up this `ImportMap`.
|
|
498
|
+
fn add(
|
|
499
|
+
&mut self,
|
|
500
|
+
import: wasmparser::Import<'_>,
|
|
501
|
+
encoder: &ComponentEncoder,
|
|
502
|
+
import_map: Option<&ModuleImportMap>,
|
|
503
|
+
library_info: Option<&LibraryInfo>,
|
|
504
|
+
types: TypesRef<'_>,
|
|
505
|
+
) -> Result<()> {
|
|
506
|
+
if self.classify_import_with_library(import, library_info)? {
|
|
507
|
+
return Ok(());
|
|
508
|
+
}
|
|
509
|
+
let mut import_to_classify = import;
|
|
510
|
+
if let Some(map) = import_map {
|
|
511
|
+
if let Some(original_name) = map.original_name(&import) {
|
|
512
|
+
import_to_classify.name = original_name;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
let item = self
|
|
516
|
+
.classify(import_to_classify, encoder, types)
|
|
517
|
+
.with_context(|| {
|
|
518
|
+
format!(
|
|
519
|
+
"failed to resolve import `{}::{}`",
|
|
520
|
+
import.module, import.name,
|
|
521
|
+
)
|
|
522
|
+
})?;
|
|
523
|
+
self.insert_import(import, item)
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/// Determines what kind of thing is being imported: maps it from the
|
|
527
|
+
/// module/name/type triple in the raw wasm module to an enum.
|
|
528
|
+
///
|
|
529
|
+
/// Handles a few special cases, then delegates to
|
|
530
|
+
/// `classify_component_model_import()`.
|
|
531
|
+
fn classify(
|
|
532
|
+
&self,
|
|
533
|
+
import: wasmparser::Import<'_>,
|
|
534
|
+
encoder: &ComponentEncoder,
|
|
535
|
+
types: TypesRef<'_>,
|
|
536
|
+
) -> Result<Import> {
|
|
537
|
+
// Special-case the main module's memory imported into adapters which
|
|
538
|
+
// currently with `wasm-ld` is not easily configurable.
|
|
539
|
+
if import.module == "env" && import.name == "memory" {
|
|
540
|
+
return Ok(Import::MainModuleMemory);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
// Special-case imports from the main module into adapters.
|
|
544
|
+
if import.module == "__main_module__" {
|
|
545
|
+
return Ok(Import::MainModuleExport {
|
|
546
|
+
name: import.name.to_string(),
|
|
547
|
+
kind: match import.ty {
|
|
548
|
+
TypeRef::Func(_) => ExportKind::Func,
|
|
549
|
+
TypeRef::Table(_) => ExportKind::Table,
|
|
550
|
+
TypeRef::Memory(_) => ExportKind::Memory,
|
|
551
|
+
TypeRef::Global(_) => ExportKind::Global,
|
|
552
|
+
TypeRef::Tag(_) => ExportKind::Tag,
|
|
553
|
+
TypeRef::FuncExact(_) => bail!("Unexpected func_exact export"),
|
|
554
|
+
},
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
let ty_index = match import.ty {
|
|
559
|
+
TypeRef::Func(ty) => ty,
|
|
560
|
+
_ => bail!("module is only allowed to import functions"),
|
|
561
|
+
};
|
|
562
|
+
let ty = types[types.core_type_at_in_module(ty_index)].unwrap_func();
|
|
563
|
+
|
|
564
|
+
// Handle main module imports that match known adapters and set it up as
|
|
565
|
+
// an import of an adapter export.
|
|
566
|
+
if encoder.adapters.contains_key(import.module) {
|
|
567
|
+
return Ok(Import::AdapterExport {
|
|
568
|
+
adapter: import.module.to_string(),
|
|
569
|
+
func: import.name.to_string(),
|
|
570
|
+
ty: ty.clone(),
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
let (module, names) = match import.module.strip_prefix("cm32p2") {
|
|
575
|
+
Some(suffix) => (suffix, STANDARD),
|
|
576
|
+
None if encoder.reject_legacy_names => (import.module, STANDARD),
|
|
577
|
+
None => (import.module, LEGACY),
|
|
578
|
+
};
|
|
579
|
+
self.classify_component_model_import(module, import.name, encoder, ty, names)
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/// Attempts to classify the import `{module}::{name}` with the rules
|
|
583
|
+
/// specified in WebAssembly/component-model#378
|
|
584
|
+
fn classify_component_model_import(
|
|
585
|
+
&self,
|
|
586
|
+
module: &str,
|
|
587
|
+
name: &str,
|
|
588
|
+
encoder: &ComponentEncoder,
|
|
589
|
+
ty: &FuncType,
|
|
590
|
+
names: &dyn NameMangling,
|
|
591
|
+
) -> Result<Import> {
|
|
592
|
+
let resolve = &encoder.metadata.resolve;
|
|
593
|
+
let world_id = encoder.metadata.world;
|
|
594
|
+
let world = &resolve.worlds[world_id];
|
|
595
|
+
|
|
596
|
+
if module == names.import_root() {
|
|
597
|
+
if names.error_context_drop(name) {
|
|
598
|
+
let expected = FuncType::new([ValType::I32], []);
|
|
599
|
+
validate_func_sig(name, &expected, ty)?;
|
|
600
|
+
return Ok(Import::ErrorContextDrop);
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
if names.backpressure_inc(name) {
|
|
604
|
+
let expected = FuncType::new([], []);
|
|
605
|
+
validate_func_sig(name, &expected, ty)?;
|
|
606
|
+
return Ok(Import::BackpressureInc);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
if names.backpressure_dec(name) {
|
|
610
|
+
let expected = FuncType::new([], []);
|
|
611
|
+
validate_func_sig(name, &expected, ty)?;
|
|
612
|
+
return Ok(Import::BackpressureDec);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
if names.waitable_set_new(name) {
|
|
616
|
+
let expected = FuncType::new([], [ValType::I32]);
|
|
617
|
+
validate_func_sig(name, &expected, ty)?;
|
|
618
|
+
return Ok(Import::WaitableSetNew);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
if let Some(info) = names.waitable_set_wait(name) {
|
|
622
|
+
let expected = FuncType::new([ValType::I32; 2], [ValType::I32]);
|
|
623
|
+
validate_func_sig(name, &expected, ty)?;
|
|
624
|
+
return Ok(Import::WaitableSetWait {
|
|
625
|
+
cancellable: info.cancellable,
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
if let Some(info) = names.waitable_set_poll(name) {
|
|
630
|
+
let expected = FuncType::new([ValType::I32; 2], [ValType::I32]);
|
|
631
|
+
validate_func_sig(name, &expected, ty)?;
|
|
632
|
+
return Ok(Import::WaitableSetPoll {
|
|
633
|
+
cancellable: info.cancellable,
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
if names.waitable_set_drop(name) {
|
|
638
|
+
let expected = FuncType::new([ValType::I32], []);
|
|
639
|
+
validate_func_sig(name, &expected, ty)?;
|
|
640
|
+
return Ok(Import::WaitableSetDrop);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
if names.waitable_join(name) {
|
|
644
|
+
let expected = FuncType::new([ValType::I32; 2], []);
|
|
645
|
+
validate_func_sig(name, &expected, ty)?;
|
|
646
|
+
return Ok(Import::WaitableJoin);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
if let Some(info) = names.thread_yield(name) {
|
|
650
|
+
let expected = FuncType::new([], [ValType::I32]);
|
|
651
|
+
validate_func_sig(name, &expected, ty)?;
|
|
652
|
+
return Ok(Import::ThreadYield {
|
|
653
|
+
cancellable: info.cancellable,
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
if names.subtask_drop(name) {
|
|
658
|
+
let expected = FuncType::new([ValType::I32], []);
|
|
659
|
+
validate_func_sig(name, &expected, ty)?;
|
|
660
|
+
return Ok(Import::SubtaskDrop);
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
if let Some(info) = names.subtask_cancel(name) {
|
|
664
|
+
let expected = FuncType::new([ValType::I32], [ValType::I32]);
|
|
665
|
+
validate_func_sig(name, &expected, ty)?;
|
|
666
|
+
return Ok(Import::SubtaskCancel {
|
|
667
|
+
async_: info.async_lowered,
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
if let Some(encoding) = names.error_context_new(name) {
|
|
672
|
+
let expected = FuncType::new([ValType::I32; 2], [ValType::I32]);
|
|
673
|
+
validate_func_sig(name, &expected, ty)?;
|
|
674
|
+
return Ok(Import::ErrorContextNew { encoding });
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
if let Some(encoding) = names.error_context_debug_message(name) {
|
|
678
|
+
let expected = FuncType::new([ValType::I32; 2], []);
|
|
679
|
+
validate_func_sig(name, &expected, ty)?;
|
|
680
|
+
return Ok(Import::ErrorContextDebugMessage { encoding });
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
if let Some(i) = names.context_get(name) {
|
|
684
|
+
let expected = FuncType::new([], [ValType::I32]);
|
|
685
|
+
validate_func_sig(name, &expected, ty)?;
|
|
686
|
+
return Ok(Import::ContextGet(i));
|
|
687
|
+
}
|
|
688
|
+
if let Some(i) = names.context_set(name) {
|
|
689
|
+
let expected = FuncType::new([ValType::I32], []);
|
|
690
|
+
validate_func_sig(name, &expected, ty)?;
|
|
691
|
+
return Ok(Import::ContextSet(i));
|
|
692
|
+
}
|
|
693
|
+
if names.thread_index(name) {
|
|
694
|
+
let expected = FuncType::new([], [ValType::I32]);
|
|
695
|
+
validate_func_sig(name, &expected, ty)?;
|
|
696
|
+
return Ok(Import::ThreadIndex);
|
|
697
|
+
}
|
|
698
|
+
if names.thread_new_indirect(name) {
|
|
699
|
+
let expected = FuncType::new([ValType::I32; 2], [ValType::I32]);
|
|
700
|
+
validate_func_sig(name, &expected, ty)?;
|
|
701
|
+
return Ok(Import::ThreadNewIndirect);
|
|
702
|
+
}
|
|
703
|
+
if let Some(info) = names.thread_switch_to(name) {
|
|
704
|
+
let expected = FuncType::new([ValType::I32], [ValType::I32]);
|
|
705
|
+
validate_func_sig(name, &expected, ty)?;
|
|
706
|
+
return Ok(Import::ThreadSwitchTo {
|
|
707
|
+
cancellable: info.cancellable,
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
if let Some(info) = names.thread_suspend(name) {
|
|
711
|
+
let expected = FuncType::new([], [ValType::I32]);
|
|
712
|
+
validate_func_sig(name, &expected, ty)?;
|
|
713
|
+
return Ok(Import::ThreadSuspend {
|
|
714
|
+
cancellable: info.cancellable,
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
if names.thread_resume_later(name) {
|
|
718
|
+
let expected = FuncType::new([ValType::I32], []);
|
|
719
|
+
validate_func_sig(name, &expected, ty)?;
|
|
720
|
+
return Ok(Import::ThreadResumeLater);
|
|
721
|
+
}
|
|
722
|
+
if let Some(info) = names.thread_yield_to(name) {
|
|
723
|
+
let expected = FuncType::new([ValType::I32], [ValType::I32]);
|
|
724
|
+
validate_func_sig(name, &expected, ty)?;
|
|
725
|
+
return Ok(Import::ThreadYieldTo {
|
|
726
|
+
cancellable: info.cancellable,
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
let (key_name, abi) = names.world_key_name_and_abi(name);
|
|
731
|
+
let key = WorldKey::Name(key_name.to_string());
|
|
732
|
+
if let Some(WorldItem::Function(func)) = world.imports.get(&key) {
|
|
733
|
+
validate_func(resolve, ty, func, abi)?;
|
|
734
|
+
return Ok(Import::WorldFunc(key, func.name.clone(), abi));
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
if let Some(import) =
|
|
738
|
+
self.maybe_classify_wit_intrinsic(name, None, encoder, ty, true, names)?
|
|
739
|
+
{
|
|
740
|
+
return Ok(import);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
match world.imports.get(&key) {
|
|
744
|
+
Some(_) => bail!("expected world top-level import `{name}` to be a function"),
|
|
745
|
+
None => bail!("no top-level imported function `{name}` specified"),
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
// Check for `[export]$root::[task-return]foo` or similar
|
|
750
|
+
if matches!(
|
|
751
|
+
module.strip_prefix(names.import_exported_intrinsic_prefix()),
|
|
752
|
+
Some(module) if module == names.import_root()
|
|
753
|
+
) {
|
|
754
|
+
if let Some(import) =
|
|
755
|
+
self.maybe_classify_wit_intrinsic(name, None, encoder, ty, false, names)?
|
|
756
|
+
{
|
|
757
|
+
return Ok(import);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
let interface = match module.strip_prefix(names.import_non_root_prefix()) {
|
|
762
|
+
Some(name) => name,
|
|
763
|
+
None => bail!("unknown or invalid component model import syntax"),
|
|
764
|
+
};
|
|
765
|
+
|
|
766
|
+
if let Some(interface) = interface.strip_prefix(names.import_exported_intrinsic_prefix()) {
|
|
767
|
+
let (key, id) = names.module_to_interface(interface, resolve, &world.exports)?;
|
|
768
|
+
|
|
769
|
+
if let Some(import) =
|
|
770
|
+
self.maybe_classify_wit_intrinsic(name, Some((key, id)), encoder, ty, false, names)?
|
|
771
|
+
{
|
|
772
|
+
return Ok(import);
|
|
773
|
+
}
|
|
774
|
+
bail!("unknown function `{name}`")
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
let (key, id) = names.module_to_interface(interface, resolve, &world.imports)?;
|
|
778
|
+
let interface = &resolve.interfaces[id];
|
|
779
|
+
let (function_name, abi) = names.interface_function_name_and_abi(name);
|
|
780
|
+
if let Some(f) = interface.functions.get(function_name) {
|
|
781
|
+
validate_func(resolve, ty, f, abi).with_context(|| {
|
|
782
|
+
let name = resolve.name_world_key(&key);
|
|
783
|
+
format!("failed to validate import interface `{name}`")
|
|
784
|
+
})?;
|
|
785
|
+
return Ok(Import::InterfaceFunc(key, id, f.name.clone(), abi));
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
if let Some(import) =
|
|
789
|
+
self.maybe_classify_wit_intrinsic(name, Some((key, id)), encoder, ty, true, names)?
|
|
790
|
+
{
|
|
791
|
+
return Ok(import);
|
|
792
|
+
}
|
|
793
|
+
bail!(
|
|
794
|
+
"import interface `{module}` is missing function \
|
|
795
|
+
`{name}` that is required by the module",
|
|
796
|
+
)
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
/// Attempts to detect and classify `name` as a WIT intrinsic.
|
|
800
|
+
///
|
|
801
|
+
/// This function is a bit of a sprawling sequence of matches used to
|
|
802
|
+
/// detect whether `name` corresponds to a WIT intrinsic, so specifically
|
|
803
|
+
/// not a WIT function itself. This is only used for functions imported
|
|
804
|
+
/// into a module but the import could be for an imported item in a world
|
|
805
|
+
/// or an exported item.
|
|
806
|
+
///
|
|
807
|
+
/// ## Parameters
|
|
808
|
+
///
|
|
809
|
+
/// * `name` - the core module name which is being pattern-matched. This
|
|
810
|
+
/// should be the "field" of the import. This may include the "[async-lower]"
|
|
811
|
+
/// or "[cancellable]" prefixes.
|
|
812
|
+
/// * `key_and_id` - this is the inferred "container" for the function
|
|
813
|
+
/// being described which is inferred from the module portion of the core
|
|
814
|
+
/// wasm import field. This is `None` for root-level function/type
|
|
815
|
+
/// imports, such as when referring to `import x: func();`. This is `Some`
|
|
816
|
+
/// when an interface is used (either `import x: interface { .. }` or a
|
|
817
|
+
/// standalone `interface`) where the world key is specified for the
|
|
818
|
+
/// interface in addition to the interface that was identified.
|
|
819
|
+
/// * `encoder` - this is the encoder state that contains
|
|
820
|
+
/// `Resolve`/metadata information.
|
|
821
|
+
/// * `ty` - the core wasm type of this import.
|
|
822
|
+
/// * `import` - whether or not this core wasm import is operating on a WIT
|
|
823
|
+
/// level import or export. An example of this being an export is when a
|
|
824
|
+
/// core module imports a destructor for an exported resource.
|
|
825
|
+
/// * `names` - the name mangling scheme that's configured to be used.
|
|
826
|
+
fn maybe_classify_wit_intrinsic(
|
|
827
|
+
&self,
|
|
828
|
+
name: &str,
|
|
829
|
+
key_and_id: Option<(WorldKey, InterfaceId)>,
|
|
830
|
+
encoder: &ComponentEncoder,
|
|
831
|
+
ty: &FuncType,
|
|
832
|
+
import: bool,
|
|
833
|
+
names: &dyn NameMangling,
|
|
834
|
+
) -> Result<Option<Import>> {
|
|
835
|
+
let resolve = &encoder.metadata.resolve;
|
|
836
|
+
let world_id = encoder.metadata.world;
|
|
837
|
+
let world = &resolve.worlds[world_id];
|
|
838
|
+
|
|
839
|
+
// Separate out `Option<WorldKey>` and `Option<InterfaceId>`. If an
|
|
840
|
+
// interface is NOT specified then the `WorldKey` which is attached to
|
|
841
|
+
// imports is going to be calculated based on the name of the item
|
|
842
|
+
// extracted, such as the resource or function referenced.
|
|
843
|
+
let (key, id) = match key_and_id {
|
|
844
|
+
Some((key, id)) => (Some(key), Some(id)),
|
|
845
|
+
None => (None, None),
|
|
846
|
+
};
|
|
847
|
+
|
|
848
|
+
// Tests whether `name` is a resource within `id` (or `world_id`).
|
|
849
|
+
let resource_test = |name: &str| match id {
|
|
850
|
+
Some(id) => resource_test_for_interface(resolve, id)(name),
|
|
851
|
+
None => resource_test_for_world(resolve, world_id)(name),
|
|
852
|
+
};
|
|
853
|
+
|
|
854
|
+
// Test whether this is a `resource.drop` intrinsic.
|
|
855
|
+
if let Some(resource) = names.resource_drop_name(name) {
|
|
856
|
+
if let Some(resource_id) = resource_test(resource) {
|
|
857
|
+
let key = key.unwrap_or_else(|| WorldKey::Name(resource.to_string()));
|
|
858
|
+
let expected = FuncType::new([ValType::I32], []);
|
|
859
|
+
validate_func_sig(name, &expected, ty)?;
|
|
860
|
+
return Ok(Some(if import {
|
|
861
|
+
Import::ImportedResourceDrop(key, id, resource_id)
|
|
862
|
+
} else {
|
|
863
|
+
Import::ExportedResourceDrop(key, resource_id)
|
|
864
|
+
}));
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
// There are some intrinsics which are only applicable to exported
|
|
869
|
+
// functions/resources, so check those use cases here.
|
|
870
|
+
if !import {
|
|
871
|
+
if let Some(name) = names.resource_new_name(name) {
|
|
872
|
+
if let Some(id) = resource_test(name) {
|
|
873
|
+
let key = key.unwrap_or_else(|| WorldKey::Name(name.to_string()));
|
|
874
|
+
let expected = FuncType::new([ValType::I32], [ValType::I32]);
|
|
875
|
+
validate_func_sig(name, &expected, ty)?;
|
|
876
|
+
return Ok(Some(Import::ExportedResourceNew(key, id)));
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
if let Some(name) = names.resource_rep_name(name) {
|
|
880
|
+
if let Some(id) = resource_test(name) {
|
|
881
|
+
let key = key.unwrap_or_else(|| WorldKey::Name(name.to_string()));
|
|
882
|
+
let expected = FuncType::new([ValType::I32], [ValType::I32]);
|
|
883
|
+
validate_func_sig(name, &expected, ty)?;
|
|
884
|
+
return Ok(Some(Import::ExportedResourceRep(key, id)));
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
if let Some(name) = names.task_return_name(name) {
|
|
888
|
+
let func = get_function(resolve, world, name, id, import)?;
|
|
889
|
+
let key = key.unwrap_or_else(|| WorldKey::Name(name.to_string()));
|
|
890
|
+
// TODO: should call `validate_func_sig` but would require
|
|
891
|
+
// calculating the expected signature based of `func.result`.
|
|
892
|
+
return Ok(Some(Import::ExportedTaskReturn(
|
|
893
|
+
key,
|
|
894
|
+
id,
|
|
895
|
+
func.name.clone(),
|
|
896
|
+
func.result,
|
|
897
|
+
)));
|
|
898
|
+
}
|
|
899
|
+
if names.task_cancel(name) {
|
|
900
|
+
let expected = FuncType::new([], []);
|
|
901
|
+
validate_func_sig(name, &expected, ty)?;
|
|
902
|
+
return Ok(Some(Import::ExportedTaskCancel));
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
let lookup_context = PayloadLookupContext {
|
|
907
|
+
resolve,
|
|
908
|
+
world,
|
|
909
|
+
key,
|
|
910
|
+
id,
|
|
911
|
+
import,
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
// Test for a number of async-related intrinsics. All intrinsics are
|
|
915
|
+
// prefixed with `[...-N]` where `...` is the name of the intrinsic and
|
|
916
|
+
// the `N` is the indexed future/stream that is being referred to.
|
|
917
|
+
let import = if let Some(info) = names.future_new(&lookup_context, name) {
|
|
918
|
+
validate_func_sig(name, &FuncType::new([], [ValType::I64]), ty)?;
|
|
919
|
+
Import::FutureNew(info)
|
|
920
|
+
} else if let Some(info) = names.future_write(&lookup_context, name) {
|
|
921
|
+
validate_func_sig(name, &FuncType::new([ValType::I32; 2], [ValType::I32]), ty)?;
|
|
922
|
+
Import::FutureWrite {
|
|
923
|
+
async_: info.async_lowered,
|
|
924
|
+
info: info.inner,
|
|
925
|
+
}
|
|
926
|
+
} else if let Some(info) = names.future_read(&lookup_context, name) {
|
|
927
|
+
validate_func_sig(name, &FuncType::new([ValType::I32; 2], [ValType::I32]), ty)?;
|
|
928
|
+
Import::FutureRead {
|
|
929
|
+
async_: info.async_lowered,
|
|
930
|
+
info: info.inner,
|
|
931
|
+
}
|
|
932
|
+
} else if let Some(info) = names.future_cancel_write(&lookup_context, name) {
|
|
933
|
+
validate_func_sig(name, &FuncType::new([ValType::I32], [ValType::I32]), ty)?;
|
|
934
|
+
Import::FutureCancelWrite {
|
|
935
|
+
async_: info.async_lowered,
|
|
936
|
+
info: info.inner,
|
|
937
|
+
}
|
|
938
|
+
} else if let Some(info) = names.future_cancel_read(&lookup_context, name) {
|
|
939
|
+
validate_func_sig(name, &FuncType::new([ValType::I32], [ValType::I32]), ty)?;
|
|
940
|
+
Import::FutureCancelRead {
|
|
941
|
+
async_: info.async_lowered,
|
|
942
|
+
info: info.inner,
|
|
943
|
+
}
|
|
944
|
+
} else if let Some(info) = names.future_drop_writable(&lookup_context, name) {
|
|
945
|
+
validate_func_sig(name, &FuncType::new([ValType::I32], []), ty)?;
|
|
946
|
+
Import::FutureDropWritable(info)
|
|
947
|
+
} else if let Some(info) = names.future_drop_readable(&lookup_context, name) {
|
|
948
|
+
validate_func_sig(name, &FuncType::new([ValType::I32], []), ty)?;
|
|
949
|
+
Import::FutureDropReadable(info)
|
|
950
|
+
} else if let Some(info) = names.stream_new(&lookup_context, name) {
|
|
951
|
+
validate_func_sig(name, &FuncType::new([], [ValType::I64]), ty)?;
|
|
952
|
+
Import::StreamNew(info)
|
|
953
|
+
} else if let Some(info) = names.stream_write(&lookup_context, name) {
|
|
954
|
+
validate_func_sig(name, &FuncType::new([ValType::I32; 3], [ValType::I32]), ty)?;
|
|
955
|
+
Import::StreamWrite {
|
|
956
|
+
async_: info.async_lowered,
|
|
957
|
+
info: info.inner,
|
|
958
|
+
}
|
|
959
|
+
} else if let Some(info) = names.stream_read(&lookup_context, name) {
|
|
960
|
+
validate_func_sig(name, &FuncType::new([ValType::I32; 3], [ValType::I32]), ty)?;
|
|
961
|
+
Import::StreamRead {
|
|
962
|
+
async_: info.async_lowered,
|
|
963
|
+
info: info.inner,
|
|
964
|
+
}
|
|
965
|
+
} else if let Some(info) = names.stream_cancel_write(&lookup_context, name) {
|
|
966
|
+
validate_func_sig(name, &FuncType::new([ValType::I32], [ValType::I32]), ty)?;
|
|
967
|
+
Import::StreamCancelWrite {
|
|
968
|
+
async_: info.async_lowered,
|
|
969
|
+
info: info.inner,
|
|
970
|
+
}
|
|
971
|
+
} else if let Some(info) = names.stream_cancel_read(&lookup_context, name) {
|
|
972
|
+
validate_func_sig(name, &FuncType::new([ValType::I32], [ValType::I32]), ty)?;
|
|
973
|
+
Import::StreamCancelRead {
|
|
974
|
+
async_: info.async_lowered,
|
|
975
|
+
info: info.inner,
|
|
976
|
+
}
|
|
977
|
+
} else if let Some(info) = names.stream_drop_writable(&lookup_context, name) {
|
|
978
|
+
validate_func_sig(name, &FuncType::new([ValType::I32], []), ty)?;
|
|
979
|
+
Import::StreamDropWritable(info)
|
|
980
|
+
} else if let Some(info) = names.stream_drop_readable(&lookup_context, name) {
|
|
981
|
+
validate_func_sig(name, &FuncType::new([ValType::I32], []), ty)?;
|
|
982
|
+
Import::StreamDropReadable(info)
|
|
983
|
+
} else {
|
|
984
|
+
return Ok(None);
|
|
985
|
+
};
|
|
986
|
+
Ok(Some(import))
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
fn classify_import_with_library(
|
|
990
|
+
&mut self,
|
|
991
|
+
import: wasmparser::Import<'_>,
|
|
992
|
+
library_info: Option<&LibraryInfo>,
|
|
993
|
+
) -> Result<bool> {
|
|
994
|
+
let info = match library_info {
|
|
995
|
+
Some(info) => info,
|
|
996
|
+
None => return Ok(false),
|
|
997
|
+
};
|
|
998
|
+
let Some((_, instance)) = info
|
|
999
|
+
.arguments
|
|
1000
|
+
.iter()
|
|
1001
|
+
.find(|(name, _items)| *name == import.module)
|
|
1002
|
+
else {
|
|
1003
|
+
return Ok(false);
|
|
1004
|
+
};
|
|
1005
|
+
match instance {
|
|
1006
|
+
Instance::MainOrAdapter(module) => match self.names.get(import.module) {
|
|
1007
|
+
Some(ImportInstance::Whole(which)) => {
|
|
1008
|
+
if which != module {
|
|
1009
|
+
bail!("different whole modules imported under the same name");
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
Some(ImportInstance::Names(_)) => {
|
|
1013
|
+
bail!("cannot mix individual imports and whole module imports")
|
|
1014
|
+
}
|
|
1015
|
+
None => {
|
|
1016
|
+
let instance = ImportInstance::Whole(module.clone());
|
|
1017
|
+
self.names.insert(import.module.to_string(), instance);
|
|
1018
|
+
}
|
|
1019
|
+
},
|
|
1020
|
+
Instance::Items(items) => {
|
|
1021
|
+
let Some(item) = items.iter().find(|i| i.alias == import.name) else {
|
|
1022
|
+
return Ok(false);
|
|
1023
|
+
};
|
|
1024
|
+
self.insert_import(import, Import::Item(item.clone()))?;
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
Ok(true)
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
/// Map an imported item, by module and field name in `self.names`, to the
|
|
1031
|
+
/// kind of `Import` it is: for example, a certain-typed function from an
|
|
1032
|
+
/// adapter.
|
|
1033
|
+
fn insert_import(&mut self, import: wasmparser::Import<'_>, item: Import) -> Result<()> {
|
|
1034
|
+
let entry = self
|
|
1035
|
+
.names
|
|
1036
|
+
.entry(import.module.to_string())
|
|
1037
|
+
.or_insert(ImportInstance::Names(IndexMap::default()));
|
|
1038
|
+
let names = match entry {
|
|
1039
|
+
ImportInstance::Names(names) => names,
|
|
1040
|
+
_ => bail!("cannot mix individual imports with module imports"),
|
|
1041
|
+
};
|
|
1042
|
+
let entry = match names.entry(import.name.to_string()) {
|
|
1043
|
+
Entry::Occupied(_) => {
|
|
1044
|
+
bail!(
|
|
1045
|
+
"module has duplicate import for `{}::{}`",
|
|
1046
|
+
import.module,
|
|
1047
|
+
import.name
|
|
1048
|
+
);
|
|
1049
|
+
}
|
|
1050
|
+
Entry::Vacant(v) => v,
|
|
1051
|
+
};
|
|
1052
|
+
log::trace!(
|
|
1053
|
+
"classifying import `{}::{} as {item:?}",
|
|
1054
|
+
import.module,
|
|
1055
|
+
import.name
|
|
1056
|
+
);
|
|
1057
|
+
entry.insert(item);
|
|
1058
|
+
Ok(())
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
/// Dual of `ImportMap` except describes the exports of a module instead of the
|
|
1063
|
+
/// imports.
|
|
1064
|
+
#[derive(Default)]
|
|
1065
|
+
pub struct ExportMap {
|
|
1066
|
+
names: IndexMap<String, Export>,
|
|
1067
|
+
raw_exports: IndexMap<String, FuncType>,
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
/// All possible (known) exports from a core wasm module that are recognized and
|
|
1071
|
+
/// handled during the componentization process.
|
|
1072
|
+
#[derive(Debug)]
|
|
1073
|
+
pub enum Export {
|
|
1074
|
+
/// An export of a top-level function of a world, where the world function
|
|
1075
|
+
/// is named here.
|
|
1076
|
+
WorldFunc(WorldKey, String, AbiVariant),
|
|
1077
|
+
|
|
1078
|
+
/// A post-return for a top-level function of a world.
|
|
1079
|
+
WorldFuncPostReturn(WorldKey),
|
|
1080
|
+
|
|
1081
|
+
/// An export of a function in an interface.
|
|
1082
|
+
InterfaceFunc(WorldKey, InterfaceId, String, AbiVariant),
|
|
1083
|
+
|
|
1084
|
+
/// A post-return for the above function.
|
|
1085
|
+
InterfaceFuncPostReturn(WorldKey, String),
|
|
1086
|
+
|
|
1087
|
+
/// A destructor for an exported resource.
|
|
1088
|
+
ResourceDtor(TypeId),
|
|
1089
|
+
|
|
1090
|
+
/// Memory, typically for an adapter.
|
|
1091
|
+
Memory,
|
|
1092
|
+
|
|
1093
|
+
/// `cabi_realloc`
|
|
1094
|
+
GeneralPurposeRealloc,
|
|
1095
|
+
|
|
1096
|
+
/// `cabi_export_realloc`
|
|
1097
|
+
GeneralPurposeExportRealloc,
|
|
1098
|
+
|
|
1099
|
+
/// `cabi_import_realloc`
|
|
1100
|
+
GeneralPurposeImportRealloc,
|
|
1101
|
+
|
|
1102
|
+
/// `_initialize`
|
|
1103
|
+
Initialize,
|
|
1104
|
+
|
|
1105
|
+
/// `cabi_realloc_adapter`
|
|
1106
|
+
ReallocForAdapter,
|
|
1107
|
+
|
|
1108
|
+
WorldFuncCallback(WorldKey),
|
|
1109
|
+
|
|
1110
|
+
InterfaceFuncCallback(WorldKey, String),
|
|
1111
|
+
|
|
1112
|
+
/// __indirect_function_table, used for `thread.new-indirect`
|
|
1113
|
+
IndirectFunctionTable,
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
impl ExportMap {
|
|
1117
|
+
fn add(
|
|
1118
|
+
&mut self,
|
|
1119
|
+
export: wasmparser::Export<'_>,
|
|
1120
|
+
encoder: &ComponentEncoder,
|
|
1121
|
+
exports: &IndexSet<WorldKey>,
|
|
1122
|
+
types: TypesRef<'_>,
|
|
1123
|
+
) -> Result<()> {
|
|
1124
|
+
if let Some(item) = self.classify(export, encoder, exports, types)? {
|
|
1125
|
+
log::debug!("classifying export `{}` as {item:?}", export.name);
|
|
1126
|
+
let prev = self.names.insert(export.name.to_string(), item);
|
|
1127
|
+
assert!(prev.is_none());
|
|
1128
|
+
}
|
|
1129
|
+
Ok(())
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
fn classify(
|
|
1133
|
+
&mut self,
|
|
1134
|
+
export: wasmparser::Export<'_>,
|
|
1135
|
+
encoder: &ComponentEncoder,
|
|
1136
|
+
exports: &IndexSet<WorldKey>,
|
|
1137
|
+
types: TypesRef<'_>,
|
|
1138
|
+
) -> Result<Option<Export>> {
|
|
1139
|
+
match export.kind {
|
|
1140
|
+
ExternalKind::Func => {
|
|
1141
|
+
let ty = types[types.core_function_at(export.index)].unwrap_func();
|
|
1142
|
+
self.raw_exports.insert(export.name.to_string(), ty.clone());
|
|
1143
|
+
}
|
|
1144
|
+
_ => {}
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
// Handle a few special-cased names first.
|
|
1148
|
+
if export.name == "canonical_abi_realloc" {
|
|
1149
|
+
return Ok(Some(Export::GeneralPurposeRealloc));
|
|
1150
|
+
} else if export.name == "cabi_import_realloc" {
|
|
1151
|
+
return Ok(Some(Export::GeneralPurposeImportRealloc));
|
|
1152
|
+
} else if export.name == "cabi_export_realloc" {
|
|
1153
|
+
return Ok(Some(Export::GeneralPurposeExportRealloc));
|
|
1154
|
+
} else if export.name == "cabi_realloc_adapter" {
|
|
1155
|
+
return Ok(Some(Export::ReallocForAdapter));
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
let (name, names) = match export.name.strip_prefix("cm32p2") {
|
|
1159
|
+
Some(name) => (name, STANDARD),
|
|
1160
|
+
None if encoder.reject_legacy_names => return Ok(None),
|
|
1161
|
+
None => (export.name, LEGACY),
|
|
1162
|
+
};
|
|
1163
|
+
|
|
1164
|
+
if let Some(export) = self
|
|
1165
|
+
.classify_component_export(names, name, &export, encoder, exports, types)
|
|
1166
|
+
.with_context(|| format!("failed to classify export `{}`", export.name))?
|
|
1167
|
+
{
|
|
1168
|
+
return Ok(Some(export));
|
|
1169
|
+
}
|
|
1170
|
+
log::debug!("unknown export `{}`", export.name);
|
|
1171
|
+
Ok(None)
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
fn classify_component_export(
|
|
1175
|
+
&mut self,
|
|
1176
|
+
names: &dyn NameMangling,
|
|
1177
|
+
name: &str,
|
|
1178
|
+
export: &wasmparser::Export<'_>,
|
|
1179
|
+
encoder: &ComponentEncoder,
|
|
1180
|
+
exports: &IndexSet<WorldKey>,
|
|
1181
|
+
types: TypesRef<'_>,
|
|
1182
|
+
) -> Result<Option<Export>> {
|
|
1183
|
+
let resolve = &encoder.metadata.resolve;
|
|
1184
|
+
let world = encoder.metadata.world;
|
|
1185
|
+
match export.kind {
|
|
1186
|
+
ExternalKind::Func => {}
|
|
1187
|
+
ExternalKind::Memory => {
|
|
1188
|
+
if name == names.export_memory() {
|
|
1189
|
+
return Ok(Some(Export::Memory));
|
|
1190
|
+
}
|
|
1191
|
+
return Ok(None);
|
|
1192
|
+
}
|
|
1193
|
+
ExternalKind::Table => {
|
|
1194
|
+
if Some(name) == names.export_indirect_function_table() {
|
|
1195
|
+
return Ok(Some(Export::IndirectFunctionTable));
|
|
1196
|
+
}
|
|
1197
|
+
return Ok(None);
|
|
1198
|
+
}
|
|
1199
|
+
_ => return Ok(None),
|
|
1200
|
+
}
|
|
1201
|
+
let ty = types[types.core_function_at(export.index)].unwrap_func();
|
|
1202
|
+
|
|
1203
|
+
// Handle a few special-cased names first.
|
|
1204
|
+
if name == names.export_realloc() {
|
|
1205
|
+
let expected = FuncType::new([ValType::I32; 4], [ValType::I32]);
|
|
1206
|
+
validate_func_sig(name, &expected, ty)?;
|
|
1207
|
+
return Ok(Some(Export::GeneralPurposeRealloc));
|
|
1208
|
+
} else if name == names.export_initialize() {
|
|
1209
|
+
let expected = FuncType::new([], []);
|
|
1210
|
+
validate_func_sig(name, &expected, ty)?;
|
|
1211
|
+
return Ok(Some(Export::Initialize));
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
let full_name = name;
|
|
1215
|
+
let (abi, name) = if let Some(name) = names.async_lift_name(name) {
|
|
1216
|
+
(AbiVariant::GuestExportAsync, name)
|
|
1217
|
+
} else if let Some(name) = names.async_lift_stackful_name(name) {
|
|
1218
|
+
(AbiVariant::GuestExportAsyncStackful, name)
|
|
1219
|
+
} else {
|
|
1220
|
+
(AbiVariant::GuestExport, name)
|
|
1221
|
+
};
|
|
1222
|
+
|
|
1223
|
+
// Try to match this to a known WIT export that `exports` allows.
|
|
1224
|
+
if let Some((key, id, f)) = names.match_wit_export(name, resolve, world, exports) {
|
|
1225
|
+
validate_func(resolve, ty, f, abi).with_context(|| {
|
|
1226
|
+
let key = resolve.name_world_key(key);
|
|
1227
|
+
format!("failed to validate export for `{key}`")
|
|
1228
|
+
})?;
|
|
1229
|
+
match id {
|
|
1230
|
+
Some(id) => {
|
|
1231
|
+
return Ok(Some(Export::InterfaceFunc(
|
|
1232
|
+
key.clone(),
|
|
1233
|
+
id,
|
|
1234
|
+
f.name.clone(),
|
|
1235
|
+
abi,
|
|
1236
|
+
)));
|
|
1237
|
+
}
|
|
1238
|
+
None => {
|
|
1239
|
+
return Ok(Some(Export::WorldFunc(key.clone(), f.name.clone(), abi)));
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
// See if this is a post-return for any known WIT export.
|
|
1245
|
+
if let Some(remaining) = names.strip_post_return(name) {
|
|
1246
|
+
if let Some((key, id, f)) = names.match_wit_export(remaining, resolve, world, exports) {
|
|
1247
|
+
validate_post_return(resolve, ty, f).with_context(|| {
|
|
1248
|
+
let key = resolve.name_world_key(key);
|
|
1249
|
+
format!("failed to validate export for `{key}`")
|
|
1250
|
+
})?;
|
|
1251
|
+
match id {
|
|
1252
|
+
Some(_id) => {
|
|
1253
|
+
return Ok(Some(Export::InterfaceFuncPostReturn(
|
|
1254
|
+
key.clone(),
|
|
1255
|
+
f.name.clone(),
|
|
1256
|
+
)));
|
|
1257
|
+
}
|
|
1258
|
+
None => {
|
|
1259
|
+
return Ok(Some(Export::WorldFuncPostReturn(key.clone())));
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
if let Some(suffix) = names.async_lift_callback_name(full_name) {
|
|
1266
|
+
if let Some((key, id, f)) = names.match_wit_export(suffix, resolve, world, exports) {
|
|
1267
|
+
validate_func_sig(
|
|
1268
|
+
full_name,
|
|
1269
|
+
&FuncType::new([ValType::I32; 3], [ValType::I32]),
|
|
1270
|
+
ty,
|
|
1271
|
+
)?;
|
|
1272
|
+
return Ok(Some(if id.is_some() {
|
|
1273
|
+
Export::InterfaceFuncCallback(key.clone(), f.name.clone())
|
|
1274
|
+
} else {
|
|
1275
|
+
Export::WorldFuncCallback(key.clone())
|
|
1276
|
+
}));
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
// And, finally, see if it matches a known destructor.
|
|
1281
|
+
if let Some(dtor) = names.match_wit_resource_dtor(name, resolve, world, exports) {
|
|
1282
|
+
let expected = FuncType::new([ValType::I32], []);
|
|
1283
|
+
validate_func_sig(full_name, &expected, ty)?;
|
|
1284
|
+
return Ok(Some(Export::ResourceDtor(dtor)));
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
Ok(None)
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
/// Returns the name of the post-return export, if any, for the `key` and
|
|
1291
|
+
/// `func` combo.
|
|
1292
|
+
pub fn post_return(&self, key: &WorldKey, func: &Function) -> Option<&str> {
|
|
1293
|
+
self.find(|m| match m {
|
|
1294
|
+
Export::WorldFuncPostReturn(k) => k == key,
|
|
1295
|
+
Export::InterfaceFuncPostReturn(k, f) => k == key && func.name == *f,
|
|
1296
|
+
_ => false,
|
|
1297
|
+
})
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
/// Returns the name of the async callback export, if any, for the `key` and
|
|
1301
|
+
/// `func` combo.
|
|
1302
|
+
pub fn callback(&self, key: &WorldKey, func: &Function) -> Option<&str> {
|
|
1303
|
+
self.find(|m| match m {
|
|
1304
|
+
Export::WorldFuncCallback(k) => k == key,
|
|
1305
|
+
Export::InterfaceFuncCallback(k, f) => k == key && func.name == *f,
|
|
1306
|
+
_ => false,
|
|
1307
|
+
})
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
pub fn abi(&self, key: &WorldKey, func: &Function) -> Option<AbiVariant> {
|
|
1311
|
+
self.names.values().find_map(|m| match m {
|
|
1312
|
+
Export::WorldFunc(k, f, abi) if k == key && func.name == *f => Some(*abi),
|
|
1313
|
+
Export::InterfaceFunc(k, _, f, abi) if k == key && func.name == *f => Some(*abi),
|
|
1314
|
+
_ => None,
|
|
1315
|
+
})
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
/// Returns the realloc that the exported function `interface` and `func`
|
|
1319
|
+
/// are using.
|
|
1320
|
+
pub fn export_realloc_for(&self, key: &WorldKey, func: &str) -> Option<&str> {
|
|
1321
|
+
// TODO: This realloc detection should probably be improved with
|
|
1322
|
+
// some sort of scheme to have per-function reallocs like
|
|
1323
|
+
// `cabi_realloc_{name}` or something like that.
|
|
1324
|
+
let _ = (key, func);
|
|
1325
|
+
|
|
1326
|
+
if let Some(name) = self.find(|m| matches!(m, Export::GeneralPurposeExportRealloc)) {
|
|
1327
|
+
return Some(name);
|
|
1328
|
+
}
|
|
1329
|
+
self.general_purpose_realloc()
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
/// Returns the realloc that the imported function `interface` and `func`
|
|
1333
|
+
/// are using.
|
|
1334
|
+
pub fn import_realloc_for(&self, interface: Option<InterfaceId>, func: &str) -> Option<&str> {
|
|
1335
|
+
// TODO: This realloc detection should probably be improved with
|
|
1336
|
+
// some sort of scheme to have per-function reallocs like
|
|
1337
|
+
// `cabi_realloc_{name}` or something like that.
|
|
1338
|
+
let _ = (interface, func);
|
|
1339
|
+
|
|
1340
|
+
self.import_realloc_fallback()
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
/// Returns the general-purpose realloc function to use for imports.
|
|
1344
|
+
///
|
|
1345
|
+
/// Note that `import_realloc_for` should be used instead where possible.
|
|
1346
|
+
pub fn import_realloc_fallback(&self) -> Option<&str> {
|
|
1347
|
+
if let Some(name) = self.find(|m| matches!(m, Export::GeneralPurposeImportRealloc)) {
|
|
1348
|
+
return Some(name);
|
|
1349
|
+
}
|
|
1350
|
+
self.general_purpose_realloc()
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
/// Returns the realloc that the main module is exporting into the adapter.
|
|
1354
|
+
pub fn realloc_to_import_into_adapter(&self) -> Option<&str> {
|
|
1355
|
+
if let Some(name) = self.find(|m| matches!(m, Export::ReallocForAdapter)) {
|
|
1356
|
+
return Some(name);
|
|
1357
|
+
}
|
|
1358
|
+
self.general_purpose_realloc()
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
fn general_purpose_realloc(&self) -> Option<&str> {
|
|
1362
|
+
self.find(|m| matches!(m, Export::GeneralPurposeRealloc))
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
/// Returns the memory, if exported, for this module.
|
|
1366
|
+
pub fn memory(&self) -> Option<&str> {
|
|
1367
|
+
self.find(|m| matches!(m, Export::Memory))
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
/// Returns the indirect function table, if exported, for this module.
|
|
1371
|
+
pub fn indirect_function_table(&self) -> Option<&str> {
|
|
1372
|
+
self.find(|t| matches!(t, Export::IndirectFunctionTable))
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
/// Returns the `_initialize` intrinsic, if exported, for this module.
|
|
1376
|
+
pub fn initialize(&self) -> Option<&str> {
|
|
1377
|
+
self.find(|m| matches!(m, Export::Initialize))
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
/// Returns destructor for the exported resource `ty`, if it was listed.
|
|
1381
|
+
pub fn resource_dtor(&self, ty: TypeId) -> Option<&str> {
|
|
1382
|
+
self.find(|m| match m {
|
|
1383
|
+
Export::ResourceDtor(t) => *t == ty,
|
|
1384
|
+
_ => false,
|
|
1385
|
+
})
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
/// NB: this is a linear search and if that's ever a problem this should
|
|
1389
|
+
/// build up an inverse map during construction to accelerate it.
|
|
1390
|
+
fn find(&self, f: impl Fn(&Export) -> bool) -> Option<&str> {
|
|
1391
|
+
let (name, _) = self.names.iter().filter(|(_, m)| f(m)).next()?;
|
|
1392
|
+
Some(name)
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
/// Iterates over all exports of this module.
|
|
1396
|
+
pub fn iter(&self) -> impl Iterator<Item = (&str, &Export)> + '_ {
|
|
1397
|
+
self.names.iter().map(|(n, e)| (n.as_str(), e))
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
fn validate(&self, encoder: &ComponentEncoder, exports: &IndexSet<WorldKey>) -> Result<()> {
|
|
1401
|
+
let resolve = &encoder.metadata.resolve;
|
|
1402
|
+
let world = encoder.metadata.world;
|
|
1403
|
+
// Multi-memory isn't supported because otherwise we don't know what
|
|
1404
|
+
// memory to put things in.
|
|
1405
|
+
if self
|
|
1406
|
+
.names
|
|
1407
|
+
.values()
|
|
1408
|
+
.filter(|m| matches!(m, Export::Memory))
|
|
1409
|
+
.count()
|
|
1410
|
+
> 1
|
|
1411
|
+
{
|
|
1412
|
+
bail!("cannot componentize module that exports multiple memories")
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
// Every async-with-callback-lifted export must have a callback.
|
|
1416
|
+
for (name, export) in &self.names {
|
|
1417
|
+
match export {
|
|
1418
|
+
Export::WorldFunc(_, _, AbiVariant::GuestExportAsync) => {
|
|
1419
|
+
if !matches!(
|
|
1420
|
+
self.names.get(&format!("[callback]{name}")),
|
|
1421
|
+
Some(Export::WorldFuncCallback(_))
|
|
1422
|
+
) {
|
|
1423
|
+
bail!("missing callback for `{name}`");
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
Export::InterfaceFunc(_, _, _, AbiVariant::GuestExportAsync) => {
|
|
1427
|
+
if !matches!(
|
|
1428
|
+
self.names.get(&format!("[callback]{name}")),
|
|
1429
|
+
Some(Export::InterfaceFuncCallback(_, _))
|
|
1430
|
+
) {
|
|
1431
|
+
bail!("missing callback for `{name}`");
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
_ => {}
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
// All of `exports` must be exported and found within this module.
|
|
1439
|
+
for export in exports {
|
|
1440
|
+
let require_interface_func = |interface: InterfaceId, name: &str| -> Result<()> {
|
|
1441
|
+
let result = self.find(|e| match e {
|
|
1442
|
+
Export::InterfaceFunc(_, id, s, _) => interface == *id && name == s,
|
|
1443
|
+
_ => false,
|
|
1444
|
+
});
|
|
1445
|
+
if result.is_some() {
|
|
1446
|
+
Ok(())
|
|
1447
|
+
} else {
|
|
1448
|
+
let export = resolve.name_world_key(export);
|
|
1449
|
+
bail!("failed to find export of interface `{export}` function `{name}`")
|
|
1450
|
+
}
|
|
1451
|
+
};
|
|
1452
|
+
let require_world_func = |name: &str| -> Result<()> {
|
|
1453
|
+
let result = self.find(|e| match e {
|
|
1454
|
+
Export::WorldFunc(_, s, _) => name == s,
|
|
1455
|
+
_ => false,
|
|
1456
|
+
});
|
|
1457
|
+
if result.is_some() {
|
|
1458
|
+
Ok(())
|
|
1459
|
+
} else {
|
|
1460
|
+
bail!("failed to find export of function `{name}`")
|
|
1461
|
+
}
|
|
1462
|
+
};
|
|
1463
|
+
match &resolve.worlds[world].exports[export] {
|
|
1464
|
+
WorldItem::Interface { id, .. } => {
|
|
1465
|
+
for (name, _) in resolve.interfaces[*id].functions.iter() {
|
|
1466
|
+
require_interface_func(*id, name)?;
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
WorldItem::Function(f) => {
|
|
1470
|
+
require_world_func(&f.name)?;
|
|
1471
|
+
}
|
|
1472
|
+
WorldItem::Type(_) => unreachable!(),
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
Ok(())
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
/// A builtin that may be declared as cancellable.
|
|
1481
|
+
struct MaybeCancellable<T> {
|
|
1482
|
+
#[allow(unused)]
|
|
1483
|
+
inner: T,
|
|
1484
|
+
cancellable: bool,
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
/// A builtin that may be declared as async-lowered.
|
|
1488
|
+
struct MaybeAsyncLowered<T> {
|
|
1489
|
+
inner: T,
|
|
1490
|
+
async_lowered: bool,
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
/// Context passed to `NameMangling` implementations of stream and future functions
|
|
1494
|
+
/// to help with looking up payload information.
|
|
1495
|
+
struct PayloadLookupContext<'a> {
|
|
1496
|
+
resolve: &'a Resolve,
|
|
1497
|
+
world: &'a World,
|
|
1498
|
+
id: Option<InterfaceId>,
|
|
1499
|
+
import: bool,
|
|
1500
|
+
key: Option<WorldKey>,
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
/// Trait dispatch and definition for parsing and interpreting "mangled names"
|
|
1504
|
+
/// which show up in imports and exports of the component model.
|
|
1505
|
+
///
|
|
1506
|
+
/// This trait is used to implement classification of imports and exports in the
|
|
1507
|
+
/// component model. The methods on `ImportMap` and `ExportMap` will use this to
|
|
1508
|
+
/// determine what an import is and how it's lifted/lowered in the world being
|
|
1509
|
+
/// bound.
|
|
1510
|
+
///
|
|
1511
|
+
/// This trait has a bit of history behind it as well. Before
|
|
1512
|
+
/// WebAssembly/component-model#378 there was no standard naming scheme for core
|
|
1513
|
+
/// wasm imports or exports when componenitizing. This meant that
|
|
1514
|
+
/// `wit-component` implemented a particular scheme which mostly worked but was
|
|
1515
|
+
/// mostly along the lines of "this at least works" rather than "someone sat
|
|
1516
|
+
/// down and designed this". Since then, however, an standard naming scheme has
|
|
1517
|
+
/// now been specified which was indeed designed.
|
|
1518
|
+
///
|
|
1519
|
+
/// This trait serves as the bridge between these two. The historical naming
|
|
1520
|
+
/// scheme is still supported for now through the `Legacy` implementation below
|
|
1521
|
+
/// and will be for some time. The transition plan at this time is to support
|
|
1522
|
+
/// the new scheme, eventually get it supported in bindings generators, and once
|
|
1523
|
+
/// that's all propagated remove support for the legacy scheme.
|
|
1524
|
+
trait NameMangling {
|
|
1525
|
+
fn import_root(&self) -> &str;
|
|
1526
|
+
fn import_non_root_prefix(&self) -> &str;
|
|
1527
|
+
fn import_exported_intrinsic_prefix(&self) -> &str;
|
|
1528
|
+
fn export_memory(&self) -> &str;
|
|
1529
|
+
fn export_initialize(&self) -> &str;
|
|
1530
|
+
fn export_realloc(&self) -> &str;
|
|
1531
|
+
fn export_indirect_function_table(&self) -> Option<&str>;
|
|
1532
|
+
fn resource_drop_name<'a>(&self, name: &'a str) -> Option<&'a str>;
|
|
1533
|
+
fn resource_new_name<'a>(&self, name: &'a str) -> Option<&'a str>;
|
|
1534
|
+
fn resource_rep_name<'a>(&self, name: &'a str) -> Option<&'a str>;
|
|
1535
|
+
fn task_return_name<'a>(&self, name: &'a str) -> Option<&'a str>;
|
|
1536
|
+
fn task_cancel(&self, name: &str) -> bool;
|
|
1537
|
+
fn backpressure_inc(&self, name: &str) -> bool;
|
|
1538
|
+
fn backpressure_dec(&self, name: &str) -> bool;
|
|
1539
|
+
fn waitable_set_new(&self, name: &str) -> bool;
|
|
1540
|
+
fn waitable_set_wait(&self, name: &str) -> Option<MaybeCancellable<()>>;
|
|
1541
|
+
fn waitable_set_poll(&self, name: &str) -> Option<MaybeCancellable<()>>;
|
|
1542
|
+
fn waitable_set_drop(&self, name: &str) -> bool;
|
|
1543
|
+
fn waitable_join(&self, name: &str) -> bool;
|
|
1544
|
+
fn thread_yield(&self, name: &str) -> Option<MaybeCancellable<()>>;
|
|
1545
|
+
fn subtask_drop(&self, name: &str) -> bool;
|
|
1546
|
+
fn subtask_cancel(&self, name: &str) -> Option<MaybeAsyncLowered<()>>;
|
|
1547
|
+
fn async_lift_callback_name<'a>(&self, name: &'a str) -> Option<&'a str>;
|
|
1548
|
+
fn async_lift_name<'a>(&self, name: &'a str) -> Option<&'a str>;
|
|
1549
|
+
fn async_lift_stackful_name<'a>(&self, name: &'a str) -> Option<&'a str>;
|
|
1550
|
+
fn error_context_new(&self, name: &str) -> Option<StringEncoding>;
|
|
1551
|
+
fn error_context_debug_message(&self, name: &str) -> Option<StringEncoding>;
|
|
1552
|
+
fn error_context_drop(&self, name: &str) -> bool;
|
|
1553
|
+
fn context_get(&self, name: &str) -> Option<u32>;
|
|
1554
|
+
fn context_set(&self, name: &str) -> Option<u32>;
|
|
1555
|
+
fn future_new(&self, lookup_context: &PayloadLookupContext, name: &str) -> Option<PayloadInfo>;
|
|
1556
|
+
fn future_write(
|
|
1557
|
+
&self,
|
|
1558
|
+
lookup_context: &PayloadLookupContext,
|
|
1559
|
+
name: &str,
|
|
1560
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>>;
|
|
1561
|
+
fn future_read(
|
|
1562
|
+
&self,
|
|
1563
|
+
lookup_context: &PayloadLookupContext,
|
|
1564
|
+
name: &str,
|
|
1565
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>>;
|
|
1566
|
+
fn future_cancel_write(
|
|
1567
|
+
&self,
|
|
1568
|
+
lookup_context: &PayloadLookupContext,
|
|
1569
|
+
name: &str,
|
|
1570
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>>;
|
|
1571
|
+
fn future_cancel_read(
|
|
1572
|
+
&self,
|
|
1573
|
+
lookup_context: &PayloadLookupContext,
|
|
1574
|
+
name: &str,
|
|
1575
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>>;
|
|
1576
|
+
fn future_drop_writable(
|
|
1577
|
+
&self,
|
|
1578
|
+
lookup_context: &PayloadLookupContext,
|
|
1579
|
+
name: &str,
|
|
1580
|
+
) -> Option<PayloadInfo>;
|
|
1581
|
+
fn future_drop_readable(
|
|
1582
|
+
&self,
|
|
1583
|
+
lookup_context: &PayloadLookupContext,
|
|
1584
|
+
name: &str,
|
|
1585
|
+
) -> Option<PayloadInfo>;
|
|
1586
|
+
fn stream_new(&self, lookup_context: &PayloadLookupContext, name: &str) -> Option<PayloadInfo>;
|
|
1587
|
+
fn stream_write(
|
|
1588
|
+
&self,
|
|
1589
|
+
lookup_context: &PayloadLookupContext,
|
|
1590
|
+
name: &str,
|
|
1591
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>>;
|
|
1592
|
+
fn stream_read(
|
|
1593
|
+
&self,
|
|
1594
|
+
lookup_context: &PayloadLookupContext,
|
|
1595
|
+
name: &str,
|
|
1596
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>>;
|
|
1597
|
+
fn stream_cancel_write(
|
|
1598
|
+
&self,
|
|
1599
|
+
lookup_context: &PayloadLookupContext,
|
|
1600
|
+
name: &str,
|
|
1601
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>>;
|
|
1602
|
+
fn stream_cancel_read(
|
|
1603
|
+
&self,
|
|
1604
|
+
lookup_context: &PayloadLookupContext,
|
|
1605
|
+
name: &str,
|
|
1606
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>>;
|
|
1607
|
+
fn stream_drop_writable(
|
|
1608
|
+
&self,
|
|
1609
|
+
lookup_context: &PayloadLookupContext,
|
|
1610
|
+
name: &str,
|
|
1611
|
+
) -> Option<PayloadInfo>;
|
|
1612
|
+
fn stream_drop_readable(
|
|
1613
|
+
&self,
|
|
1614
|
+
lookup_context: &PayloadLookupContext,
|
|
1615
|
+
name: &str,
|
|
1616
|
+
) -> Option<PayloadInfo>;
|
|
1617
|
+
fn thread_index(&self, name: &str) -> bool;
|
|
1618
|
+
fn thread_new_indirect(&self, name: &str) -> bool;
|
|
1619
|
+
fn thread_switch_to(&self, name: &str) -> Option<MaybeCancellable<()>>;
|
|
1620
|
+
fn thread_suspend(&self, name: &str) -> Option<MaybeCancellable<()>>;
|
|
1621
|
+
fn thread_resume_later(&self, name: &str) -> bool;
|
|
1622
|
+
fn thread_yield_to(&self, name: &str) -> Option<MaybeCancellable<()>>;
|
|
1623
|
+
fn module_to_interface(
|
|
1624
|
+
&self,
|
|
1625
|
+
module: &str,
|
|
1626
|
+
resolve: &Resolve,
|
|
1627
|
+
items: &IndexMap<WorldKey, WorldItem>,
|
|
1628
|
+
) -> Result<(WorldKey, InterfaceId)>;
|
|
1629
|
+
fn strip_post_return<'a>(&self, name: &'a str) -> Option<&'a str>;
|
|
1630
|
+
fn match_wit_export<'a>(
|
|
1631
|
+
&self,
|
|
1632
|
+
export_name: &str,
|
|
1633
|
+
resolve: &'a Resolve,
|
|
1634
|
+
world: WorldId,
|
|
1635
|
+
exports: &'a IndexSet<WorldKey>,
|
|
1636
|
+
) -> Option<(&'a WorldKey, Option<InterfaceId>, &'a Function)>;
|
|
1637
|
+
fn match_wit_resource_dtor<'a>(
|
|
1638
|
+
&self,
|
|
1639
|
+
export_name: &str,
|
|
1640
|
+
resolve: &'a Resolve,
|
|
1641
|
+
world: WorldId,
|
|
1642
|
+
exports: &'a IndexSet<WorldKey>,
|
|
1643
|
+
) -> Option<TypeId>;
|
|
1644
|
+
fn world_key_name_and_abi<'a>(&self, name: &'a str) -> (&'a str, AbiVariant);
|
|
1645
|
+
fn interface_function_name_and_abi<'a>(&self, name: &'a str) -> (&'a str, AbiVariant);
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
/// Definition of the "standard" naming scheme which currently starts with
|
|
1649
|
+
/// "cm32p2". Note that wasm64 is not supported at this time.
|
|
1650
|
+
struct Standard;
|
|
1651
|
+
|
|
1652
|
+
const STANDARD: &'static dyn NameMangling = &Standard;
|
|
1653
|
+
|
|
1654
|
+
impl NameMangling for Standard {
|
|
1655
|
+
fn import_root(&self) -> &str {
|
|
1656
|
+
""
|
|
1657
|
+
}
|
|
1658
|
+
fn import_non_root_prefix(&self) -> &str {
|
|
1659
|
+
"|"
|
|
1660
|
+
}
|
|
1661
|
+
fn import_exported_intrinsic_prefix(&self) -> &str {
|
|
1662
|
+
"_ex_"
|
|
1663
|
+
}
|
|
1664
|
+
fn export_memory(&self) -> &str {
|
|
1665
|
+
"_memory"
|
|
1666
|
+
}
|
|
1667
|
+
fn export_initialize(&self) -> &str {
|
|
1668
|
+
"_initialize"
|
|
1669
|
+
}
|
|
1670
|
+
fn export_realloc(&self) -> &str {
|
|
1671
|
+
"_realloc"
|
|
1672
|
+
}
|
|
1673
|
+
fn export_indirect_function_table(&self) -> Option<&str> {
|
|
1674
|
+
None
|
|
1675
|
+
}
|
|
1676
|
+
fn resource_drop_name<'a>(&self, name: &'a str) -> Option<&'a str> {
|
|
1677
|
+
name.strip_suffix("_drop")
|
|
1678
|
+
}
|
|
1679
|
+
fn resource_new_name<'a>(&self, name: &'a str) -> Option<&'a str> {
|
|
1680
|
+
name.strip_suffix("_new")
|
|
1681
|
+
}
|
|
1682
|
+
fn resource_rep_name<'a>(&self, name: &'a str) -> Option<&'a str> {
|
|
1683
|
+
name.strip_suffix("_rep")
|
|
1684
|
+
}
|
|
1685
|
+
fn task_return_name<'a>(&self, _name: &'a str) -> Option<&'a str> {
|
|
1686
|
+
None
|
|
1687
|
+
}
|
|
1688
|
+
fn task_cancel(&self, _name: &str) -> bool {
|
|
1689
|
+
false
|
|
1690
|
+
}
|
|
1691
|
+
fn backpressure_inc(&self, _name: &str) -> bool {
|
|
1692
|
+
false
|
|
1693
|
+
}
|
|
1694
|
+
fn backpressure_dec(&self, _name: &str) -> bool {
|
|
1695
|
+
false
|
|
1696
|
+
}
|
|
1697
|
+
fn waitable_set_new(&self, _name: &str) -> bool {
|
|
1698
|
+
false
|
|
1699
|
+
}
|
|
1700
|
+
fn waitable_set_wait(&self, _name: &str) -> Option<MaybeCancellable<()>> {
|
|
1701
|
+
None
|
|
1702
|
+
}
|
|
1703
|
+
fn waitable_set_poll(&self, _name: &str) -> Option<MaybeCancellable<()>> {
|
|
1704
|
+
None
|
|
1705
|
+
}
|
|
1706
|
+
fn waitable_set_drop(&self, _name: &str) -> bool {
|
|
1707
|
+
false
|
|
1708
|
+
}
|
|
1709
|
+
fn waitable_join(&self, _name: &str) -> bool {
|
|
1710
|
+
false
|
|
1711
|
+
}
|
|
1712
|
+
fn thread_yield(&self, _name: &str) -> Option<MaybeCancellable<()>> {
|
|
1713
|
+
None
|
|
1714
|
+
}
|
|
1715
|
+
fn subtask_drop(&self, _name: &str) -> bool {
|
|
1716
|
+
false
|
|
1717
|
+
}
|
|
1718
|
+
fn subtask_cancel(&self, _name: &str) -> Option<MaybeAsyncLowered<()>> {
|
|
1719
|
+
None
|
|
1720
|
+
}
|
|
1721
|
+
fn async_lift_callback_name<'a>(&self, _name: &'a str) -> Option<&'a str> {
|
|
1722
|
+
None
|
|
1723
|
+
}
|
|
1724
|
+
fn async_lift_name<'a>(&self, _name: &'a str) -> Option<&'a str> {
|
|
1725
|
+
None
|
|
1726
|
+
}
|
|
1727
|
+
fn async_lift_stackful_name<'a>(&self, _name: &'a str) -> Option<&'a str> {
|
|
1728
|
+
None
|
|
1729
|
+
}
|
|
1730
|
+
fn error_context_new(&self, _name: &str) -> Option<StringEncoding> {
|
|
1731
|
+
None
|
|
1732
|
+
}
|
|
1733
|
+
fn error_context_debug_message(&self, _name: &str) -> Option<StringEncoding> {
|
|
1734
|
+
None
|
|
1735
|
+
}
|
|
1736
|
+
fn error_context_drop(&self, _name: &str) -> bool {
|
|
1737
|
+
false
|
|
1738
|
+
}
|
|
1739
|
+
fn context_get(&self, _name: &str) -> Option<u32> {
|
|
1740
|
+
None
|
|
1741
|
+
}
|
|
1742
|
+
fn context_set(&self, _name: &str) -> Option<u32> {
|
|
1743
|
+
None
|
|
1744
|
+
}
|
|
1745
|
+
fn thread_index(&self, _name: &str) -> bool {
|
|
1746
|
+
false
|
|
1747
|
+
}
|
|
1748
|
+
fn thread_new_indirect(&self, _name: &str) -> bool {
|
|
1749
|
+
false
|
|
1750
|
+
}
|
|
1751
|
+
fn thread_switch_to(&self, _name: &str) -> Option<MaybeCancellable<()>> {
|
|
1752
|
+
None
|
|
1753
|
+
}
|
|
1754
|
+
fn thread_suspend(&self, _name: &str) -> Option<MaybeCancellable<()>> {
|
|
1755
|
+
None
|
|
1756
|
+
}
|
|
1757
|
+
fn thread_resume_later(&self, _name: &str) -> bool {
|
|
1758
|
+
false
|
|
1759
|
+
}
|
|
1760
|
+
fn thread_yield_to(&self, _name: &str) -> Option<MaybeCancellable<()>> {
|
|
1761
|
+
None
|
|
1762
|
+
}
|
|
1763
|
+
fn future_new(
|
|
1764
|
+
&self,
|
|
1765
|
+
_lookup_context: &PayloadLookupContext,
|
|
1766
|
+
_name: &str,
|
|
1767
|
+
) -> Option<PayloadInfo> {
|
|
1768
|
+
None
|
|
1769
|
+
}
|
|
1770
|
+
fn future_write(
|
|
1771
|
+
&self,
|
|
1772
|
+
_lookup_context: &PayloadLookupContext,
|
|
1773
|
+
_name: &str,
|
|
1774
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
1775
|
+
None
|
|
1776
|
+
}
|
|
1777
|
+
fn future_read(
|
|
1778
|
+
&self,
|
|
1779
|
+
_lookup_context: &PayloadLookupContext,
|
|
1780
|
+
_name: &str,
|
|
1781
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
1782
|
+
None
|
|
1783
|
+
}
|
|
1784
|
+
fn future_cancel_write(
|
|
1785
|
+
&self,
|
|
1786
|
+
_lookup_context: &PayloadLookupContext,
|
|
1787
|
+
_name: &str,
|
|
1788
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
1789
|
+
None
|
|
1790
|
+
}
|
|
1791
|
+
fn future_cancel_read(
|
|
1792
|
+
&self,
|
|
1793
|
+
_lookup_context: &PayloadLookupContext,
|
|
1794
|
+
_name: &str,
|
|
1795
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
1796
|
+
None
|
|
1797
|
+
}
|
|
1798
|
+
fn future_drop_writable(
|
|
1799
|
+
&self,
|
|
1800
|
+
_lookup_context: &PayloadLookupContext,
|
|
1801
|
+
_name: &str,
|
|
1802
|
+
) -> Option<PayloadInfo> {
|
|
1803
|
+
None
|
|
1804
|
+
}
|
|
1805
|
+
fn future_drop_readable(
|
|
1806
|
+
&self,
|
|
1807
|
+
_lookup_context: &PayloadLookupContext,
|
|
1808
|
+
_name: &str,
|
|
1809
|
+
) -> Option<PayloadInfo> {
|
|
1810
|
+
None
|
|
1811
|
+
}
|
|
1812
|
+
fn stream_new(
|
|
1813
|
+
&self,
|
|
1814
|
+
_lookup_context: &PayloadLookupContext,
|
|
1815
|
+
_name: &str,
|
|
1816
|
+
) -> Option<PayloadInfo> {
|
|
1817
|
+
None
|
|
1818
|
+
}
|
|
1819
|
+
fn stream_write(
|
|
1820
|
+
&self,
|
|
1821
|
+
_lookup_context: &PayloadLookupContext,
|
|
1822
|
+
_name: &str,
|
|
1823
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
1824
|
+
None
|
|
1825
|
+
}
|
|
1826
|
+
fn stream_read(
|
|
1827
|
+
&self,
|
|
1828
|
+
_lookup_context: &PayloadLookupContext,
|
|
1829
|
+
_name: &str,
|
|
1830
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
1831
|
+
None
|
|
1832
|
+
}
|
|
1833
|
+
fn stream_cancel_write(
|
|
1834
|
+
&self,
|
|
1835
|
+
_lookup_context: &PayloadLookupContext,
|
|
1836
|
+
_name: &str,
|
|
1837
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
1838
|
+
None
|
|
1839
|
+
}
|
|
1840
|
+
fn stream_cancel_read(
|
|
1841
|
+
&self,
|
|
1842
|
+
_lookup_context: &PayloadLookupContext,
|
|
1843
|
+
_name: &str,
|
|
1844
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
1845
|
+
None
|
|
1846
|
+
}
|
|
1847
|
+
fn stream_drop_writable(
|
|
1848
|
+
&self,
|
|
1849
|
+
_lookup_context: &PayloadLookupContext,
|
|
1850
|
+
_name: &str,
|
|
1851
|
+
) -> Option<PayloadInfo> {
|
|
1852
|
+
None
|
|
1853
|
+
}
|
|
1854
|
+
fn stream_drop_readable(
|
|
1855
|
+
&self,
|
|
1856
|
+
_lookup_context: &PayloadLookupContext,
|
|
1857
|
+
_name: &str,
|
|
1858
|
+
) -> Option<PayloadInfo> {
|
|
1859
|
+
None
|
|
1860
|
+
}
|
|
1861
|
+
fn module_to_interface(
|
|
1862
|
+
&self,
|
|
1863
|
+
interface: &str,
|
|
1864
|
+
resolve: &Resolve,
|
|
1865
|
+
items: &IndexMap<WorldKey, WorldItem>,
|
|
1866
|
+
) -> Result<(WorldKey, InterfaceId)> {
|
|
1867
|
+
for (key, item) in items.iter() {
|
|
1868
|
+
let id = match key {
|
|
1869
|
+
// Bare keys are matched exactly against `interface`
|
|
1870
|
+
WorldKey::Name(name) => match item {
|
|
1871
|
+
WorldItem::Interface { id, .. } if name == interface => *id,
|
|
1872
|
+
_ => continue,
|
|
1873
|
+
},
|
|
1874
|
+
// ID-identified keys are matched with their "canonical name"
|
|
1875
|
+
WorldKey::Interface(id) => {
|
|
1876
|
+
if resolve.canonicalized_id_of(*id).as_deref() != Some(interface) {
|
|
1877
|
+
continue;
|
|
1878
|
+
}
|
|
1879
|
+
*id
|
|
1880
|
+
}
|
|
1881
|
+
};
|
|
1882
|
+
return Ok((key.clone(), id));
|
|
1883
|
+
}
|
|
1884
|
+
bail!("failed to find world item corresponding to interface `{interface}`")
|
|
1885
|
+
}
|
|
1886
|
+
fn strip_post_return<'a>(&self, name: &'a str) -> Option<&'a str> {
|
|
1887
|
+
name.strip_suffix("_post")
|
|
1888
|
+
}
|
|
1889
|
+
fn match_wit_export<'a>(
|
|
1890
|
+
&self,
|
|
1891
|
+
export_name: &str,
|
|
1892
|
+
resolve: &'a Resolve,
|
|
1893
|
+
world: WorldId,
|
|
1894
|
+
exports: &'a IndexSet<WorldKey>,
|
|
1895
|
+
) -> Option<(&'a WorldKey, Option<InterfaceId>, &'a Function)> {
|
|
1896
|
+
if let Some(world_export_name) = export_name.strip_prefix("||") {
|
|
1897
|
+
let key = exports.get(&WorldKey::Name(world_export_name.to_string()))?;
|
|
1898
|
+
match &resolve.worlds[world].exports[key] {
|
|
1899
|
+
WorldItem::Function(f) => return Some((key, None, f)),
|
|
1900
|
+
_ => return None,
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
let (key, id, func_name) =
|
|
1905
|
+
self.match_wit_interface(export_name, resolve, world, exports)?;
|
|
1906
|
+
let func = resolve.interfaces[id].functions.get(func_name)?;
|
|
1907
|
+
Some((key, Some(id), func))
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
fn match_wit_resource_dtor<'a>(
|
|
1911
|
+
&self,
|
|
1912
|
+
export_name: &str,
|
|
1913
|
+
resolve: &'a Resolve,
|
|
1914
|
+
world: WorldId,
|
|
1915
|
+
exports: &'a IndexSet<WorldKey>,
|
|
1916
|
+
) -> Option<TypeId> {
|
|
1917
|
+
let (_key, id, name) =
|
|
1918
|
+
self.match_wit_interface(export_name.strip_suffix("_dtor")?, resolve, world, exports)?;
|
|
1919
|
+
let ty = *resolve.interfaces[id].types.get(name)?;
|
|
1920
|
+
match resolve.types[ty].kind {
|
|
1921
|
+
TypeDefKind::Resource => Some(ty),
|
|
1922
|
+
_ => None,
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
fn world_key_name_and_abi<'a>(&self, name: &'a str) -> (&'a str, AbiVariant) {
|
|
1927
|
+
(name, AbiVariant::GuestImport)
|
|
1928
|
+
}
|
|
1929
|
+
fn interface_function_name_and_abi<'a>(&self, name: &'a str) -> (&'a str, AbiVariant) {
|
|
1930
|
+
(name, AbiVariant::GuestImport)
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
impl Standard {
|
|
1935
|
+
fn match_wit_interface<'a, 'b>(
|
|
1936
|
+
&self,
|
|
1937
|
+
export_name: &'b str,
|
|
1938
|
+
resolve: &'a Resolve,
|
|
1939
|
+
world: WorldId,
|
|
1940
|
+
exports: &'a IndexSet<WorldKey>,
|
|
1941
|
+
) -> Option<(&'a WorldKey, InterfaceId, &'b str)> {
|
|
1942
|
+
let world = &resolve.worlds[world];
|
|
1943
|
+
let export_name = export_name.strip_prefix("|")?;
|
|
1944
|
+
|
|
1945
|
+
for export in exports {
|
|
1946
|
+
let id = match &world.exports[export] {
|
|
1947
|
+
WorldItem::Interface { id, .. } => *id,
|
|
1948
|
+
WorldItem::Function(_) => continue,
|
|
1949
|
+
WorldItem::Type(_) => unreachable!(),
|
|
1950
|
+
};
|
|
1951
|
+
let remaining = match export {
|
|
1952
|
+
WorldKey::Name(name) => export_name.strip_prefix(name),
|
|
1953
|
+
WorldKey::Interface(_) => {
|
|
1954
|
+
let prefix = resolve.canonicalized_id_of(id).unwrap();
|
|
1955
|
+
export_name.strip_prefix(&prefix)
|
|
1956
|
+
}
|
|
1957
|
+
};
|
|
1958
|
+
let item_name = match remaining.and_then(|s| s.strip_prefix("|")) {
|
|
1959
|
+
Some(name) => name,
|
|
1960
|
+
None => continue,
|
|
1961
|
+
};
|
|
1962
|
+
return Some((export, id, item_name));
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
None
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
/// Definition of wit-component's "legacy" naming scheme which predates
|
|
1970
|
+
/// WebAssembly/component-model#378.
|
|
1971
|
+
struct Legacy;
|
|
1972
|
+
|
|
1973
|
+
const LEGACY: &'static dyn NameMangling = &Legacy;
|
|
1974
|
+
|
|
1975
|
+
impl Legacy {
|
|
1976
|
+
// Looks for `[$prefix-N]foo` within `name`. If found then `foo` is
|
|
1977
|
+
// used to find a function within `id` and `world` above. Once found
|
|
1978
|
+
// then `N` is used to index within that function to extract a
|
|
1979
|
+
// future/stream type. If that's all found then a `PayloadInfo` is
|
|
1980
|
+
// returned to get attached to an intrinsic.
|
|
1981
|
+
fn prefixed_payload(
|
|
1982
|
+
&self,
|
|
1983
|
+
lookup_context: &PayloadLookupContext,
|
|
1984
|
+
name: &str,
|
|
1985
|
+
prefix: &str,
|
|
1986
|
+
) -> Option<PayloadInfo> {
|
|
1987
|
+
// parse the `prefix` into `func_name` and `type_index`, bailing out
|
|
1988
|
+
// with `None` if anything doesn't match.
|
|
1989
|
+
let (index_or_unit, func_name) = prefixed_intrinsic(name, prefix)?;
|
|
1990
|
+
let ty = match index_or_unit {
|
|
1991
|
+
"unit" => {
|
|
1992
|
+
if name.starts_with("[future") {
|
|
1993
|
+
PayloadType::UnitFuture
|
|
1994
|
+
} else if name.starts_with("[stream") {
|
|
1995
|
+
PayloadType::UnitStream
|
|
1996
|
+
} else {
|
|
1997
|
+
unreachable!()
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
other => {
|
|
2001
|
+
// Note that this is parsed as a `u32` to ensure that the
|
|
2002
|
+
// integer parsing is the same across platforms regardless of
|
|
2003
|
+
// the the width of `usize`.
|
|
2004
|
+
let type_index = other.parse::<u32>().ok()? as usize;
|
|
2005
|
+
|
|
2006
|
+
// Double-check that `func_name` is indeed a function name within
|
|
2007
|
+
// this interface/world. Then additionally double-check that
|
|
2008
|
+
// `type_index` is indeed a valid index for this function's type
|
|
2009
|
+
// signature.
|
|
2010
|
+
let function = get_function(
|
|
2011
|
+
lookup_context.resolve,
|
|
2012
|
+
lookup_context.world,
|
|
2013
|
+
func_name,
|
|
2014
|
+
lookup_context.id,
|
|
2015
|
+
lookup_context.import,
|
|
2016
|
+
)
|
|
2017
|
+
.ok()?;
|
|
2018
|
+
PayloadType::Type {
|
|
2019
|
+
id: *function
|
|
2020
|
+
.find_futures_and_streams(lookup_context.resolve)
|
|
2021
|
+
.get(type_index)?,
|
|
2022
|
+
function: function.name.clone(),
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
};
|
|
2026
|
+
|
|
2027
|
+
// And if all that passes wrap up everything in a `PayloadInfo`.
|
|
2028
|
+
Some(PayloadInfo {
|
|
2029
|
+
name: name.to_string(),
|
|
2030
|
+
ty,
|
|
2031
|
+
key: lookup_context
|
|
2032
|
+
.key
|
|
2033
|
+
.clone()
|
|
2034
|
+
.unwrap_or_else(|| WorldKey::Name(name.to_string())),
|
|
2035
|
+
interface: lookup_context.id,
|
|
2036
|
+
imported: lookup_context.import,
|
|
2037
|
+
})
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
fn maybe_async_lowered_payload(
|
|
2041
|
+
&self,
|
|
2042
|
+
lookup_context: &PayloadLookupContext,
|
|
2043
|
+
name: &str,
|
|
2044
|
+
prefix: &str,
|
|
2045
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
2046
|
+
let (async_lowered, clean_name) = self.strip_async_lowered_prefix(name);
|
|
2047
|
+
let payload = self.prefixed_payload(lookup_context, clean_name, prefix)?;
|
|
2048
|
+
Some(MaybeAsyncLowered {
|
|
2049
|
+
inner: payload,
|
|
2050
|
+
async_lowered,
|
|
2051
|
+
})
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
fn strip_async_lowered_prefix<'a>(&self, name: &'a str) -> (bool, &'a str) {
|
|
2055
|
+
name.strip_prefix("[async-lower]")
|
|
2056
|
+
.map_or((false, name), |s| (true, s))
|
|
2057
|
+
}
|
|
2058
|
+
fn match_with_async_lowered_prefix(
|
|
2059
|
+
&self,
|
|
2060
|
+
name: &str,
|
|
2061
|
+
expected: &str,
|
|
2062
|
+
) -> Option<MaybeAsyncLowered<()>> {
|
|
2063
|
+
let (async_lowered, clean_name) = self.strip_async_lowered_prefix(name);
|
|
2064
|
+
if clean_name == expected {
|
|
2065
|
+
Some(MaybeAsyncLowered {
|
|
2066
|
+
inner: (),
|
|
2067
|
+
async_lowered,
|
|
2068
|
+
})
|
|
2069
|
+
} else {
|
|
2070
|
+
None
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
fn strip_cancellable_prefix<'a>(&self, name: &'a str) -> (bool, &'a str) {
|
|
2074
|
+
name.strip_prefix("[cancellable]")
|
|
2075
|
+
.map_or((false, name), |s| (true, s))
|
|
2076
|
+
}
|
|
2077
|
+
fn match_with_cancellable_prefix(
|
|
2078
|
+
&self,
|
|
2079
|
+
name: &str,
|
|
2080
|
+
expected: &str,
|
|
2081
|
+
) -> Option<MaybeCancellable<()>> {
|
|
2082
|
+
let (cancellable, clean_name) = self.strip_cancellable_prefix(name);
|
|
2083
|
+
if clean_name == expected {
|
|
2084
|
+
Some(MaybeCancellable {
|
|
2085
|
+
inner: (),
|
|
2086
|
+
cancellable,
|
|
2087
|
+
})
|
|
2088
|
+
} else {
|
|
2089
|
+
None
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
|
|
2094
|
+
impl NameMangling for Legacy {
|
|
2095
|
+
fn import_root(&self) -> &str {
|
|
2096
|
+
"$root"
|
|
2097
|
+
}
|
|
2098
|
+
fn import_non_root_prefix(&self) -> &str {
|
|
2099
|
+
""
|
|
2100
|
+
}
|
|
2101
|
+
fn import_exported_intrinsic_prefix(&self) -> &str {
|
|
2102
|
+
"[export]"
|
|
2103
|
+
}
|
|
2104
|
+
fn export_memory(&self) -> &str {
|
|
2105
|
+
"memory"
|
|
2106
|
+
}
|
|
2107
|
+
fn export_initialize(&self) -> &str {
|
|
2108
|
+
"_initialize"
|
|
2109
|
+
}
|
|
2110
|
+
fn export_realloc(&self) -> &str {
|
|
2111
|
+
"cabi_realloc"
|
|
2112
|
+
}
|
|
2113
|
+
fn export_indirect_function_table(&self) -> Option<&str> {
|
|
2114
|
+
Some("__indirect_function_table")
|
|
2115
|
+
}
|
|
2116
|
+
fn resource_drop_name<'a>(&self, name: &'a str) -> Option<&'a str> {
|
|
2117
|
+
name.strip_prefix("[resource-drop]")
|
|
2118
|
+
}
|
|
2119
|
+
fn resource_new_name<'a>(&self, name: &'a str) -> Option<&'a str> {
|
|
2120
|
+
name.strip_prefix("[resource-new]")
|
|
2121
|
+
}
|
|
2122
|
+
fn resource_rep_name<'a>(&self, name: &'a str) -> Option<&'a str> {
|
|
2123
|
+
name.strip_prefix("[resource-rep]")
|
|
2124
|
+
}
|
|
2125
|
+
fn task_return_name<'a>(&self, name: &'a str) -> Option<&'a str> {
|
|
2126
|
+
name.strip_prefix("[task-return]")
|
|
2127
|
+
}
|
|
2128
|
+
fn task_cancel(&self, name: &str) -> bool {
|
|
2129
|
+
name == "[task-cancel]"
|
|
2130
|
+
}
|
|
2131
|
+
fn backpressure_inc(&self, name: &str) -> bool {
|
|
2132
|
+
name == "[backpressure-inc]"
|
|
2133
|
+
}
|
|
2134
|
+
fn backpressure_dec(&self, name: &str) -> bool {
|
|
2135
|
+
name == "[backpressure-dec]"
|
|
2136
|
+
}
|
|
2137
|
+
fn waitable_set_new(&self, name: &str) -> bool {
|
|
2138
|
+
name == "[waitable-set-new]"
|
|
2139
|
+
}
|
|
2140
|
+
fn waitable_set_wait(&self, name: &str) -> Option<MaybeCancellable<()>> {
|
|
2141
|
+
self.match_with_cancellable_prefix(name, "[waitable-set-wait]")
|
|
2142
|
+
}
|
|
2143
|
+
fn waitable_set_poll(&self, name: &str) -> Option<MaybeCancellable<()>> {
|
|
2144
|
+
self.match_with_cancellable_prefix(name, "[waitable-set-poll]")
|
|
2145
|
+
}
|
|
2146
|
+
fn waitable_set_drop(&self, name: &str) -> bool {
|
|
2147
|
+
name == "[waitable-set-drop]"
|
|
2148
|
+
}
|
|
2149
|
+
fn waitable_join(&self, name: &str) -> bool {
|
|
2150
|
+
name == "[waitable-join]"
|
|
2151
|
+
}
|
|
2152
|
+
fn thread_yield(&self, name: &str) -> Option<MaybeCancellable<()>> {
|
|
2153
|
+
self.match_with_cancellable_prefix(name, "[thread-yield]")
|
|
2154
|
+
}
|
|
2155
|
+
fn subtask_drop(&self, name: &str) -> bool {
|
|
2156
|
+
name == "[subtask-drop]"
|
|
2157
|
+
}
|
|
2158
|
+
fn subtask_cancel(&self, name: &str) -> Option<MaybeAsyncLowered<()>> {
|
|
2159
|
+
self.match_with_async_lowered_prefix(name, "[subtask-cancel]")
|
|
2160
|
+
}
|
|
2161
|
+
fn async_lift_callback_name<'a>(&self, name: &'a str) -> Option<&'a str> {
|
|
2162
|
+
name.strip_prefix("[callback][async-lift]")
|
|
2163
|
+
}
|
|
2164
|
+
fn async_lift_name<'a>(&self, name: &'a str) -> Option<&'a str> {
|
|
2165
|
+
name.strip_prefix("[async-lift]")
|
|
2166
|
+
}
|
|
2167
|
+
fn async_lift_stackful_name<'a>(&self, name: &'a str) -> Option<&'a str> {
|
|
2168
|
+
name.strip_prefix("[async-lift-stackful]")
|
|
2169
|
+
}
|
|
2170
|
+
fn error_context_new(&self, name: &str) -> Option<StringEncoding> {
|
|
2171
|
+
match name {
|
|
2172
|
+
"[error-context-new-utf8]" => Some(StringEncoding::UTF8),
|
|
2173
|
+
"[error-context-new-utf16]" => Some(StringEncoding::UTF16),
|
|
2174
|
+
"[error-context-new-latin1+utf16]" => Some(StringEncoding::CompactUTF16),
|
|
2175
|
+
_ => None,
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
fn error_context_debug_message(&self, name: &str) -> Option<StringEncoding> {
|
|
2179
|
+
match name {
|
|
2180
|
+
"[error-context-debug-message-utf8]" => Some(StringEncoding::UTF8),
|
|
2181
|
+
"[error-context-debug-message-utf16]" => Some(StringEncoding::UTF16),
|
|
2182
|
+
"[error-context-debug-message-latin1+utf16]" => Some(StringEncoding::CompactUTF16),
|
|
2183
|
+
_ => None,
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
fn error_context_drop(&self, name: &str) -> bool {
|
|
2187
|
+
name == "[error-context-drop]"
|
|
2188
|
+
}
|
|
2189
|
+
fn context_get(&self, name: &str) -> Option<u32> {
|
|
2190
|
+
let (n, rest) = prefixed_integer(name, "[context-get-")?;
|
|
2191
|
+
if rest.is_empty() { Some(n) } else { None }
|
|
2192
|
+
}
|
|
2193
|
+
fn context_set(&self, name: &str) -> Option<u32> {
|
|
2194
|
+
let (n, rest) = prefixed_integer(name, "[context-set-")?;
|
|
2195
|
+
if rest.is_empty() { Some(n) } else { None }
|
|
2196
|
+
}
|
|
2197
|
+
fn thread_index(&self, name: &str) -> bool {
|
|
2198
|
+
name == "[thread-index]"
|
|
2199
|
+
}
|
|
2200
|
+
fn thread_new_indirect(&self, name: &str) -> bool {
|
|
2201
|
+
// For now, we'll fix the type of the start function and the table to extract it from
|
|
2202
|
+
name == "[thread-new-indirect-v0]"
|
|
2203
|
+
}
|
|
2204
|
+
fn thread_switch_to(&self, name: &str) -> Option<MaybeCancellable<()>> {
|
|
2205
|
+
self.match_with_cancellable_prefix(name, "[thread-switch-to]")
|
|
2206
|
+
}
|
|
2207
|
+
fn thread_suspend(&self, name: &str) -> Option<MaybeCancellable<()>> {
|
|
2208
|
+
self.match_with_cancellable_prefix(name, "[thread-suspend]")
|
|
2209
|
+
}
|
|
2210
|
+
fn thread_resume_later(&self, name: &str) -> bool {
|
|
2211
|
+
name == "[thread-resume-later]"
|
|
2212
|
+
}
|
|
2213
|
+
fn thread_yield_to(&self, name: &str) -> Option<MaybeCancellable<()>> {
|
|
2214
|
+
self.match_with_cancellable_prefix(name, "[thread-yield-to]")
|
|
2215
|
+
}
|
|
2216
|
+
fn future_new(&self, lookup_context: &PayloadLookupContext, name: &str) -> Option<PayloadInfo> {
|
|
2217
|
+
self.prefixed_payload(lookup_context, name, "[future-new-")
|
|
2218
|
+
}
|
|
2219
|
+
fn future_write(
|
|
2220
|
+
&self,
|
|
2221
|
+
lookup_context: &PayloadLookupContext,
|
|
2222
|
+
name: &str,
|
|
2223
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
2224
|
+
self.maybe_async_lowered_payload(lookup_context, name, "[future-write-")
|
|
2225
|
+
}
|
|
2226
|
+
fn future_read(
|
|
2227
|
+
&self,
|
|
2228
|
+
lookup_context: &PayloadLookupContext,
|
|
2229
|
+
name: &str,
|
|
2230
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
2231
|
+
self.maybe_async_lowered_payload(lookup_context, name, "[future-read-")
|
|
2232
|
+
}
|
|
2233
|
+
fn future_cancel_write(
|
|
2234
|
+
&self,
|
|
2235
|
+
lookup_context: &PayloadLookupContext,
|
|
2236
|
+
name: &str,
|
|
2237
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
2238
|
+
self.maybe_async_lowered_payload(lookup_context, name, "[future-cancel-write-")
|
|
2239
|
+
}
|
|
2240
|
+
fn future_cancel_read(
|
|
2241
|
+
&self,
|
|
2242
|
+
lookup_context: &PayloadLookupContext,
|
|
2243
|
+
name: &str,
|
|
2244
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
2245
|
+
self.maybe_async_lowered_payload(lookup_context, name, "[future-cancel-read-")
|
|
2246
|
+
}
|
|
2247
|
+
fn future_drop_writable(
|
|
2248
|
+
&self,
|
|
2249
|
+
lookup_context: &PayloadLookupContext,
|
|
2250
|
+
name: &str,
|
|
2251
|
+
) -> Option<PayloadInfo> {
|
|
2252
|
+
self.prefixed_payload(lookup_context, name, "[future-drop-writable-")
|
|
2253
|
+
}
|
|
2254
|
+
fn future_drop_readable(
|
|
2255
|
+
&self,
|
|
2256
|
+
lookup_context: &PayloadLookupContext,
|
|
2257
|
+
name: &str,
|
|
2258
|
+
) -> Option<PayloadInfo> {
|
|
2259
|
+
self.prefixed_payload(lookup_context, name, "[future-drop-readable-")
|
|
2260
|
+
}
|
|
2261
|
+
fn stream_new(&self, lookup_context: &PayloadLookupContext, name: &str) -> Option<PayloadInfo> {
|
|
2262
|
+
self.prefixed_payload(lookup_context, name, "[stream-new-")
|
|
2263
|
+
}
|
|
2264
|
+
fn stream_write(
|
|
2265
|
+
&self,
|
|
2266
|
+
lookup_context: &PayloadLookupContext,
|
|
2267
|
+
name: &str,
|
|
2268
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
2269
|
+
self.maybe_async_lowered_payload(lookup_context, name, "[stream-write-")
|
|
2270
|
+
}
|
|
2271
|
+
fn stream_read(
|
|
2272
|
+
&self,
|
|
2273
|
+
lookup_context: &PayloadLookupContext,
|
|
2274
|
+
name: &str,
|
|
2275
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
2276
|
+
self.maybe_async_lowered_payload(lookup_context, name, "[stream-read-")
|
|
2277
|
+
}
|
|
2278
|
+
fn stream_cancel_write(
|
|
2279
|
+
&self,
|
|
2280
|
+
lookup_context: &PayloadLookupContext,
|
|
2281
|
+
name: &str,
|
|
2282
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
2283
|
+
self.maybe_async_lowered_payload(lookup_context, name, "[stream-cancel-write-")
|
|
2284
|
+
}
|
|
2285
|
+
fn stream_cancel_read(
|
|
2286
|
+
&self,
|
|
2287
|
+
lookup_context: &PayloadLookupContext,
|
|
2288
|
+
name: &str,
|
|
2289
|
+
) -> Option<MaybeAsyncLowered<PayloadInfo>> {
|
|
2290
|
+
self.maybe_async_lowered_payload(lookup_context, name, "[stream-cancel-read-")
|
|
2291
|
+
}
|
|
2292
|
+
fn stream_drop_writable(
|
|
2293
|
+
&self,
|
|
2294
|
+
lookup_context: &PayloadLookupContext,
|
|
2295
|
+
name: &str,
|
|
2296
|
+
) -> Option<PayloadInfo> {
|
|
2297
|
+
self.prefixed_payload(lookup_context, name, "[stream-drop-writable-")
|
|
2298
|
+
}
|
|
2299
|
+
fn stream_drop_readable(
|
|
2300
|
+
&self,
|
|
2301
|
+
lookup_context: &PayloadLookupContext,
|
|
2302
|
+
name: &str,
|
|
2303
|
+
) -> Option<PayloadInfo> {
|
|
2304
|
+
self.prefixed_payload(lookup_context, name, "[stream-drop-readable-")
|
|
2305
|
+
}
|
|
2306
|
+
fn module_to_interface(
|
|
2307
|
+
&self,
|
|
2308
|
+
module: &str,
|
|
2309
|
+
resolve: &Resolve,
|
|
2310
|
+
items: &IndexMap<WorldKey, WorldItem>,
|
|
2311
|
+
) -> Result<(WorldKey, InterfaceId)> {
|
|
2312
|
+
// First see if this is a bare name
|
|
2313
|
+
let bare_name = WorldKey::Name(module.to_string());
|
|
2314
|
+
if let Some(WorldItem::Interface { id, .. }) = items.get(&bare_name) {
|
|
2315
|
+
return Ok((bare_name, *id));
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
// ... and if this isn't a bare name then it's time to do some parsing
|
|
2319
|
+
// related to interfaces, versions, and such. First up the `module` name
|
|
2320
|
+
// is parsed as a normal component name from `wasmparser` to see if it's
|
|
2321
|
+
// of the "interface kind". If it's not then that means the above match
|
|
2322
|
+
// should have been a hit but it wasn't, so an error is returned.
|
|
2323
|
+
let kebab_name = ComponentName::new(module, 0);
|
|
2324
|
+
let name = match kebab_name.as_ref().map(|k| k.kind()) {
|
|
2325
|
+
Ok(ComponentNameKind::Interface(name)) => name,
|
|
2326
|
+
_ => bail!("module requires an import interface named `{module}`"),
|
|
2327
|
+
};
|
|
2328
|
+
|
|
2329
|
+
// Prioritize an exact match based on versions, so try that first.
|
|
2330
|
+
let pkgname = PackageName {
|
|
2331
|
+
namespace: name.namespace().to_string(),
|
|
2332
|
+
name: name.package().to_string(),
|
|
2333
|
+
version: name.version(),
|
|
2334
|
+
};
|
|
2335
|
+
if let Some(pkg) = resolve.package_names.get(&pkgname) {
|
|
2336
|
+
if let Some(id) = resolve.packages[*pkg]
|
|
2337
|
+
.interfaces
|
|
2338
|
+
.get(name.interface().as_str())
|
|
2339
|
+
{
|
|
2340
|
+
let key = WorldKey::Interface(*id);
|
|
2341
|
+
if items.contains_key(&key) {
|
|
2342
|
+
return Ok((key, *id));
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
|
|
2347
|
+
// If an exact match wasn't found then instead search for the first
|
|
2348
|
+
// match based on versions. This means that a core wasm import for
|
|
2349
|
+
// "1.2.3" might end up matching an interface at "1.2.4", for example.
|
|
2350
|
+
// (or "1.2.2", depending on what's available).
|
|
2351
|
+
for (key, _) in items {
|
|
2352
|
+
let id = match key {
|
|
2353
|
+
WorldKey::Interface(id) => *id,
|
|
2354
|
+
WorldKey::Name(_) => continue,
|
|
2355
|
+
};
|
|
2356
|
+
// Make sure the interface names match
|
|
2357
|
+
let interface = &resolve.interfaces[id];
|
|
2358
|
+
if interface.name.as_ref().unwrap() != name.interface().as_str() {
|
|
2359
|
+
continue;
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
// Make sure the package name (without version) matches
|
|
2363
|
+
let pkg = &resolve.packages[interface.package.unwrap()];
|
|
2364
|
+
if pkg.name.namespace != pkgname.namespace || pkg.name.name != pkgname.name {
|
|
2365
|
+
continue;
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
let module_version = match name.version() {
|
|
2369
|
+
Some(version) => version,
|
|
2370
|
+
None => continue,
|
|
2371
|
+
};
|
|
2372
|
+
let pkg_version = match &pkg.name.version {
|
|
2373
|
+
Some(version) => version,
|
|
2374
|
+
None => continue,
|
|
2375
|
+
};
|
|
2376
|
+
|
|
2377
|
+
// Test if the two semver versions are compatible
|
|
2378
|
+
let module_compat = PackageName::version_compat_track(&module_version);
|
|
2379
|
+
let pkg_compat = PackageName::version_compat_track(pkg_version);
|
|
2380
|
+
if module_compat == pkg_compat {
|
|
2381
|
+
return Ok((key.clone(), id));
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
|
|
2385
|
+
bail!("module requires an import interface named `{module}`")
|
|
2386
|
+
}
|
|
2387
|
+
fn strip_post_return<'a>(&self, name: &'a str) -> Option<&'a str> {
|
|
2388
|
+
name.strip_prefix("cabi_post_")
|
|
2389
|
+
}
|
|
2390
|
+
fn match_wit_export<'a>(
|
|
2391
|
+
&self,
|
|
2392
|
+
export_name: &str,
|
|
2393
|
+
resolve: &'a Resolve,
|
|
2394
|
+
world: WorldId,
|
|
2395
|
+
exports: &'a IndexSet<WorldKey>,
|
|
2396
|
+
) -> Option<(&'a WorldKey, Option<InterfaceId>, &'a Function)> {
|
|
2397
|
+
let world = &resolve.worlds[world];
|
|
2398
|
+
for name in exports {
|
|
2399
|
+
match &world.exports[name] {
|
|
2400
|
+
WorldItem::Function(f) => {
|
|
2401
|
+
if f.legacy_core_export_name(None) == export_name {
|
|
2402
|
+
return Some((name, None, f));
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
WorldItem::Interface { id, .. } => {
|
|
2406
|
+
let string = resolve.name_world_key(name);
|
|
2407
|
+
for (_, func) in resolve.interfaces[*id].functions.iter() {
|
|
2408
|
+
if func.legacy_core_export_name(Some(&string)) == export_name {
|
|
2409
|
+
return Some((name, Some(*id), func));
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2414
|
+
WorldItem::Type(_) => unreachable!(),
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
None
|
|
2419
|
+
}
|
|
2420
|
+
|
|
2421
|
+
fn match_wit_resource_dtor<'a>(
|
|
2422
|
+
&self,
|
|
2423
|
+
export_name: &str,
|
|
2424
|
+
resolve: &'a Resolve,
|
|
2425
|
+
world: WorldId,
|
|
2426
|
+
exports: &'a IndexSet<WorldKey>,
|
|
2427
|
+
) -> Option<TypeId> {
|
|
2428
|
+
let world = &resolve.worlds[world];
|
|
2429
|
+
for name in exports {
|
|
2430
|
+
let id = match &world.exports[name] {
|
|
2431
|
+
WorldItem::Interface { id, .. } => *id,
|
|
2432
|
+
WorldItem::Function(_) => continue,
|
|
2433
|
+
WorldItem::Type(_) => unreachable!(),
|
|
2434
|
+
};
|
|
2435
|
+
let name = resolve.name_world_key(name);
|
|
2436
|
+
let resource = match export_name
|
|
2437
|
+
.strip_prefix(&name)
|
|
2438
|
+
.and_then(|s| s.strip_prefix("#[dtor]"))
|
|
2439
|
+
.and_then(|r| resolve.interfaces[id].types.get(r))
|
|
2440
|
+
{
|
|
2441
|
+
Some(id) => *id,
|
|
2442
|
+
None => continue,
|
|
2443
|
+
};
|
|
2444
|
+
|
|
2445
|
+
match resolve.types[resource].kind {
|
|
2446
|
+
TypeDefKind::Resource => {}
|
|
2447
|
+
_ => continue,
|
|
2448
|
+
}
|
|
2449
|
+
|
|
2450
|
+
return Some(resource);
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
None
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
fn world_key_name_and_abi<'a>(&self, name: &'a str) -> (&'a str, AbiVariant) {
|
|
2457
|
+
let (async_abi, name) = self.strip_async_lowered_prefix(name);
|
|
2458
|
+
(
|
|
2459
|
+
name,
|
|
2460
|
+
if async_abi {
|
|
2461
|
+
AbiVariant::GuestImportAsync
|
|
2462
|
+
} else {
|
|
2463
|
+
AbiVariant::GuestImport
|
|
2464
|
+
},
|
|
2465
|
+
)
|
|
2466
|
+
}
|
|
2467
|
+
fn interface_function_name_and_abi<'a>(&self, name: &'a str) -> (&'a str, AbiVariant) {
|
|
2468
|
+
let (async_abi, name) = self.strip_async_lowered_prefix(name);
|
|
2469
|
+
(
|
|
2470
|
+
name,
|
|
2471
|
+
if async_abi {
|
|
2472
|
+
AbiVariant::GuestImportAsync
|
|
2473
|
+
} else {
|
|
2474
|
+
AbiVariant::GuestImport
|
|
2475
|
+
},
|
|
2476
|
+
)
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2479
|
+
|
|
2480
|
+
/// This function validates the following:
|
|
2481
|
+
///
|
|
2482
|
+
/// * The `bytes` represent a valid core WebAssembly module.
|
|
2483
|
+
/// * The module's imports are all satisfied by the given `imports` interfaces
|
|
2484
|
+
/// or the `adapters` set.
|
|
2485
|
+
/// * The given default and exported interfaces are satisfied by the module's
|
|
2486
|
+
/// exports.
|
|
2487
|
+
///
|
|
2488
|
+
/// The `ValidatedModule` return value contains the metadata which describes the
|
|
2489
|
+
/// input module on success. This is then further used to generate a component
|
|
2490
|
+
/// for this module.
|
|
2491
|
+
pub fn validate_module(
|
|
2492
|
+
encoder: &ComponentEncoder,
|
|
2493
|
+
bytes: &[u8],
|
|
2494
|
+
import_map: Option<&ModuleImportMap>,
|
|
2495
|
+
) -> Result<ValidatedModule> {
|
|
2496
|
+
ValidatedModule::new(
|
|
2497
|
+
encoder,
|
|
2498
|
+
bytes,
|
|
2499
|
+
&encoder.main_module_exports,
|
|
2500
|
+
import_map,
|
|
2501
|
+
None,
|
|
2502
|
+
)
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2505
|
+
/// This function will validate the `bytes` provided as a wasm adapter module.
|
|
2506
|
+
/// Notably this will validate the wasm module itself in addition to ensuring
|
|
2507
|
+
/// that it has the "shape" of an adapter module. Current constraints are:
|
|
2508
|
+
///
|
|
2509
|
+
/// * The adapter module can import only one memory
|
|
2510
|
+
/// * The adapter module can only import from the name of `interface` specified,
|
|
2511
|
+
/// and all function imports must match the `required` types which correspond
|
|
2512
|
+
/// to the lowered types of the functions in `interface`.
|
|
2513
|
+
///
|
|
2514
|
+
/// The wasm module passed into this function is the output of the GC pass of an
|
|
2515
|
+
/// adapter module's original source. This means that the adapter module is
|
|
2516
|
+
/// already minimized and this is a double-check that the minimization pass
|
|
2517
|
+
/// didn't accidentally break the wasm module.
|
|
2518
|
+
///
|
|
2519
|
+
/// If `is_library` is true, we waive some of the constraints described above,
|
|
2520
|
+
/// allowing the module to import tables and globals, as well as import
|
|
2521
|
+
/// functions at the world level, not just at the interface level.
|
|
2522
|
+
pub fn validate_adapter_module(
|
|
2523
|
+
encoder: &ComponentEncoder,
|
|
2524
|
+
bytes: &[u8],
|
|
2525
|
+
required_by_import: &IndexMap<String, FuncType>,
|
|
2526
|
+
exports: &IndexSet<WorldKey>,
|
|
2527
|
+
library_info: Option<&LibraryInfo>,
|
|
2528
|
+
) -> Result<ValidatedModule> {
|
|
2529
|
+
let ret = ValidatedModule::new(encoder, bytes, exports, None, library_info)?;
|
|
2530
|
+
|
|
2531
|
+
for (name, required_ty) in required_by_import {
|
|
2532
|
+
let actual = match ret.exports.raw_exports.get(name) {
|
|
2533
|
+
Some(ty) => ty,
|
|
2534
|
+
None => return Err(AdapterModuleDidNotExport(name.clone()).into()),
|
|
2535
|
+
};
|
|
2536
|
+
validate_func_sig(name, required_ty, &actual)?;
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
Ok(ret)
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
/// An error that can be returned from adapting a core Wasm module into a
|
|
2543
|
+
/// component using an adapter module.
|
|
2544
|
+
///
|
|
2545
|
+
/// If the core Wasm module contained an import that it requires to be
|
|
2546
|
+
/// satisfied by the adapter, and the adapter does not contain an export
|
|
2547
|
+
/// with the same name, an instance of this error is returned.
|
|
2548
|
+
#[derive(Debug, Clone)]
|
|
2549
|
+
pub struct AdapterModuleDidNotExport(String);
|
|
2550
|
+
|
|
2551
|
+
impl fmt::Display for AdapterModuleDidNotExport {
|
|
2552
|
+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
2553
|
+
write!(f, "adapter module did not export `{}`", self.0)
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
impl std::error::Error for AdapterModuleDidNotExport {}
|
|
2558
|
+
|
|
2559
|
+
fn resource_test_for_interface<'a>(
|
|
2560
|
+
resolve: &'a Resolve,
|
|
2561
|
+
id: InterfaceId,
|
|
2562
|
+
) -> impl Fn(&str) -> Option<TypeId> + 'a {
|
|
2563
|
+
let interface = &resolve.interfaces[id];
|
|
2564
|
+
move |name: &str| {
|
|
2565
|
+
let ty = match interface.types.get(name) {
|
|
2566
|
+
Some(ty) => *ty,
|
|
2567
|
+
None => return None,
|
|
2568
|
+
};
|
|
2569
|
+
if matches!(resolve.types[ty].kind, TypeDefKind::Resource) {
|
|
2570
|
+
Some(ty)
|
|
2571
|
+
} else {
|
|
2572
|
+
None
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
fn resource_test_for_world<'a>(
|
|
2578
|
+
resolve: &'a Resolve,
|
|
2579
|
+
id: WorldId,
|
|
2580
|
+
) -> impl Fn(&str) -> Option<TypeId> + 'a {
|
|
2581
|
+
let world = &resolve.worlds[id];
|
|
2582
|
+
move |name: &str| match world.imports.get(&WorldKey::Name(name.to_string()))? {
|
|
2583
|
+
WorldItem::Type(r) => {
|
|
2584
|
+
if matches!(resolve.types[*r].kind, TypeDefKind::Resource) {
|
|
2585
|
+
Some(*r)
|
|
2586
|
+
} else {
|
|
2587
|
+
None
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
_ => None,
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
|
|
2594
|
+
fn validate_func(
|
|
2595
|
+
resolve: &Resolve,
|
|
2596
|
+
ty: &wasmparser::FuncType,
|
|
2597
|
+
func: &Function,
|
|
2598
|
+
abi: AbiVariant,
|
|
2599
|
+
) -> Result<()> {
|
|
2600
|
+
validate_func_sig(
|
|
2601
|
+
&func.name,
|
|
2602
|
+
&wasm_sig_to_func_type(resolve.wasm_signature(abi, func)),
|
|
2603
|
+
ty,
|
|
2604
|
+
)
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
fn validate_post_return(
|
|
2608
|
+
resolve: &Resolve,
|
|
2609
|
+
ty: &wasmparser::FuncType,
|
|
2610
|
+
func: &Function,
|
|
2611
|
+
) -> Result<()> {
|
|
2612
|
+
// The expected signature of a post-return function is to take all the
|
|
2613
|
+
// parameters that are returned by the guest function and then return no
|
|
2614
|
+
// results. Model this by calculating the signature of `func` and then
|
|
2615
|
+
// moving its results into the parameters list while emptying out the
|
|
2616
|
+
// results.
|
|
2617
|
+
let mut sig = resolve.wasm_signature(AbiVariant::GuestExport, func);
|
|
2618
|
+
sig.params = mem::take(&mut sig.results);
|
|
2619
|
+
validate_func_sig(
|
|
2620
|
+
&format!("{} post-return", func.name),
|
|
2621
|
+
&wasm_sig_to_func_type(sig),
|
|
2622
|
+
ty,
|
|
2623
|
+
)
|
|
2624
|
+
}
|
|
2625
|
+
|
|
2626
|
+
fn validate_func_sig(name: &str, expected: &FuncType, ty: &wasmparser::FuncType) -> Result<()> {
|
|
2627
|
+
if ty != expected {
|
|
2628
|
+
bail!(
|
|
2629
|
+
"type mismatch for function `{}`: expected `{:?} -> {:?}` but found `{:?} -> {:?}`",
|
|
2630
|
+
name,
|
|
2631
|
+
expected.params(),
|
|
2632
|
+
expected.results(),
|
|
2633
|
+
ty.params(),
|
|
2634
|
+
ty.results()
|
|
2635
|
+
);
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2638
|
+
Ok(())
|
|
2639
|
+
}
|
|
2640
|
+
|
|
2641
|
+
/// Matches `name` as `[${prefix}S]...`, and if found returns `("S", "...")`
|
|
2642
|
+
fn prefixed_intrinsic<'a>(name: &'a str, prefix: &str) -> Option<(&'a str, &'a str)> {
|
|
2643
|
+
assert!(prefix.starts_with("["));
|
|
2644
|
+
assert!(prefix.ends_with("-"));
|
|
2645
|
+
let suffix = name.strip_prefix(prefix)?;
|
|
2646
|
+
let index = suffix.find(']')?;
|
|
2647
|
+
let rest = &suffix[index + 1..];
|
|
2648
|
+
Some((&suffix[..index], rest))
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
/// Matches `name` as `[${prefix}N]...`, and if found returns `(N, "...")`
|
|
2652
|
+
fn prefixed_integer<'a>(name: &'a str, prefix: &str) -> Option<(u32, &'a str)> {
|
|
2653
|
+
let (suffix, rest) = prefixed_intrinsic(name, prefix)?;
|
|
2654
|
+
let n = suffix.parse().ok()?;
|
|
2655
|
+
Some((n, rest))
|
|
2656
|
+
}
|
|
2657
|
+
|
|
2658
|
+
fn get_function<'a>(
|
|
2659
|
+
resolve: &'a Resolve,
|
|
2660
|
+
world: &'a World,
|
|
2661
|
+
name: &str,
|
|
2662
|
+
interface: Option<InterfaceId>,
|
|
2663
|
+
imported: bool,
|
|
2664
|
+
) -> Result<&'a Function> {
|
|
2665
|
+
let function = if let Some(id) = interface {
|
|
2666
|
+
return resolve.interfaces[id]
|
|
2667
|
+
.functions
|
|
2668
|
+
.get(name)
|
|
2669
|
+
.ok_or_else(|| anyhow!("no export `{name}` found"));
|
|
2670
|
+
} else if imported {
|
|
2671
|
+
world.imports.get(&WorldKey::Name(name.to_string()))
|
|
2672
|
+
} else {
|
|
2673
|
+
world.exports.get(&WorldKey::Name(name.to_string()))
|
|
2674
|
+
};
|
|
2675
|
+
let Some(WorldItem::Function(function)) = function else {
|
|
2676
|
+
bail!("no export `{name}` found");
|
|
2677
|
+
};
|
|
2678
|
+
Ok(function)
|
|
2679
|
+
}
|