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.
Files changed (2165) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +6 -6
  3. data/README.md +1 -1
  4. data/ext/html-to-markdown-rb/native/Cargo.lock +254 -47
  5. data/ext/html-to-markdown-rb/native/Cargo.toml +1 -1
  6. data/lib/html_to_markdown/version.rb +1 -1
  7. data/rust-vendor/anyhow/.cargo-checksum.json +1 -0
  8. data/rust-vendor/anyhow/.cargo_vcs_info.json +6 -0
  9. data/rust-vendor/anyhow/.github/FUNDING.yml +1 -0
  10. data/rust-vendor/anyhow/.github/workflows/ci.yml +147 -0
  11. data/rust-vendor/anyhow/Cargo.lock +424 -0
  12. data/rust-vendor/anyhow/Cargo.toml +132 -0
  13. data/rust-vendor/anyhow/Cargo.toml.orig +40 -0
  14. data/rust-vendor/anyhow/LICENSE-APACHE +176 -0
  15. data/rust-vendor/anyhow/LICENSE-MIT +23 -0
  16. data/rust-vendor/anyhow/README.md +179 -0
  17. data/rust-vendor/anyhow/build.rs +207 -0
  18. data/rust-vendor/anyhow/rust-toolchain.toml +2 -0
  19. data/rust-vendor/anyhow/src/backtrace.rs +410 -0
  20. data/rust-vendor/anyhow/src/chain.rs +102 -0
  21. data/rust-vendor/anyhow/src/context.rs +193 -0
  22. data/rust-vendor/anyhow/src/ensure.rs +935 -0
  23. data/rust-vendor/anyhow/src/error.rs +1086 -0
  24. data/rust-vendor/anyhow/src/fmt.rs +158 -0
  25. data/rust-vendor/anyhow/src/kind.rs +121 -0
  26. data/rust-vendor/anyhow/src/lib.rs +728 -0
  27. data/rust-vendor/anyhow/src/macros.rs +245 -0
  28. data/rust-vendor/anyhow/src/nightly.rs +58 -0
  29. data/rust-vendor/anyhow/src/ptr.rs +187 -0
  30. data/rust-vendor/anyhow/src/wrapper.rs +84 -0
  31. data/rust-vendor/anyhow/tests/common/mod.rs +14 -0
  32. data/rust-vendor/anyhow/tests/compiletest.rs +7 -0
  33. data/rust-vendor/anyhow/tests/drop/mod.rs +53 -0
  34. data/rust-vendor/anyhow/tests/test_autotrait.rs +34 -0
  35. data/rust-vendor/anyhow/tests/test_backtrace.rs +15 -0
  36. data/rust-vendor/anyhow/tests/test_boxed.rs +45 -0
  37. data/rust-vendor/anyhow/tests/test_chain.rs +69 -0
  38. data/rust-vendor/anyhow/tests/test_context.rs +172 -0
  39. data/rust-vendor/anyhow/tests/test_convert.rs +46 -0
  40. data/rust-vendor/anyhow/tests/test_downcast.rs +123 -0
  41. data/rust-vendor/anyhow/tests/test_ensure.rs +756 -0
  42. data/rust-vendor/anyhow/tests/test_ffi.rs +19 -0
  43. data/rust-vendor/anyhow/tests/test_fmt.rs +93 -0
  44. data/rust-vendor/anyhow/tests/test_macros.rs +97 -0
  45. data/rust-vendor/anyhow/tests/test_repr.rs +30 -0
  46. data/rust-vendor/anyhow/tests/test_source.rs +62 -0
  47. data/rust-vendor/anyhow/tests/ui/chained-comparison.rs +8 -0
  48. data/rust-vendor/anyhow/tests/ui/chained-comparison.stderr +10 -0
  49. data/rust-vendor/anyhow/tests/ui/empty-ensure.rs +6 -0
  50. data/rust-vendor/anyhow/tests/ui/empty-ensure.stderr +12 -0
  51. data/rust-vendor/anyhow/tests/ui/ensure-nonbool.rs +40 -0
  52. data/rust-vendor/anyhow/tests/ui/ensure-nonbool.stderr +113 -0
  53. data/rust-vendor/anyhow/tests/ui/must-use.rs +11 -0
  54. data/rust-vendor/anyhow/tests/ui/must-use.stderr +15 -0
  55. data/rust-vendor/anyhow/tests/ui/no-impl.rs +8 -0
  56. data/rust-vendor/anyhow/tests/ui/no-impl.stderr +32 -0
  57. data/rust-vendor/anyhow/tests/ui/temporary-value.rs +5 -0
  58. data/rust-vendor/anyhow/tests/ui/temporary-value.stderr +15 -0
  59. data/rust-vendor/anyhow/tests/ui/wrong-interpolation.rs +5 -0
  60. data/rust-vendor/anyhow/tests/ui/wrong-interpolation.stderr +5 -0
  61. data/rust-vendor/bitflags/.cargo-checksum.json +1 -1
  62. data/rust-vendor/bitflags/.cargo_vcs_info.json +1 -1
  63. data/rust-vendor/bitflags/CHANGELOG.md +12 -0
  64. data/rust-vendor/bitflags/Cargo.lock +48 -48
  65. data/rust-vendor/bitflags/Cargo.toml +1 -1
  66. data/rust-vendor/bitflags/Cargo.toml.orig +1 -1
  67. data/rust-vendor/bitflags/README.md +1 -1
  68. data/rust-vendor/bitflags/src/external.rs +1 -1
  69. data/rust-vendor/bitflags/src/lib.rs +1 -1
  70. data/rust-vendor/bitflags/src/tests/known_bits.rs +47 -0
  71. data/rust-vendor/bitflags/src/tests/unknown_bits.rs +53 -0
  72. data/rust-vendor/bitflags/src/tests.rs +2 -0
  73. data/rust-vendor/bitflags/src/traits.rs +11 -1
  74. data/rust-vendor/cc/.cargo-checksum.json +1 -1
  75. data/rust-vendor/cc/.cargo_vcs_info.json +1 -1
  76. data/rust-vendor/cc/CHANGELOG.md +7 -0
  77. data/rust-vendor/cc/Cargo.lock +331 -7
  78. data/rust-vendor/cc/Cargo.toml +1 -1
  79. data/rust-vendor/cc/Cargo.toml.orig +1 -1
  80. data/rust-vendor/cc/src/lib.rs +10 -13
  81. data/rust-vendor/cc/src/target/generated.rs +1 -0
  82. data/rust-vendor/cpp_demangle/.cargo-checksum.json +1 -1
  83. data/rust-vendor/cpp_demangle/.cargo_vcs_info.json +1 -1
  84. data/rust-vendor/cpp_demangle/CHANGELOG.md +55 -0
  85. data/rust-vendor/cpp_demangle/Cargo.lock +5 -5
  86. data/rust-vendor/cpp_demangle/Cargo.toml +2 -2
  87. data/rust-vendor/cpp_demangle/Cargo.toml.orig +2 -2
  88. data/rust-vendor/cpp_demangle/README.md +9 -9
  89. data/rust-vendor/cpp_demangle/build.rs +10 -9
  90. data/rust-vendor/cpp_demangle/examples/cppfilt.rs +1 -1
  91. data/rust-vendor/cpp_demangle/examples/simple.rs +1 -1
  92. data/rust-vendor/cpp_demangle/src/ast.rs +238 -36
  93. data/rust-vendor/cpp_demangle/src/lib.rs +31 -46
  94. data/rust-vendor/cpp_demangle/src/subs.rs +1 -1
  95. data/rust-vendor/flate2/.cargo-checksum.json +1 -1
  96. data/rust-vendor/flate2/.cargo_vcs_info.json +1 -1
  97. data/rust-vendor/flate2/Cargo.lock +3 -3
  98. data/rust-vendor/flate2/Cargo.toml +13 -2
  99. data/rust-vendor/flate2/Cargo.toml.orig +16 -13
  100. data/rust-vendor/flate2/LICENSE-MIT +1 -1
  101. data/rust-vendor/flate2/src/crc.rs +177 -42
  102. data/rust-vendor/flate2/src/gz/mod.rs +159 -0
  103. data/rust-vendor/foldhash-0.1.5/.cargo-checksum.json +1 -0
  104. data/rust-vendor/foldhash-0.1.5/.cargo_vcs_info.json +6 -0
  105. data/rust-vendor/foldhash-0.1.5/Cargo.lock +852 -0
  106. data/rust-vendor/foldhash-0.1.5/Cargo.toml +76 -0
  107. data/rust-vendor/foldhash-0.1.5/Cargo.toml.orig +44 -0
  108. data/rust-vendor/foldhash-0.1.5/LICENSE +19 -0
  109. data/rust-vendor/foldhash-0.1.5/README.md +277 -0
  110. data/rust-vendor/foldhash-0.1.5/src/convenience.rs +73 -0
  111. data/rust-vendor/foldhash-0.1.5/src/fast.rs +270 -0
  112. data/rust-vendor/foldhash-0.1.5/src/lib.rs +284 -0
  113. data/rust-vendor/foldhash-0.1.5/src/quality.rs +174 -0
  114. data/rust-vendor/foldhash-0.1.5/src/seed.rs +267 -0
  115. data/rust-vendor/getrandom/.cargo-checksum.json +1 -1
  116. data/rust-vendor/getrandom/.cargo_vcs_info.json +1 -1
  117. data/rust-vendor/getrandom/CHANGELOG.md +39 -1
  118. data/rust-vendor/getrandom/Cargo.lock +451 -60
  119. data/rust-vendor/getrandom/Cargo.toml +44 -5
  120. data/rust-vendor/getrandom/Cargo.toml.orig +45 -10
  121. data/rust-vendor/getrandom/LICENSE-MIT +1 -1
  122. data/rust-vendor/getrandom/README.md +72 -40
  123. data/rust-vendor/getrandom/benches/buffer.rs +10 -8
  124. data/rust-vendor/getrandom/build.rs +1 -47
  125. data/rust-vendor/getrandom/src/backends/custom.rs +1 -1
  126. data/rust-vendor/getrandom/src/backends/efi_rng.rs +1 -1
  127. data/rust-vendor/getrandom/src/backends/esp_idf.rs +1 -1
  128. data/rust-vendor/getrandom/src/backends/extern_impl.rs +19 -0
  129. data/rust-vendor/getrandom/src/backends/fuchsia.rs +1 -1
  130. data/rust-vendor/getrandom/src/backends/getentropy.rs +4 -3
  131. data/rust-vendor/getrandom/src/backends/getrandom.rs +4 -12
  132. data/rust-vendor/getrandom/src/backends/hermit.rs +1 -1
  133. data/rust-vendor/getrandom/src/backends/linux_android_with_fallback.rs +8 -10
  134. data/rust-vendor/getrandom/src/backends/linux_raw.rs +101 -75
  135. data/rust-vendor/getrandom/src/backends/netbsd.rs +3 -3
  136. data/rust-vendor/getrandom/src/backends/rdrand.rs +26 -13
  137. data/rust-vendor/getrandom/src/backends/rndr.rs +13 -11
  138. data/rust-vendor/getrandom/src/backends/solaris.rs +5 -4
  139. data/rust-vendor/getrandom/src/backends/solid.rs +1 -1
  140. data/rust-vendor/getrandom/src/backends/use_file.rs +17 -28
  141. data/rust-vendor/getrandom/src/backends/vxworks.rs +2 -4
  142. data/rust-vendor/getrandom/src/backends/wasi_p1.rs +1 -1
  143. data/rust-vendor/getrandom/src/backends/wasi_p2_3.rs +61 -0
  144. data/rust-vendor/getrandom/src/backends/wasm_js.rs +1 -1
  145. data/rust-vendor/getrandom/src/backends/windows.rs +7 -11
  146. data/rust-vendor/getrandom/src/backends/windows_legacy.rs +1 -1
  147. data/rust-vendor/getrandom/src/backends.rs +9 -28
  148. data/rust-vendor/getrandom/src/error.rs +39 -6
  149. data/rust-vendor/getrandom/src/error_std_impls.rs +1 -3
  150. data/rust-vendor/getrandom/src/lib.rs +39 -18
  151. data/rust-vendor/getrandom/src/sys_rng.rs +55 -0
  152. data/rust-vendor/getrandom/src/util.rs +3 -15
  153. data/rust-vendor/getrandom/src/utils/get_errno.rs +29 -0
  154. data/rust-vendor/getrandom/src/utils/lazy.rs +64 -0
  155. data/rust-vendor/getrandom/src/utils/sanitizer.rs +28 -0
  156. data/rust-vendor/getrandom/src/utils/sys_fill_exact.rs +41 -0
  157. data/rust-vendor/getrandom/tests/mod.rs +6 -94
  158. data/rust-vendor/getrandom/tests/sys_rng.rs +18 -0
  159. data/rust-vendor/getrandom-0.3.4/.cargo-checksum.json +1 -0
  160. data/rust-vendor/getrandom-0.3.4/.cargo_vcs_info.json +6 -0
  161. data/rust-vendor/getrandom-0.3.4/CHANGELOG.md +673 -0
  162. data/rust-vendor/getrandom-0.3.4/Cargo.lock +292 -0
  163. data/rust-vendor/getrandom-0.3.4/Cargo.toml +133 -0
  164. data/rust-vendor/getrandom-0.3.4/Cargo.toml.orig +100 -0
  165. data/rust-vendor/getrandom-0.3.4/LICENSE-APACHE +201 -0
  166. data/rust-vendor/getrandom-0.3.4/LICENSE-MIT +26 -0
  167. data/rust-vendor/getrandom-0.3.4/README.md +386 -0
  168. data/rust-vendor/getrandom-0.3.4/SECURITY.md +13 -0
  169. data/rust-vendor/getrandom-0.3.4/benches/buffer.rs +121 -0
  170. data/rust-vendor/getrandom-0.3.4/build.rs +57 -0
  171. data/rust-vendor/getrandom-0.3.4/src/backends/apple_other.rs +21 -0
  172. data/rust-vendor/getrandom-0.3.4/src/backends/custom.rs +13 -0
  173. data/rust-vendor/getrandom-0.3.4/src/backends/efi_rng.rs +124 -0
  174. data/rust-vendor/getrandom-0.3.4/src/backends/esp_idf.rs +21 -0
  175. data/rust-vendor/getrandom-0.3.4/src/backends/fuchsia.rs +16 -0
  176. data/rust-vendor/getrandom-0.3.4/src/backends/getentropy.rs +27 -0
  177. data/rust-vendor/getrandom-0.3.4/src/backends/getrandom.rs +39 -0
  178. data/rust-vendor/getrandom-0.3.4/src/backends/hermit.rs +53 -0
  179. data/rust-vendor/getrandom-0.3.4/src/backends/linux_android_with_fallback.rs +103 -0
  180. data/rust-vendor/getrandom-0.3.4/src/backends/linux_raw.rs +143 -0
  181. data/rust-vendor/getrandom-0.3.4/src/backends/netbsd.rs +78 -0
  182. data/rust-vendor/getrandom-0.3.4/src/backends/rdrand.rs +182 -0
  183. data/rust-vendor/getrandom-0.3.4/src/backends/rndr.rs +145 -0
  184. data/rust-vendor/getrandom-0.3.4/src/backends/solaris.rs +42 -0
  185. data/rust-vendor/getrandom-0.3.4/src/backends/solid.rs +19 -0
  186. data/rust-vendor/getrandom-0.3.4/src/backends/unsupported.rs +9 -0
  187. data/rust-vendor/getrandom-0.3.4/src/backends/use_file.rs +234 -0
  188. data/rust-vendor/getrandom-0.3.4/src/backends/vxworks.rs +54 -0
  189. data/rust-vendor/getrandom-0.3.4/src/backends/wasi_p1.rs +32 -0
  190. data/rust-vendor/getrandom-0.3.4/src/backends/wasm_js.rs +72 -0
  191. data/rust-vendor/getrandom-0.3.4/src/backends/windows.rs +61 -0
  192. data/rust-vendor/getrandom-0.3.4/src/backends/windows_legacy.rs +48 -0
  193. data/rust-vendor/getrandom-0.3.4/src/backends.rs +209 -0
  194. data/rust-vendor/getrandom-0.3.4/src/error.rs +212 -0
  195. data/rust-vendor/getrandom-0.3.4/src/error_std_impls.rs +15 -0
  196. data/rust-vendor/getrandom-0.3.4/src/lib.rs +138 -0
  197. data/rust-vendor/getrandom-0.3.4/src/util.rs +84 -0
  198. data/rust-vendor/getrandom-0.3.4/tests/mod.rs +297 -0
  199. data/rust-vendor/hashbrown-0.15.5/.cargo-checksum.json +1 -0
  200. data/rust-vendor/hashbrown-0.15.5/.cargo_vcs_info.json +6 -0
  201. data/rust-vendor/hashbrown-0.15.5/CHANGELOG.md +619 -0
  202. data/rust-vendor/hashbrown-0.15.5/Cargo.lock +306 -0
  203. data/rust-vendor/hashbrown-0.15.5/Cargo.toml +164 -0
  204. data/rust-vendor/hashbrown-0.15.5/Cargo.toml.orig +77 -0
  205. data/rust-vendor/hashbrown-0.15.5/Cross.toml +3 -0
  206. data/rust-vendor/hashbrown-0.15.5/LICENSE-APACHE +201 -0
  207. data/rust-vendor/hashbrown-0.15.5/LICENSE-MIT +25 -0
  208. data/rust-vendor/hashbrown-0.15.5/README.md +80 -0
  209. data/rust-vendor/hashbrown-0.15.5/benches/bench.rs +329 -0
  210. data/rust-vendor/hashbrown-0.15.5/benches/insert_unique_unchecked.rs +34 -0
  211. data/rust-vendor/hashbrown-0.15.5/benches/set_ops.rs +148 -0
  212. data/rust-vendor/hashbrown-0.15.5/clippy.toml +1 -0
  213. data/rust-vendor/hashbrown-0.15.5/src/control/bitmask.rs +117 -0
  214. data/rust-vendor/hashbrown-0.15.5/src/control/group/generic.rs +154 -0
  215. data/rust-vendor/hashbrown-0.15.5/src/control/group/lsx.rs +137 -0
  216. data/rust-vendor/hashbrown-0.15.5/src/control/group/mod.rs +43 -0
  217. data/rust-vendor/hashbrown-0.15.5/src/control/group/neon.rs +121 -0
  218. data/rust-vendor/hashbrown-0.15.5/src/control/group/sse2.rs +146 -0
  219. data/rust-vendor/hashbrown-0.15.5/src/control/mod.rs +10 -0
  220. data/rust-vendor/hashbrown-0.15.5/src/control/tag.rs +83 -0
  221. data/rust-vendor/hashbrown-0.15.5/src/external_trait_impls/mod.rs +4 -0
  222. data/rust-vendor/hashbrown-0.15.5/src/external_trait_impls/rayon/helpers.rs +27 -0
  223. data/rust-vendor/hashbrown-0.15.5/src/external_trait_impls/rayon/map.rs +721 -0
  224. data/rust-vendor/hashbrown-0.15.5/src/external_trait_impls/rayon/mod.rs +5 -0
  225. data/rust-vendor/hashbrown-0.15.5/src/external_trait_impls/rayon/raw.rs +230 -0
  226. data/rust-vendor/hashbrown-0.15.5/src/external_trait_impls/rayon/set.rs +659 -0
  227. data/rust-vendor/hashbrown-0.15.5/src/external_trait_impls/rayon/table.rs +249 -0
  228. data/rust-vendor/hashbrown-0.15.5/src/external_trait_impls/serde.rs +220 -0
  229. data/rust-vendor/hashbrown-0.15.5/src/lib.rs +188 -0
  230. data/rust-vendor/hashbrown-0.15.5/src/macros.rs +70 -0
  231. data/rust-vendor/hashbrown-0.15.5/src/map.rs +6583 -0
  232. data/rust-vendor/hashbrown-0.15.5/src/raw/alloc.rs +92 -0
  233. data/rust-vendor/hashbrown-0.15.5/src/raw/mod.rs +4436 -0
  234. data/rust-vendor/hashbrown-0.15.5/src/raw_entry.rs +1740 -0
  235. data/rust-vendor/hashbrown-0.15.5/src/rustc_entry.rs +567 -0
  236. data/rust-vendor/hashbrown-0.15.5/src/scopeguard.rs +72 -0
  237. data/rust-vendor/hashbrown-0.15.5/src/set.rs +3121 -0
  238. data/rust-vendor/hashbrown-0.15.5/src/table.rs +2380 -0
  239. data/rust-vendor/hashbrown-0.15.5/src/util.rs +38 -0
  240. data/rust-vendor/hashbrown-0.15.5/tests/equivalent_trait.rs +53 -0
  241. data/rust-vendor/hashbrown-0.15.5/tests/hasher.rs +65 -0
  242. data/rust-vendor/hashbrown-0.15.5/tests/rayon.rs +535 -0
  243. data/rust-vendor/hashbrown-0.15.5/tests/serde.rs +65 -0
  244. data/rust-vendor/hashbrown-0.15.5/tests/set.rs +34 -0
  245. data/rust-vendor/heck/.cargo-checksum.json +1 -0
  246. data/rust-vendor/heck/.cargo_vcs_info.json +6 -0
  247. data/rust-vendor/heck/CHANGELOG.md +25 -0
  248. data/rust-vendor/heck/Cargo.toml +34 -0
  249. data/rust-vendor/heck/Cargo.toml.orig +11 -0
  250. data/rust-vendor/heck/LICENSE-APACHE +201 -0
  251. data/rust-vendor/heck/LICENSE-MIT +25 -0
  252. data/rust-vendor/heck/README.md +53 -0
  253. data/rust-vendor/heck/src/kebab.rs +75 -0
  254. data/rust-vendor/heck/src/lib.rs +192 -0
  255. data/rust-vendor/heck/src/lower_camel.rs +88 -0
  256. data/rust-vendor/heck/src/shouty_kebab.rs +73 -0
  257. data/rust-vendor/heck/src/shouty_snake.rs +86 -0
  258. data/rust-vendor/heck/src/snake.rs +100 -0
  259. data/rust-vendor/heck/src/title.rs +75 -0
  260. data/rust-vendor/heck/src/train.rs +87 -0
  261. data/rust-vendor/heck/src/upper_camel.rs +88 -0
  262. data/rust-vendor/html-to-markdown-rs/src/converter/inline/semantic/typography.rs +32 -22
  263. data/rust-vendor/html-to-markdown-rs/tests/integration_test.rs +44 -0
  264. data/rust-vendor/id-arena/.cargo-checksum.json +1 -0
  265. data/rust-vendor/id-arena/.cargo_vcs_info.json +6 -0
  266. data/rust-vendor/id-arena/.travis.yml +22 -0
  267. data/rust-vendor/id-arena/CHANGELOG.md +71 -0
  268. data/rust-vendor/id-arena/Cargo.lock +61 -0
  269. data/rust-vendor/id-arena/Cargo.toml +54 -0
  270. data/rust-vendor/id-arena/Cargo.toml.orig +21 -0
  271. data/rust-vendor/id-arena/LICENSE-APACHE +201 -0
  272. data/rust-vendor/id-arena/LICENSE-MIT +25 -0
  273. data/rust-vendor/id-arena/README.md +101 -0
  274. data/rust-vendor/id-arena/README.tpl +3 -0
  275. data/rust-vendor/id-arena/src/lib.rs +726 -0
  276. data/rust-vendor/id-arena/src/rayon.rs +282 -0
  277. data/rust-vendor/id-arena/tests/readme_up_to_date.rs +22 -0
  278. data/rust-vendor/leb128fmt/.cargo-checksum.json +1 -0
  279. data/rust-vendor/leb128fmt/.cargo_vcs_info.json +6 -0
  280. data/rust-vendor/leb128fmt/CHANGELOG.md +11 -0
  281. data/rust-vendor/leb128fmt/Cargo.toml +55 -0
  282. data/rust-vendor/leb128fmt/Cargo.toml.orig +32 -0
  283. data/rust-vendor/leb128fmt/LICENSE-APACHE +201 -0
  284. data/rust-vendor/leb128fmt/LICENSE-MIT +23 -0
  285. data/rust-vendor/leb128fmt/README.md +162 -0
  286. data/rust-vendor/leb128fmt/src/lib.rs +1650 -0
  287. data/rust-vendor/libc/.cargo-checksum.json +1 -1
  288. data/rust-vendor/libc/.cargo_vcs_info.json +1 -1
  289. data/rust-vendor/libc/CHANGELOG.md +42 -0
  290. data/rust-vendor/libc/Cargo.lock +1 -1
  291. data/rust-vendor/libc/Cargo.toml +75 -51
  292. data/rust-vendor/libc/Cargo.toml.orig +85 -53
  293. data/rust-vendor/libc/LICENSE-MIT +1 -1
  294. data/rust-vendor/libc/src/fuchsia/mod.rs +12 -10
  295. data/rust-vendor/libc/src/macros.rs +63 -71
  296. data/rust-vendor/libc/src/new/linux_uapi/linux/can/error.rs +73 -0
  297. data/rust-vendor/libc/src/new/linux_uapi/linux/can.rs +1 -0
  298. data/rust-vendor/libc/src/new/mod.rs +3 -2
  299. data/rust-vendor/libc/src/new/qurt/dlfcn.rs +26 -0
  300. data/rust-vendor/libc/src/new/qurt/fcntl.rs +4 -1
  301. data/rust-vendor/libc/src/new/qurt/mod.rs +224 -14
  302. data/rust-vendor/libc/src/new/qurt/pthread.rs +1 -22
  303. data/rust-vendor/libc/src/new/qurt/signal.rs +54 -4
  304. data/rust-vendor/libc/src/new/qurt/stdio.rs +0 -5
  305. data/rust-vendor/libc/src/new/qurt/sys/mman.rs +55 -0
  306. data/rust-vendor/libc/src/new/qurt/sys/mod.rs +2 -0
  307. data/rust-vendor/libc/src/new/qurt/sys/sched.rs +24 -0
  308. data/rust-vendor/libc/src/new/qurt/sys/stat.rs +0 -6
  309. data/rust-vendor/libc/src/new/qurt/time.rs +4 -22
  310. data/rust-vendor/libc/src/new/qurt/unistd.rs +210 -20
  311. data/rust-vendor/libc/src/qurt/mod.rs +9 -325
  312. data/rust-vendor/libc/src/types.rs +2 -2
  313. data/rust-vendor/libc/src/unix/aix/mod.rs +11 -20
  314. data/rust-vendor/libc/src/unix/aix/powerpc64.rs +6 -6
  315. data/rust-vendor/libc/src/unix/bsd/apple/mod.rs +15 -0
  316. data/rust-vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs +4 -4
  317. data/rust-vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs +3 -3
  318. data/rust-vendor/libc/src/unix/bsd/freebsdlike/mod.rs +14 -0
  319. data/rust-vendor/libc/src/unix/bsd/mod.rs +0 -14
  320. data/rust-vendor/libc/src/unix/bsd/netbsdlike/mod.rs +6 -0
  321. data/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs +15 -7
  322. data/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs +41 -1
  323. data/rust-vendor/libc/src/unix/cygwin/mod.rs +2 -2
  324. data/rust-vendor/libc/src/unix/haiku/mod.rs +1 -1
  325. data/rust-vendor/libc/src/unix/haiku/x86_64.rs +2 -2
  326. data/rust-vendor/libc/src/unix/hurd/mod.rs +6 -6
  327. data/rust-vendor/libc/src/unix/linux_like/android/mod.rs +2 -0
  328. data/rust-vendor/libc/src/unix/linux_like/linux/gnu/mod.rs +3 -0
  329. data/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs +16 -13
  330. data/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs +12 -13
  331. data/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs +25 -16
  332. data/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs +16 -13
  333. data/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs +12 -15
  334. data/rust-vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs +10 -13
  335. data/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs +0 -15
  336. data/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs +0 -15
  337. data/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs +0 -15
  338. data/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs +0 -15
  339. data/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs +0 -15
  340. data/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs +0 -15
  341. data/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/wasm32/mod.rs +0 -15
  342. data/rust-vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs +9 -15
  343. data/rust-vendor/libc/src/unix/mod.rs +87 -11
  344. data/rust-vendor/libc/src/unix/newlib/arm/mod.rs +1 -1
  345. data/rust-vendor/libc/src/unix/newlib/horizon/mod.rs +1 -1
  346. data/rust-vendor/libc/src/unix/newlib/vita/mod.rs +3 -3
  347. data/rust-vendor/libc/src/unix/nto/mod.rs +23 -6
  348. data/rust-vendor/libc/src/unix/redox/mod.rs +45 -3
  349. data/rust-vendor/libc/src/unix/solarish/illumos.rs +2 -0
  350. data/rust-vendor/libc/src/vxworks/mod.rs +7 -7
  351. data/rust-vendor/memchr/.cargo-checksum.json +1 -1
  352. data/rust-vendor/memchr/.cargo_vcs_info.json +1 -1
  353. data/rust-vendor/memchr/Cargo.lock +13 -13
  354. data/rust-vendor/memchr/Cargo.toml +1 -1
  355. data/rust-vendor/memchr/Cargo.toml.orig +1 -1
  356. data/rust-vendor/memchr/src/cow.rs +3 -1
  357. data/rust-vendor/memchr/src/memmem/mod.rs +42 -3
  358. data/rust-vendor/prettyplease/.cargo-checksum.json +1 -0
  359. data/rust-vendor/prettyplease/.cargo_vcs_info.json +6 -0
  360. data/rust-vendor/prettyplease/.github/FUNDING.yml +1 -0
  361. data/rust-vendor/prettyplease/.github/workflows/ci.yml +123 -0
  362. data/rust-vendor/prettyplease/Cargo.lock +54 -0
  363. data/rust-vendor/prettyplease/Cargo.toml +90 -0
  364. data/rust-vendor/prettyplease/Cargo.toml.orig +43 -0
  365. data/rust-vendor/prettyplease/LICENSE-APACHE +176 -0
  366. data/rust-vendor/prettyplease/LICENSE-MIT +23 -0
  367. data/rust-vendor/prettyplease/README.md +312 -0
  368. data/rust-vendor/prettyplease/build.rs +21 -0
  369. data/rust-vendor/prettyplease/examples/.tokeignore +1 -0
  370. data/rust-vendor/prettyplease/examples/input.rs +1 -0
  371. data/rust-vendor/prettyplease/examples/output.prettyplease.rs +593 -0
  372. data/rust-vendor/prettyplease/examples/output.rustc.rs +506 -0
  373. data/rust-vendor/prettyplease/examples/output.rustfmt.rs +552 -0
  374. data/rust-vendor/prettyplease/src/algorithm.rs +386 -0
  375. data/rust-vendor/prettyplease/src/attr.rs +288 -0
  376. data/rust-vendor/prettyplease/src/classify.rs +324 -0
  377. data/rust-vendor/prettyplease/src/convenience.rs +98 -0
  378. data/rust-vendor/prettyplease/src/data.rs +79 -0
  379. data/rust-vendor/prettyplease/src/expr.rs +1533 -0
  380. data/rust-vendor/prettyplease/src/file.rs +17 -0
  381. data/rust-vendor/prettyplease/src/fixup.rs +676 -0
  382. data/rust-vendor/prettyplease/src/generics.rs +426 -0
  383. data/rust-vendor/prettyplease/src/item.rs +1813 -0
  384. data/rust-vendor/prettyplease/src/iter.rs +46 -0
  385. data/rust-vendor/prettyplease/src/lib.rs +385 -0
  386. data/rust-vendor/prettyplease/src/lifetime.rs +9 -0
  387. data/rust-vendor/prettyplease/src/lit.rs +57 -0
  388. data/rust-vendor/prettyplease/src/mac.rs +706 -0
  389. data/rust-vendor/prettyplease/src/pat.rs +254 -0
  390. data/rust-vendor/prettyplease/src/path.rs +194 -0
  391. data/rust-vendor/prettyplease/src/precedence.rs +148 -0
  392. data/rust-vendor/prettyplease/src/ring.rs +81 -0
  393. data/rust-vendor/prettyplease/src/stmt.rs +221 -0
  394. data/rust-vendor/prettyplease/src/token.rs +80 -0
  395. data/rust-vendor/prettyplease/src/ty.rs +326 -0
  396. data/rust-vendor/prettyplease/tests/test.rs +51 -0
  397. data/rust-vendor/prettyplease/tests/test_precedence.rs +900 -0
  398. data/rust-vendor/regex/.cargo-checksum.json +1 -1
  399. data/rust-vendor/regex/.cargo_vcs_info.json +1 -1
  400. data/rust-vendor/regex/CHANGELOG.md +13 -0
  401. data/rust-vendor/regex/Cargo.lock +5 -5
  402. data/rust-vendor/regex/Cargo.toml +15 -7
  403. data/rust-vendor/regex/Cargo.toml.orig +19 -2
  404. data/rust-vendor/regex-automata/.cargo-checksum.json +1 -1
  405. data/rust-vendor/regex-automata/.cargo_vcs_info.json +1 -1
  406. data/rust-vendor/regex-automata/Cargo.lock +3 -3
  407. data/rust-vendor/regex-automata/Cargo.toml +16 -1
  408. data/rust-vendor/regex-automata/Cargo.toml.orig +2 -1
  409. data/rust-vendor/regex-automata/src/dfa/onepass.rs +21 -5
  410. data/rust-vendor/regex-automata/tests/dfa/onepass/mod.rs +1 -0
  411. data/rust-vendor/regex-automata/tests/dfa/onepass/regression.rs +61 -0
  412. data/rust-vendor/regex-automata/tests/nfa/thompson/backtrack/mod.rs +1 -0
  413. data/rust-vendor/regex-automata/tests/nfa/thompson/backtrack/regression.rs +20 -0
  414. data/rust-vendor/regex-automata/tests/nfa/thompson/pikevm/mod.rs +1 -0
  415. data/rust-vendor/regex-automata/tests/nfa/thompson/pikevm/regression.rs +20 -0
  416. data/rust-vendor/regex-syntax/.cargo-checksum.json +1 -1
  417. data/rust-vendor/regex-syntax/.cargo_vcs_info.json +1 -1
  418. data/rust-vendor/regex-syntax/Cargo.lock +1 -1
  419. data/rust-vendor/regex-syntax/Cargo.toml +16 -5
  420. data/rust-vendor/regex-syntax/Cargo.toml.orig +2 -1
  421. data/rust-vendor/semver/.cargo-checksum.json +1 -0
  422. data/rust-vendor/semver/.cargo_vcs_info.json +6 -0
  423. data/rust-vendor/semver/.github/FUNDING.yml +1 -0
  424. data/rust-vendor/semver/.github/workflows/ci.yml +140 -0
  425. data/rust-vendor/semver/Cargo.lock +75 -0
  426. data/rust-vendor/semver/Cargo.toml +86 -0
  427. data/rust-vendor/semver/Cargo.toml.orig +36 -0
  428. data/rust-vendor/semver/LICENSE-APACHE +176 -0
  429. data/rust-vendor/semver/LICENSE-MIT +23 -0
  430. data/rust-vendor/semver/README.md +84 -0
  431. data/rust-vendor/semver/benches/parse.rs +24 -0
  432. data/rust-vendor/semver/src/display.rs +163 -0
  433. data/rust-vendor/semver/src/error.rs +126 -0
  434. data/rust-vendor/semver/src/eval.rs +179 -0
  435. data/rust-vendor/semver/src/identifier.rs +412 -0
  436. data/rust-vendor/semver/src/impls.rs +163 -0
  437. data/rust-vendor/semver/src/lib.rs +570 -0
  438. data/rust-vendor/semver/src/parse.rs +404 -0
  439. data/rust-vendor/semver/src/serde.rs +109 -0
  440. data/rust-vendor/semver/tests/node/mod.rs +43 -0
  441. data/rust-vendor/semver/tests/test_autotrait.rs +14 -0
  442. data/rust-vendor/semver/tests/test_identifier.rs +51 -0
  443. data/rust-vendor/semver/tests/test_version.rs +251 -0
  444. data/rust-vendor/semver/tests/test_version_req.rs +480 -0
  445. data/rust-vendor/semver/tests/util/mod.rs +54 -0
  446. data/rust-vendor/symbolic-common/.cargo-checksum.json +1 -1
  447. data/rust-vendor/symbolic-common/Cargo.lock +74 -3
  448. data/rust-vendor/symbolic-common/Cargo.toml +2 -2
  449. data/rust-vendor/symbolic-common/Cargo.toml.orig +1 -1
  450. data/rust-vendor/symbolic-demangle/.cargo-checksum.json +1 -1
  451. data/rust-vendor/symbolic-demangle/Cargo.lock +87 -9
  452. data/rust-vendor/symbolic-demangle/Cargo.toml +5 -5
  453. data/rust-vendor/symbolic-demangle/Cargo.toml.orig +2 -2
  454. data/rust-vendor/syn/.cargo-checksum.json +1 -1
  455. data/rust-vendor/syn/.cargo_vcs_info.json +1 -1
  456. data/rust-vendor/syn/Cargo.lock +322 -109
  457. data/rust-vendor/syn/Cargo.toml +2 -2
  458. data/rust-vendor/syn/Cargo.toml.orig +2 -2
  459. data/rust-vendor/syn/benches/rust.rs +1 -2
  460. data/rust-vendor/syn/src/lib.rs +1 -1
  461. data/rust-vendor/syn/src/parse.rs +2 -2
  462. data/rust-vendor/syn/src/path.rs +1 -5
  463. data/rust-vendor/syn/tests/common/eq.rs +28 -17
  464. data/rust-vendor/syn/tests/common/parse.rs +1 -2
  465. data/rust-vendor/syn/tests/repo/progress.rs +1 -1
  466. data/rust-vendor/syn/tests/test_round_trip.rs +5 -36
  467. data/rust-vendor/tempfile/.cargo-checksum.json +1 -1
  468. data/rust-vendor/tempfile/.cargo_vcs_info.json +1 -1
  469. data/rust-vendor/tempfile/CHANGELOG.md +4 -0
  470. data/rust-vendor/tempfile/Cargo.lock +333 -21
  471. data/rust-vendor/tempfile/Cargo.toml +2 -2
  472. data/rust-vendor/tempfile/Cargo.toml.orig +2 -2
  473. data/rust-vendor/unicode-ident/.cargo-checksum.json +1 -1
  474. data/rust-vendor/unicode-ident/.cargo_vcs_info.json +1 -1
  475. data/rust-vendor/unicode-ident/.github/workflows/ci.yml +10 -10
  476. data/rust-vendor/unicode-ident/Cargo.lock +468 -186
  477. data/rust-vendor/unicode-ident/Cargo.toml +8 -8
  478. data/rust-vendor/unicode-ident/Cargo.toml.orig +7 -5
  479. data/rust-vendor/unicode-ident/src/lib.rs +1 -1
  480. data/rust-vendor/unicode-xid/.cargo-checksum.json +1 -0
  481. data/rust-vendor/unicode-xid/.cargo_vcs_info.json +6 -0
  482. data/rust-vendor/unicode-xid/COPYRIGHT +7 -0
  483. data/rust-vendor/unicode-xid/Cargo.toml +65 -0
  484. data/rust-vendor/unicode-xid/Cargo.toml.orig +34 -0
  485. data/rust-vendor/unicode-xid/LICENSE-APACHE +201 -0
  486. data/rust-vendor/unicode-xid/LICENSE-MIT +25 -0
  487. data/rust-vendor/unicode-xid/README.md +61 -0
  488. data/rust-vendor/unicode-xid/benches/xid.rs +60 -0
  489. data/rust-vendor/unicode-xid/src/lib.rs +90 -0
  490. data/rust-vendor/unicode-xid/src/tables.rs +1537 -0
  491. data/rust-vendor/unicode-xid/src/tests.rs +95 -0
  492. data/rust-vendor/unicode-xid/tests/exhaustive_tests.rs +25 -0
  493. data/rust-vendor/uuid/.cargo-checksum.json +1 -1
  494. data/rust-vendor/uuid/.cargo_vcs_info.json +1 -1
  495. data/rust-vendor/uuid/Cargo.lock +298 -44
  496. data/rust-vendor/uuid/Cargo.toml +5 -5
  497. data/rust-vendor/uuid/Cargo.toml.orig +5 -5
  498. data/rust-vendor/uuid/README.md +3 -3
  499. data/rust-vendor/uuid/src/error.rs +1 -7
  500. data/rust-vendor/uuid/src/lib.rs +4 -4
  501. data/rust-vendor/wasip3/.cargo-checksum.json +1 -0
  502. data/rust-vendor/wasip3/.cargo_vcs_info.json +6 -0
  503. data/rust-vendor/wasip3/Cargo.lock +483 -0
  504. data/rust-vendor/wasip3/Cargo.toml +96 -0
  505. data/rust-vendor/wasip3/Cargo.toml.orig +49 -0
  506. data/rust-vendor/wasip3/README.md +56 -0
  507. data/rust-vendor/wasip3/examples/cli-command.rs +19 -0
  508. data/rust-vendor/wasip3/examples/http-proxy-compat.rs +20 -0
  509. data/rust-vendor/wasip3/examples/http-proxy.rs +22 -0
  510. data/rust-vendor/wasip3/src/command.rs +513 -0
  511. data/rust-vendor/wasip3/src/http_compat/body_writer.rs +145 -0
  512. data/rust-vendor/wasip3/src/http_compat/conversions.rs +307 -0
  513. data/rust-vendor/wasip3/src/http_compat/mod.rs +314 -0
  514. data/rust-vendor/wasip3/src/imports.rs +10543 -0
  515. data/rust-vendor/wasip3/src/lib.rs +280 -0
  516. data/rust-vendor/wasip3/src/service.rs +7274 -0
  517. data/rust-vendor/wasip3/wit/deps/cli.wit +256 -0
  518. data/rust-vendor/wasip3/wit/deps/clocks.wit +161 -0
  519. data/rust-vendor/wasip3/wit/deps/filesystem.wit +553 -0
  520. data/rust-vendor/wasip3/wit/deps/http.wit +457 -0
  521. data/rust-vendor/wasip3/wit/deps/random.wit +92 -0
  522. data/rust-vendor/wasip3/wit/deps/sockets.wit +752 -0
  523. data/rust-vendor/wasip3/wit/wasi-crate.wit +1 -0
  524. data/rust-vendor/wasm-encoder/.cargo-checksum.json +1 -0
  525. data/rust-vendor/wasm-encoder/.cargo_vcs_info.json +6 -0
  526. data/rust-vendor/wasm-encoder/Cargo.lock +348 -0
  527. data/rust-vendor/wasm-encoder/Cargo.toml +104 -0
  528. data/rust-vendor/wasm-encoder/Cargo.toml.orig +43 -0
  529. data/rust-vendor/wasm-encoder/README.md +81 -0
  530. data/rust-vendor/wasm-encoder/src/component/aliases.rs +161 -0
  531. data/rust-vendor/wasm-encoder/src/component/builder.rs +826 -0
  532. data/rust-vendor/wasm-encoder/src/component/canonicals.rs +584 -0
  533. data/rust-vendor/wasm-encoder/src/component/components.rs +30 -0
  534. data/rust-vendor/wasm-encoder/src/component/exports.rs +130 -0
  535. data/rust-vendor/wasm-encoder/src/component/imports.rs +170 -0
  536. data/rust-vendor/wasm-encoder/src/component/instances.rs +200 -0
  537. data/rust-vendor/wasm-encoder/src/component/modules.rs +30 -0
  538. data/rust-vendor/wasm-encoder/src/component/names.rs +162 -0
  539. data/rust-vendor/wasm-encoder/src/component/start.rs +53 -0
  540. data/rust-vendor/wasm-encoder/src/component/types.rs +816 -0
  541. data/rust-vendor/wasm-encoder/src/component.rs +169 -0
  542. data/rust-vendor/wasm-encoder/src/core/branch_hints.rs +127 -0
  543. data/rust-vendor/wasm-encoder/src/core/code.rs +2464 -0
  544. data/rust-vendor/wasm-encoder/src/core/custom.rs +74 -0
  545. data/rust-vendor/wasm-encoder/src/core/data.rs +187 -0
  546. data/rust-vendor/wasm-encoder/src/core/dump.rs +629 -0
  547. data/rust-vendor/wasm-encoder/src/core/elements.rs +225 -0
  548. data/rust-vendor/wasm-encoder/src/core/exports.rs +86 -0
  549. data/rust-vendor/wasm-encoder/src/core/functions.rs +64 -0
  550. data/rust-vendor/wasm-encoder/src/core/globals.rs +101 -0
  551. data/rust-vendor/wasm-encoder/src/core/imports.rs +230 -0
  552. data/rust-vendor/wasm-encoder/src/core/instructions.rs +4686 -0
  553. data/rust-vendor/wasm-encoder/src/core/linking.rs +264 -0
  554. data/rust-vendor/wasm-encoder/src/core/memories.rs +116 -0
  555. data/rust-vendor/wasm-encoder/src/core/names.rs +305 -0
  556. data/rust-vendor/wasm-encoder/src/core/producers.rs +181 -0
  557. data/rust-vendor/wasm-encoder/src/core/start.rs +40 -0
  558. data/rust-vendor/wasm-encoder/src/core/tables.rs +130 -0
  559. data/rust-vendor/wasm-encoder/src/core/tags.rs +86 -0
  560. data/rust-vendor/wasm-encoder/src/core/types.rs +753 -0
  561. data/rust-vendor/wasm-encoder/src/core.rs +179 -0
  562. data/rust-vendor/wasm-encoder/src/lib.rs +224 -0
  563. data/rust-vendor/wasm-encoder/src/raw.rs +32 -0
  564. data/rust-vendor/wasm-encoder/src/reencode/component.rs +1548 -0
  565. data/rust-vendor/wasm-encoder/src/reencode.rs +2134 -0
  566. data/rust-vendor/wasm-metadata/.cargo-checksum.json +1 -0
  567. data/rust-vendor/wasm-metadata/.cargo_vcs_info.json +6 -0
  568. data/rust-vendor/wasm-metadata/Cargo.lock +769 -0
  569. data/rust-vendor/wasm-metadata/Cargo.toml +152 -0
  570. data/rust-vendor/wasm-metadata/Cargo.toml.orig +38 -0
  571. data/rust-vendor/wasm-metadata/README.md +27 -0
  572. data/rust-vendor/wasm-metadata/src/add_metadata.rs +91 -0
  573. data/rust-vendor/wasm-metadata/src/clap.rs +169 -0
  574. data/rust-vendor/wasm-metadata/src/dependencies.rs +142 -0
  575. data/rust-vendor/wasm-metadata/src/lib.rs +83 -0
  576. data/rust-vendor/wasm-metadata/src/metadata.rs +34 -0
  577. data/rust-vendor/wasm-metadata/src/names/component.rs +107 -0
  578. data/rust-vendor/wasm-metadata/src/names/mod.rs +5 -0
  579. data/rust-vendor/wasm-metadata/src/names/module.rs +101 -0
  580. data/rust-vendor/wasm-metadata/src/oci_annotations/authors.rs +111 -0
  581. data/rust-vendor/wasm-metadata/src/oci_annotations/description.rs +110 -0
  582. data/rust-vendor/wasm-metadata/src/oci_annotations/homepage.rs +118 -0
  583. data/rust-vendor/wasm-metadata/src/oci_annotations/licenses.rs +122 -0
  584. data/rust-vendor/wasm-metadata/src/oci_annotations/mod.rs +32 -0
  585. data/rust-vendor/wasm-metadata/src/oci_annotations/revision.rs +113 -0
  586. data/rust-vendor/wasm-metadata/src/oci_annotations/source.rs +117 -0
  587. data/rust-vendor/wasm-metadata/src/oci_annotations/version.rs +110 -0
  588. data/rust-vendor/wasm-metadata/src/payload.rs +215 -0
  589. data/rust-vendor/wasm-metadata/src/producers.rs +254 -0
  590. data/rust-vendor/wasm-metadata/src/rewrite.rs +224 -0
  591. data/rust-vendor/wasm-metadata/src/utils.rs +21 -0
  592. data/rust-vendor/wasm-metadata/tests/component.rs +310 -0
  593. data/rust-vendor/wasm-metadata/tests/module.rs +86 -0
  594. data/rust-vendor/wasmparser/.cargo-checksum.json +1 -0
  595. data/rust-vendor/wasmparser/.cargo_vcs_info.json +6 -0
  596. data/rust-vendor/wasmparser/Cargo.lock +687 -0
  597. data/rust-vendor/wasmparser/Cargo.toml +161 -0
  598. data/rust-vendor/wasmparser/Cargo.toml.orig +89 -0
  599. data/rust-vendor/wasmparser/README.md +28 -0
  600. data/rust-vendor/wasmparser/benches/.gitignore +1 -0
  601. data/rust-vendor/wasmparser/benches/benchmark.rs +395 -0
  602. data/rust-vendor/wasmparser/examples/simple.rs +37 -0
  603. data/rust-vendor/wasmparser/src/arity.rs +318 -0
  604. data/rust-vendor/wasmparser/src/binary_reader.rs +2109 -0
  605. data/rust-vendor/wasmparser/src/collections/hash.rs +120 -0
  606. data/rust-vendor/wasmparser/src/collections/index_map/detail.rs +1100 -0
  607. data/rust-vendor/wasmparser/src/collections/index_map/tests.rs +183 -0
  608. data/rust-vendor/wasmparser/src/collections/index_map.rs +653 -0
  609. data/rust-vendor/wasmparser/src/collections/index_set.rs +316 -0
  610. data/rust-vendor/wasmparser/src/collections/map.rs +852 -0
  611. data/rust-vendor/wasmparser/src/collections/mod.rs +34 -0
  612. data/rust-vendor/wasmparser/src/collections/set.rs +672 -0
  613. data/rust-vendor/wasmparser/src/features.rs +442 -0
  614. data/rust-vendor/wasmparser/src/lib.rs +1340 -0
  615. data/rust-vendor/wasmparser/src/limits.rs +90 -0
  616. data/rust-vendor/wasmparser/src/parser.rs +1925 -0
  617. data/rust-vendor/wasmparser/src/readers/component/aliases.rs +119 -0
  618. data/rust-vendor/wasmparser/src/readers/component/canonicals.rs +458 -0
  619. data/rust-vendor/wasmparser/src/readers/component/exports.rs +135 -0
  620. data/rust-vendor/wasmparser/src/readers/component/imports.rs +145 -0
  621. data/rust-vendor/wasmparser/src/readers/component/instances.rs +166 -0
  622. data/rust-vendor/wasmparser/src/readers/component/names.rs +101 -0
  623. data/rust-vendor/wasmparser/src/readers/component/start.rs +31 -0
  624. data/rust-vendor/wasmparser/src/readers/component/types.rs +537 -0
  625. data/rust-vendor/wasmparser/src/readers/component.rs +17 -0
  626. data/rust-vendor/wasmparser/src/readers/core/branch_hinting.rs +59 -0
  627. data/rust-vendor/wasmparser/src/readers/core/code.rs +177 -0
  628. data/rust-vendor/wasmparser/src/readers/core/coredumps.rs +274 -0
  629. data/rust-vendor/wasmparser/src/readers/core/custom.rs +134 -0
  630. data/rust-vendor/wasmparser/src/readers/core/data.rs +94 -0
  631. data/rust-vendor/wasmparser/src/readers/core/dylink0.rs +117 -0
  632. data/rust-vendor/wasmparser/src/readers/core/elements.rs +153 -0
  633. data/rust-vendor/wasmparser/src/readers/core/exports.rs +75 -0
  634. data/rust-vendor/wasmparser/src/readers/core/functions.rs +17 -0
  635. data/rust-vendor/wasmparser/src/readers/core/globals.rs +51 -0
  636. data/rust-vendor/wasmparser/src/readers/core/imports.rs +307 -0
  637. data/rust-vendor/wasmparser/src/readers/core/init.rs +70 -0
  638. data/rust-vendor/wasmparser/src/readers/core/linking.rs +457 -0
  639. data/rust-vendor/wasmparser/src/readers/core/memories.rs +61 -0
  640. data/rust-vendor/wasmparser/src/readers/core/names.rs +162 -0
  641. data/rust-vendor/wasmparser/src/readers/core/operators.rs +1105 -0
  642. data/rust-vendor/wasmparser/src/readers/core/producers.rs +84 -0
  643. data/rust-vendor/wasmparser/src/readers/core/reloc.rs +300 -0
  644. data/rust-vendor/wasmparser/src/readers/core/tables.rs +96 -0
  645. data/rust-vendor/wasmparser/src/readers/core/tags.rs +32 -0
  646. data/rust-vendor/wasmparser/src/readers/core/types/matches.rs +321 -0
  647. data/rust-vendor/wasmparser/src/readers/core/types.rs +2249 -0
  648. data/rust-vendor/wasmparser/src/readers/core.rs +43 -0
  649. data/rust-vendor/wasmparser/src/readers.rs +330 -0
  650. data/rust-vendor/wasmparser/src/resources.rs +265 -0
  651. data/rust-vendor/wasmparser/src/validator/component.rs +4765 -0
  652. data/rust-vendor/wasmparser/src/validator/component_types.rs +4036 -0
  653. data/rust-vendor/wasmparser/src/validator/core/canonical.rs +552 -0
  654. data/rust-vendor/wasmparser/src/validator/core.rs +1313 -0
  655. data/rust-vendor/wasmparser/src/validator/func.rs +613 -0
  656. data/rust-vendor/wasmparser/src/validator/names.rs +1017 -0
  657. data/rust-vendor/wasmparser/src/validator/operators/simd.rs +971 -0
  658. data/rust-vendor/wasmparser/src/validator/operators.rs +4696 -0
  659. data/rust-vendor/wasmparser/src/validator/types.rs +1327 -0
  660. data/rust-vendor/wasmparser/src/validator.rs +1645 -0
  661. data/rust-vendor/wasmparser/tests/big-module.rs +62 -0
  662. data/rust-vendor/wit-bindgen/.cargo-checksum.json +1 -1
  663. data/rust-vendor/wit-bindgen/.cargo_vcs_info.json +1 -1
  664. data/rust-vendor/wit-bindgen/Cargo.lock +76 -66
  665. data/rust-vendor/wit-bindgen/Cargo.toml +25 -11
  666. data/rust-vendor/wit-bindgen/Cargo.toml.orig +11 -3
  667. data/rust-vendor/wit-bindgen/src/lib.rs +21 -15
  668. data/rust-vendor/wit-bindgen/src/rt/async_support/abi_buffer.rs +35 -32
  669. data/rust-vendor/wit-bindgen/src/rt/async_support/cabi.rs +15 -20
  670. data/rust-vendor/wit-bindgen/src/rt/async_support/error_context.rs +11 -22
  671. data/rust-vendor/wit-bindgen/src/rt/async_support/future_support.rs +406 -146
  672. data/rust-vendor/wit-bindgen/src/rt/async_support/inter_task_wakeup.rs +98 -0
  673. data/rust-vendor/wit-bindgen/src/rt/async_support/inter_task_wakeup_disabled.rs +45 -0
  674. data/rust-vendor/wit-bindgen/src/rt/async_support/spawn.rs +82 -0
  675. data/rust-vendor/wit-bindgen/src/rt/async_support/spawn_disabled.rs +30 -0
  676. data/rust-vendor/wit-bindgen/src/rt/async_support/stream_support.rs +262 -122
  677. data/rust-vendor/wit-bindgen/src/rt/async_support/subtask.rs +49 -54
  678. data/rust-vendor/wit-bindgen/src/rt/async_support/unit_stream.rs +81 -0
  679. data/rust-vendor/wit-bindgen/src/rt/async_support/waitable.rs +47 -31
  680. data/rust-vendor/wit-bindgen/src/rt/async_support/waitable_set.rs +17 -35
  681. data/rust-vendor/wit-bindgen/src/rt/async_support.rs +262 -188
  682. data/rust-vendor/wit-bindgen/src/rt/mod.rs +14 -12
  683. data/rust-vendor/wit-bindgen/src/rt/wit_bindgen_cabi_realloc.c +2 -2
  684. data/rust-vendor/wit-bindgen/src/rt/wit_bindgen_cabi_realloc.o +0 -0
  685. data/rust-vendor/wit-bindgen/src/rt/wit_bindgen_cabi_realloc.rs +2 -2
  686. data/rust-vendor/wit-bindgen/src/rt/wit_bindgen_cabi_wasip3.o +0 -0
  687. data/rust-vendor/wit-bindgen-0.46.0/.cargo-checksum.json +1 -0
  688. data/rust-vendor/wit-bindgen-0.46.0/.cargo_vcs_info.json +6 -0
  689. data/rust-vendor/wit-bindgen-0.46.0/Cargo.lock +428 -0
  690. data/rust-vendor/wit-bindgen-0.46.0/Cargo.toml +88 -0
  691. data/rust-vendor/wit-bindgen-0.46.0/Cargo.toml.orig +37 -0
  692. data/rust-vendor/wit-bindgen-0.46.0/LICENSE-APACHE +201 -0
  693. data/rust-vendor/wit-bindgen-0.46.0/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
  694. data/rust-vendor/wit-bindgen-0.46.0/LICENSE-MIT +23 -0
  695. data/rust-vendor/wit-bindgen-0.46.0/README.md +45 -0
  696. data/rust-vendor/wit-bindgen-0.46.0/build.rs +32 -0
  697. data/rust-vendor/wit-bindgen-0.46.0/src/examples/_0_world_imports.rs +17 -0
  698. data/rust-vendor/wit-bindgen-0.46.0/src/examples/_1_interface_imports.rs +32 -0
  699. data/rust-vendor/wit-bindgen-0.46.0/src/examples/_2_imported_resources.rs +22 -0
  700. data/rust-vendor/wit-bindgen-0.46.0/src/examples/_3_world_exports.rs +47 -0
  701. data/rust-vendor/wit-bindgen-0.46.0/src/examples/_4_exported_resources.rs +26 -0
  702. data/rust-vendor/wit-bindgen-0.46.0/src/examples.rs +55 -0
  703. data/rust-vendor/wit-bindgen-0.46.0/src/lib.rs +881 -0
  704. data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/abi_buffer.rs +417 -0
  705. data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/cabi.rs +112 -0
  706. data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/error_context.rs +94 -0
  707. data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/future_support.rs +734 -0
  708. data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/stream_support.rs +604 -0
  709. data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/subtask.rs +289 -0
  710. data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/waitable.rs +466 -0
  711. data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/waitable_set.rs +100 -0
  712. data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support.rs +634 -0
  713. data/rust-vendor/wit-bindgen-0.46.0/src/rt/mod.rs +230 -0
  714. data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi_realloc.c +10 -0
  715. data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi_realloc.o +0 -0
  716. data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi_realloc.rs +11 -0
  717. data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi_wasip3.c +12 -0
  718. data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi_wasip3.o +0 -0
  719. data/rust-vendor/wit-bindgen-0.46.0/wasi-cli@0.2.0.wasm +0 -0
  720. data/rust-vendor/wit-bindgen-core/.cargo-checksum.json +1 -0
  721. data/rust-vendor/wit-bindgen-core/.cargo_vcs_info.json +6 -0
  722. data/rust-vendor/wit-bindgen-core/Cargo.lock +340 -0
  723. data/rust-vendor/wit-bindgen-core/Cargo.toml +75 -0
  724. data/rust-vendor/wit-bindgen-core/Cargo.toml.orig +30 -0
  725. data/rust-vendor/wit-bindgen-core/LICENSE-APACHE +201 -0
  726. data/rust-vendor/wit-bindgen-core/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
  727. data/rust-vendor/wit-bindgen-core/LICENSE-MIT +23 -0
  728. data/rust-vendor/wit-bindgen-core/src/abi.rs +2526 -0
  729. data/rust-vendor/wit-bindgen-core/src/async_.rs +200 -0
  730. data/rust-vendor/wit-bindgen-core/src/lib.rs +239 -0
  731. data/rust-vendor/wit-bindgen-core/src/ns.rs +27 -0
  732. data/rust-vendor/wit-bindgen-core/src/path.rs +47 -0
  733. data/rust-vendor/wit-bindgen-core/src/source.rs +222 -0
  734. data/rust-vendor/wit-bindgen-core/src/types.rs +232 -0
  735. data/rust-vendor/wit-bindgen-rust/.cargo-checksum.json +1 -0
  736. data/rust-vendor/wit-bindgen-rust/.cargo_vcs_info.json +6 -0
  737. data/rust-vendor/wit-bindgen-rust/Cargo.lock +547 -0
  738. data/rust-vendor/wit-bindgen-rust/Cargo.toml +112 -0
  739. data/rust-vendor/wit-bindgen-rust/Cargo.toml.orig +44 -0
  740. data/rust-vendor/wit-bindgen-rust/LICENSE-APACHE +201 -0
  741. data/rust-vendor/wit-bindgen-rust/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
  742. data/rust-vendor/wit-bindgen-rust/LICENSE-MIT +23 -0
  743. data/rust-vendor/wit-bindgen-rust/build.rs +4 -0
  744. data/rust-vendor/wit-bindgen-rust/src/bindgen.rs +1215 -0
  745. data/rust-vendor/wit-bindgen-rust/src/interface.rs +3020 -0
  746. data/rust-vendor/wit-bindgen-rust/src/lib.rs +1880 -0
  747. data/rust-vendor/wit-bindgen-rust/tests/codegen.rs +174 -0
  748. data/rust-vendor/wit-bindgen-rust/tests/wit/path1/world.wit +3 -0
  749. data/rust-vendor/wit-bindgen-rust/tests/wit/path2/world.wit +3 -0
  750. data/rust-vendor/wit-bindgen-rust/tests/wit/path3/package.wit +3 -0
  751. data/rust-vendor/wit-bindgen-rust-macro/.cargo-checksum.json +1 -0
  752. data/rust-vendor/wit-bindgen-rust-macro/.cargo_vcs_info.json +6 -0
  753. data/rust-vendor/wit-bindgen-rust-macro/Cargo.lock +306 -0
  754. data/rust-vendor/wit-bindgen-rust-macro/Cargo.toml +62 -0
  755. data/rust-vendor/wit-bindgen-rust-macro/Cargo.toml.orig +28 -0
  756. data/rust-vendor/wit-bindgen-rust-macro/LICENSE-APACHE +201 -0
  757. data/rust-vendor/wit-bindgen-rust-macro/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
  758. data/rust-vendor/wit-bindgen-rust-macro/LICENSE-MIT +23 -0
  759. data/rust-vendor/wit-bindgen-rust-macro/build.rs +5 -0
  760. data/rust-vendor/wit-bindgen-rust-macro/src/lib.rs +606 -0
  761. data/rust-vendor/wit-component/.cargo-checksum.json +1 -0
  762. data/rust-vendor/wit-component/.cargo_vcs_info.json +6 -0
  763. data/rust-vendor/wit-component/Cargo.lock +1823 -0
  764. data/rust-vendor/wit-component/Cargo.toml +217 -0
  765. data/rust-vendor/wit-component/Cargo.toml.orig +61 -0
  766. data/rust-vendor/wit-component/README.md +251 -0
  767. data/rust-vendor/wit-component/src/dummy.rs +395 -0
  768. data/rust-vendor/wit-component/src/encoding/dedupe.rs +164 -0
  769. data/rust-vendor/wit-component/src/encoding/types.rs +510 -0
  770. data/rust-vendor/wit-component/src/encoding/wit.rs +393 -0
  771. data/rust-vendor/wit-component/src/encoding/world.rs +525 -0
  772. data/rust-vendor/wit-component/src/encoding.rs +3231 -0
  773. data/rust-vendor/wit-component/src/gc.rs +1134 -0
  774. data/rust-vendor/wit-component/src/lib.rs +178 -0
  775. data/rust-vendor/wit-component/src/linking/metadata.rs +515 -0
  776. data/rust-vendor/wit-component/src/linking.rs +1727 -0
  777. data/rust-vendor/wit-component/src/metadata.rs +447 -0
  778. data/rust-vendor/wit-component/src/printing.rs +1485 -0
  779. data/rust-vendor/wit-component/src/semver_check.rs +113 -0
  780. data/rust-vendor/wit-component/src/targets.rs +44 -0
  781. data/rust-vendor/wit-component/src/validation.rs +2679 -0
  782. data/rust-vendor/wit-component/tests/.gitignore +2 -0
  783. data/rust-vendor/wit-component/tests/components/adapt-empty-interface/adapt-old.wat +3 -0
  784. data/rust-vendor/wit-component/tests/components/adapt-empty-interface/adapt-old.wit +5 -0
  785. data/rust-vendor/wit-component/tests/components/adapt-empty-interface/component.wat +60 -0
  786. data/rust-vendor/wit-component/tests/components/adapt-empty-interface/component.wit.print +4 -0
  787. data/rust-vendor/wit-component/tests/components/adapt-empty-interface/module.wat +3 -0
  788. data/rust-vendor/wit-component/tests/components/adapt-empty-interface/module.wit +2 -0
  789. data/rust-vendor/wit-component/tests/components/adapt-export-default/adapt-old.wat +4 -0
  790. data/rust-vendor/wit-component/tests/components/adapt-export-default/adapt-old.wit +3 -0
  791. data/rust-vendor/wit-component/tests/components/adapt-export-default/component.wat +32 -0
  792. data/rust-vendor/wit-component/tests/components/adapt-export-default/component.wit.print +5 -0
  793. data/rust-vendor/wit-component/tests/components/adapt-export-default/module.wat +3 -0
  794. data/rust-vendor/wit-component/tests/components/adapt-export-default/module.wit +2 -0
  795. data/rust-vendor/wit-component/tests/components/adapt-export-namespaced/adapt-old.wat +4 -0
  796. data/rust-vendor/wit-component/tests/components/adapt-export-namespaced/adapt-old.wit +7 -0
  797. data/rust-vendor/wit-component/tests/components/adapt-export-namespaced/component.wat +42 -0
  798. data/rust-vendor/wit-component/tests/components/adapt-export-namespaced/component.wit.print +5 -0
  799. data/rust-vendor/wit-component/tests/components/adapt-export-namespaced/module.wat +3 -0
  800. data/rust-vendor/wit-component/tests/components/adapt-export-namespaced/module.wit +3 -0
  801. data/rust-vendor/wit-component/tests/components/adapt-export-reallocs/adapt-old.wat +47 -0
  802. data/rust-vendor/wit-component/tests/components/adapt-export-reallocs/adapt-old.wit +6 -0
  803. data/rust-vendor/wit-component/tests/components/adapt-export-reallocs/component.wat +131 -0
  804. data/rust-vendor/wit-component/tests/components/adapt-export-reallocs/component.wit.print +9 -0
  805. data/rust-vendor/wit-component/tests/components/adapt-export-reallocs/module.wat +8 -0
  806. data/rust-vendor/wit-component/tests/components/adapt-export-reallocs/module.wit +3 -0
  807. data/rust-vendor/wit-component/tests/components/adapt-export-save-args/adapt-old.wat +13 -0
  808. data/rust-vendor/wit-component/tests/components/adapt-export-save-args/adapt-old.wit +3 -0
  809. data/rust-vendor/wit-component/tests/components/adapt-export-save-args/component.wat +86 -0
  810. data/rust-vendor/wit-component/tests/components/adapt-export-save-args/component.wit.print +5 -0
  811. data/rust-vendor/wit-component/tests/components/adapt-export-save-args/module.wat +4 -0
  812. data/rust-vendor/wit-component/tests/components/adapt-export-save-args/module.wit +2 -0
  813. data/rust-vendor/wit-component/tests/components/adapt-export-with-post-return/adapt-old.wat +33 -0
  814. data/rust-vendor/wit-component/tests/components/adapt-export-with-post-return/adapt-old.wit +7 -0
  815. data/rust-vendor/wit-component/tests/components/adapt-export-with-post-return/component.wat +101 -0
  816. data/rust-vendor/wit-component/tests/components/adapt-export-with-post-return/component.wit.print +5 -0
  817. data/rust-vendor/wit-component/tests/components/adapt-export-with-post-return/module.wat +9 -0
  818. data/rust-vendor/wit-component/tests/components/adapt-export-with-post-return/module.wit +3 -0
  819. data/rust-vendor/wit-component/tests/components/adapt-import-only-used-in-adapter/adapt-unused.wat +7 -0
  820. data/rust-vendor/wit-component/tests/components/adapt-import-only-used-in-adapter/adapt-unused.wit +9 -0
  821. data/rust-vendor/wit-component/tests/components/adapt-import-only-used-in-adapter/component.wat +115 -0
  822. data/rust-vendor/wit-component/tests/components/adapt-import-only-used-in-adapter/component.wit.print +9 -0
  823. data/rust-vendor/wit-component/tests/components/adapt-import-only-used-in-adapter/module.wat +5 -0
  824. data/rust-vendor/wit-component/tests/components/adapt-import-only-used-in-adapter/module.wit +6 -0
  825. data/rust-vendor/wit-component/tests/components/adapt-inject-stack/adapt-old.wat +54 -0
  826. data/rust-vendor/wit-component/tests/components/adapt-inject-stack/adapt-old.wit +5 -0
  827. data/rust-vendor/wit-component/tests/components/adapt-inject-stack/component.wat +163 -0
  828. data/rust-vendor/wit-component/tests/components/adapt-inject-stack/component.wit.print +7 -0
  829. data/rust-vendor/wit-component/tests/components/adapt-inject-stack/module.wat +4 -0
  830. data/rust-vendor/wit-component/tests/components/adapt-inject-stack/module.wit +2 -0
  831. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-adapt-realloc/adapt-old.wat +76 -0
  832. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-adapt-realloc/adapt-old.wit +5 -0
  833. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-adapt-realloc/component.wat +174 -0
  834. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-adapt-realloc/component.wit.print +7 -0
  835. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-adapt-realloc/module.wat +12 -0
  836. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-adapt-realloc/module.wit +2 -0
  837. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc/adapt-old.wat +76 -0
  838. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc/adapt-old.wit +5 -0
  839. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc/component.wat +199 -0
  840. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc/component.wit.print +7 -0
  841. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc/module.wat +38 -0
  842. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc/module.wit +3 -0
  843. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc-no-state/adapt-old.wat +68 -0
  844. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc-no-state/adapt-old.wit +5 -0
  845. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc-no-state/component.wat +216 -0
  846. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc-no-state/component.wit.print +7 -0
  847. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc-no-state/module.wat +38 -0
  848. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-realloc-no-state/module.wit +3 -0
  849. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-reallocing-adapter/adapt-old.wat +62 -0
  850. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-reallocing-adapter/adapt-old.wit +5 -0
  851. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-reallocing-adapter/component.wat +187 -0
  852. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-reallocing-adapter/component.wit.print +7 -0
  853. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-reallocing-adapter/module.wat +38 -0
  854. data/rust-vendor/wit-component/tests/components/adapt-inject-stack-with-reallocing-adapter/module.wit +2 -0
  855. data/rust-vendor/wit-component/tests/components/adapt-list-return/adapt-old.wat +14 -0
  856. data/rust-vendor/wit-component/tests/components/adapt-list-return/adapt-old.wit +5 -0
  857. data/rust-vendor/wit-component/tests/components/adapt-list-return/component.wat +104 -0
  858. data/rust-vendor/wit-component/tests/components/adapt-list-return/component.wit.print +7 -0
  859. data/rust-vendor/wit-component/tests/components/adapt-list-return/module.wat +4 -0
  860. data/rust-vendor/wit-component/tests/components/adapt-list-return/module.wit +3 -0
  861. data/rust-vendor/wit-component/tests/components/adapt-memory-simple/adapt-old.wat +4 -0
  862. data/rust-vendor/wit-component/tests/components/adapt-memory-simple/adapt-old.wit +5 -0
  863. data/rust-vendor/wit-component/tests/components/adapt-memory-simple/component.wat +92 -0
  864. data/rust-vendor/wit-component/tests/components/adapt-memory-simple/component.wit.print +7 -0
  865. data/rust-vendor/wit-component/tests/components/adapt-memory-simple/module.wat +4 -0
  866. data/rust-vendor/wit-component/tests/components/adapt-memory-simple/module.wit +2 -0
  867. data/rust-vendor/wit-component/tests/components/adapt-multiple/adapt-foo.wat +10 -0
  868. data/rust-vendor/wit-component/tests/components/adapt-multiple/adapt-foo.wit +8 -0
  869. data/rust-vendor/wit-component/tests/components/adapt-multiple/component.wat +107 -0
  870. data/rust-vendor/wit-component/tests/components/adapt-multiple/component.wit.print +10 -0
  871. data/rust-vendor/wit-component/tests/components/adapt-multiple/module.wat +4 -0
  872. data/rust-vendor/wit-component/tests/components/adapt-multiple/module.wit +2 -0
  873. data/rust-vendor/wit-component/tests/components/adapt-preview1/adapt-wasi-snapshot-preview1.wat +13 -0
  874. data/rust-vendor/wit-component/tests/components/adapt-preview1/adapt-wasi-snapshot-preview1.wit +12 -0
  875. data/rust-vendor/wit-component/tests/components/adapt-preview1/component.wat +119 -0
  876. data/rust-vendor/wit-component/tests/components/adapt-preview1/component.wit.print +8 -0
  877. data/rust-vendor/wit-component/tests/components/adapt-preview1/module.wat +11 -0
  878. data/rust-vendor/wit-component/tests/components/adapt-preview1/module.wit +7 -0
  879. data/rust-vendor/wit-component/tests/components/adapt-stub-wasip2/adapt-wasip2.wat +8 -0
  880. data/rust-vendor/wit-component/tests/components/adapt-stub-wasip2/adapt-wasip2.wit +1 -0
  881. data/rust-vendor/wit-component/tests/components/adapt-stub-wasip2/component.wat +74 -0
  882. data/rust-vendor/wit-component/tests/components/adapt-stub-wasip2/component.wit.print +4 -0
  883. data/rust-vendor/wit-component/tests/components/adapt-stub-wasip2/deps/cli/environment.wit +5 -0
  884. data/rust-vendor/wit-component/tests/components/adapt-stub-wasip2/module.wat +11 -0
  885. data/rust-vendor/wit-component/tests/components/adapt-stub-wasip2/module.wit +5 -0
  886. data/rust-vendor/wit-component/tests/components/adapt-unused/adapt-old.wat +4 -0
  887. data/rust-vendor/wit-component/tests/components/adapt-unused/adapt-old.wit +5 -0
  888. data/rust-vendor/wit-component/tests/components/adapt-unused/component.wat +12 -0
  889. data/rust-vendor/wit-component/tests/components/adapt-unused/component.wit.print +4 -0
  890. data/rust-vendor/wit-component/tests/components/adapt-unused/module.wat +1 -0
  891. data/rust-vendor/wit-component/tests/components/adapt-unused/module.wit +2 -0
  892. data/rust-vendor/wit-component/tests/components/async-builtins/component.wat +259 -0
  893. data/rust-vendor/wit-component/tests/components/async-builtins/component.wit.print +6 -0
  894. data/rust-vendor/wit-component/tests/components/async-builtins/module.wat +28 -0
  895. data/rust-vendor/wit-component/tests/components/async-builtins/module.wit +10 -0
  896. data/rust-vendor/wit-component/tests/components/async-export/component.wat +91 -0
  897. data/rust-vendor/wit-component/tests/components/async-export/component.wit.print +6 -0
  898. data/rust-vendor/wit-component/tests/components/async-export/module.wat +8 -0
  899. data/rust-vendor/wit-component/tests/components/async-export/module.wit +30 -0
  900. data/rust-vendor/wit-component/tests/components/async-export-with-callback/component.wat +59 -0
  901. data/rust-vendor/wit-component/tests/components/async-export-with-callback/component.wit.print +6 -0
  902. data/rust-vendor/wit-component/tests/components/async-export-with-callback/module.wat +8 -0
  903. data/rust-vendor/wit-component/tests/components/async-export-with-callback/module.wit +10 -0
  904. data/rust-vendor/wit-component/tests/components/async-import/component.wat +125 -0
  905. data/rust-vendor/wit-component/tests/components/async-import/component.wit.print +6 -0
  906. data/rust-vendor/wit-component/tests/components/async-import/module.wat +8 -0
  907. data/rust-vendor/wit-component/tests/components/async-import/module.wit +10 -0
  908. data/rust-vendor/wit-component/tests/components/async-import-only-intrinsic/component.wat +34 -0
  909. data/rust-vendor/wit-component/tests/components/async-import-only-intrinsic/component.wit.print +5 -0
  910. data/rust-vendor/wit-component/tests/components/async-import-only-intrinsic/module.wat +4 -0
  911. data/rust-vendor/wit-component/tests/components/async-import-only-intrinsic/module.wit +17 -0
  912. data/rust-vendor/wit-component/tests/components/async-import-tricky/component.wat +39 -0
  913. data/rust-vendor/wit-component/tests/components/async-import-tricky/component.wit.print +5 -0
  914. data/rust-vendor/wit-component/tests/components/async-import-tricky/module.wat +6 -0
  915. data/rust-vendor/wit-component/tests/components/async-import-tricky/module.wit +17 -0
  916. data/rust-vendor/wit-component/tests/components/async-streams-and-futures/component.wat +649 -0
  917. data/rust-vendor/wit-component/tests/components/async-streams-and-futures/component.wit.print +9 -0
  918. data/rust-vendor/wit-component/tests/components/async-streams-and-futures/module.wat +92 -0
  919. data/rust-vendor/wit-component/tests/components/async-streams-and-futures/module.wit +12 -0
  920. data/rust-vendor/wit-component/tests/components/async-unit-builtins/component.wat +138 -0
  921. data/rust-vendor/wit-component/tests/components/async-unit-builtins/component.wit.print +4 -0
  922. data/rust-vendor/wit-component/tests/components/async-unit-builtins/module.wat +18 -0
  923. data/rust-vendor/wit-component/tests/components/async-unit-builtins/module.wit +4 -0
  924. data/rust-vendor/wit-component/tests/components/bare-funcs/component.wat +93 -0
  925. data/rust-vendor/wit-component/tests/components/bare-funcs/component.wit.print +9 -0
  926. data/rust-vendor/wit-component/tests/components/bare-funcs/module.wat +13 -0
  927. data/rust-vendor/wit-component/tests/components/bare-funcs/module.wit +7 -0
  928. data/rust-vendor/wit-component/tests/components/cm32-names/component.wat +366 -0
  929. data/rust-vendor/wit-component/tests/components/cm32-names/component.wit.print +25 -0
  930. data/rust-vendor/wit-component/tests/components/cm32-names/module.wat +32 -0
  931. data/rust-vendor/wit-component/tests/components/cm32-names/module.wit +30 -0
  932. data/rust-vendor/wit-component/tests/components/custom-page-sizes/component.wat +23 -0
  933. data/rust-vendor/wit-component/tests/components/custom-page-sizes/component.wit.print +4 -0
  934. data/rust-vendor/wit-component/tests/components/custom-page-sizes/module.wat +12 -0
  935. data/rust-vendor/wit-component/tests/components/custom-page-sizes/module.wit +3 -0
  936. data/rust-vendor/wit-component/tests/components/deduplicate-imports/adapt-wasi-snapshot-preview1.wat +10 -0
  937. data/rust-vendor/wit-component/tests/components/deduplicate-imports/adapt-wasi-snapshot-preview1.wit +10 -0
  938. data/rust-vendor/wit-component/tests/components/deduplicate-imports/component.wat +132 -0
  939. data/rust-vendor/wit-component/tests/components/deduplicate-imports/component.wit.print +9 -0
  940. data/rust-vendor/wit-component/tests/components/deduplicate-imports/module.wat +40 -0
  941. data/rust-vendor/wit-component/tests/components/deduplicate-imports/module.wit +9 -0
  942. data/rust-vendor/wit-component/tests/components/empty/component.wat +12 -0
  943. data/rust-vendor/wit-component/tests/components/empty/component.wit.print +4 -0
  944. data/rust-vendor/wit-component/tests/components/empty/module.wat +1 -0
  945. data/rust-vendor/wit-component/tests/components/empty/module.wit +2 -0
  946. data/rust-vendor/wit-component/tests/components/ensure-default-type-exports/component.wat +50 -0
  947. data/rust-vendor/wit-component/tests/components/ensure-default-type-exports/component.wit.print +7 -0
  948. data/rust-vendor/wit-component/tests/components/ensure-default-type-exports/module.wat +6 -0
  949. data/rust-vendor/wit-component/tests/components/ensure-default-type-exports/module.wit +17 -0
  950. data/rust-vendor/wit-component/tests/components/error-adapt-missing-memory/adapt-old.wat +4 -0
  951. data/rust-vendor/wit-component/tests/components/error-adapt-missing-memory/adapt-old.wit +5 -0
  952. data/rust-vendor/wit-component/tests/components/error-adapt-missing-memory/error.txt +1 -0
  953. data/rust-vendor/wit-component/tests/components/error-adapt-missing-memory/module.wat +3 -0
  954. data/rust-vendor/wit-component/tests/components/error-adapt-missing-memory/module.wit +2 -0
  955. data/rust-vendor/wit-component/tests/components/error-async-export-missing-callback/error.txt +1 -0
  956. data/rust-vendor/wit-component/tests/components/error-async-export-missing-callback/module.wat +6 -0
  957. data/rust-vendor/wit-component/tests/components/error-async-export-missing-callback/module.wit +10 -0
  958. data/rust-vendor/wit-component/tests/components/error-default-export-sig-mismatch/error.txt +1 -0
  959. data/rust-vendor/wit-component/tests/components/error-default-export-sig-mismatch/module.wat +3 -0
  960. data/rust-vendor/wit-component/tests/components/error-default-export-sig-mismatch/module.wit +5 -0
  961. data/rust-vendor/wit-component/tests/components/error-empty-module-import/error.txt +1 -0
  962. data/rust-vendor/wit-component/tests/components/error-empty-module-import/module.wat +3 -0
  963. data/rust-vendor/wit-component/tests/components/error-empty-module-import/module.wit +2 -0
  964. data/rust-vendor/wit-component/tests/components/error-export-sig-mismatch/error.txt +1 -0
  965. data/rust-vendor/wit-component/tests/components/error-export-sig-mismatch/module.wat +3 -0
  966. data/rust-vendor/wit-component/tests/components/error-export-sig-mismatch/module.wit +7 -0
  967. data/rust-vendor/wit-component/tests/components/error-import-resource-rep/error.txt +1 -0
  968. data/rust-vendor/wit-component/tests/components/error-import-resource-rep/module.wat +3 -0
  969. data/rust-vendor/wit-component/tests/components/error-import-resource-rep/module.wit +5 -0
  970. data/rust-vendor/wit-component/tests/components/error-import-resource-wrong-signature/error.txt +1 -0
  971. data/rust-vendor/wit-component/tests/components/error-import-resource-wrong-signature/module.wat +3 -0
  972. data/rust-vendor/wit-component/tests/components/error-import-resource-wrong-signature/module.wit +5 -0
  973. data/rust-vendor/wit-component/tests/components/error-import-sig-mismatch/error.txt +1 -0
  974. data/rust-vendor/wit-component/tests/components/error-import-sig-mismatch/module.wat +3 -0
  975. data/rust-vendor/wit-component/tests/components/error-import-sig-mismatch/module.wit +7 -0
  976. data/rust-vendor/wit-component/tests/components/error-invalid-module-import/error.txt +1 -0
  977. data/rust-vendor/wit-component/tests/components/error-invalid-module-import/module.wat +3 -0
  978. data/rust-vendor/wit-component/tests/components/error-invalid-module-import/module.wit +2 -0
  979. data/rust-vendor/wit-component/tests/components/error-link-duplicate-initializers/error.txt +1 -0
  980. data/rust-vendor/wit-component/tests/components/error-link-duplicate-initializers/lib-bar.wat +12 -0
  981. data/rust-vendor/wit-component/tests/components/error-link-duplicate-initializers/lib-bar.wit +3 -0
  982. data/rust-vendor/wit-component/tests/components/error-link-duplicate-initializers/lib-foo.wat +21 -0
  983. data/rust-vendor/wit-component/tests/components/error-link-duplicate-initializers/lib-foo.wit +10 -0
  984. data/rust-vendor/wit-component/tests/components/error-link-missing-needed/error.txt +2 -0
  985. data/rust-vendor/wit-component/tests/components/error-link-missing-needed/lib-foo.wat +15 -0
  986. data/rust-vendor/wit-component/tests/components/error-link-missing-needed/lib-foo.wit +10 -0
  987. data/rust-vendor/wit-component/tests/components/error-link-missing-symbols/error.txt +3 -0
  988. data/rust-vendor/wit-component/tests/components/error-link-missing-symbols/lib-foo.wat +13 -0
  989. data/rust-vendor/wit-component/tests/components/error-link-missing-symbols/lib-foo.wit +10 -0
  990. data/rust-vendor/wit-component/tests/components/error-missing-default-export/error.txt +1 -0
  991. data/rust-vendor/wit-component/tests/components/error-missing-default-export/module.wat +1 -0
  992. data/rust-vendor/wit-component/tests/components/error-missing-default-export/module.wit +4 -0
  993. data/rust-vendor/wit-component/tests/components/error-missing-export/error.txt +1 -0
  994. data/rust-vendor/wit-component/tests/components/error-missing-export/module.wat +1 -0
  995. data/rust-vendor/wit-component/tests/components/error-missing-export/module.wit +7 -0
  996. data/rust-vendor/wit-component/tests/components/error-missing-import/error.txt +1 -0
  997. data/rust-vendor/wit-component/tests/components/error-missing-import/module.wat +3 -0
  998. data/rust-vendor/wit-component/tests/components/error-missing-import/module.wit +2 -0
  999. data/rust-vendor/wit-component/tests/components/error-missing-import-func/error.txt +1 -0
  1000. data/rust-vendor/wit-component/tests/components/error-missing-import-func/module.wat +3 -0
  1001. data/rust-vendor/wit-component/tests/components/error-missing-import-func/module.wit +9 -0
  1002. data/rust-vendor/wit-component/tests/components/error-missing-module-metadata/adapt-old.wat +4 -0
  1003. data/rust-vendor/wit-component/tests/components/error-missing-module-metadata/adapt-old.wit +5 -0
  1004. data/rust-vendor/wit-component/tests/components/error-missing-module-metadata/error.txt +1 -0
  1005. data/rust-vendor/wit-component/tests/components/error-missing-module-metadata/module.wat +4 -0
  1006. data/rust-vendor/wit-component/tests/components/error-missing-module-metadata/module.wit +4 -0
  1007. data/rust-vendor/wit-component/tests/components/export-interface-using-import/component.wat +37 -0
  1008. data/rust-vendor/wit-component/tests/components/export-interface-using-import/component.wit.print +9 -0
  1009. data/rust-vendor/wit-component/tests/components/export-interface-using-import/module.wat +1 -0
  1010. data/rust-vendor/wit-component/tests/components/export-interface-using-import/module.wit +17 -0
  1011. data/rust-vendor/wit-component/tests/components/export-name-shuffling/component.wat +43 -0
  1012. data/rust-vendor/wit-component/tests/components/export-name-shuffling/component.wit.print +10 -0
  1013. data/rust-vendor/wit-component/tests/components/export-name-shuffling/module.wat +3 -0
  1014. data/rust-vendor/wit-component/tests/components/export-name-shuffling/module.wit +17 -0
  1015. data/rust-vendor/wit-component/tests/components/export-resource/component.wat +102 -0
  1016. data/rust-vendor/wit-component/tests/components/export-resource/component.wit.print +10 -0
  1017. data/rust-vendor/wit-component/tests/components/export-resource/module.wat +15 -0
  1018. data/rust-vendor/wit-component/tests/components/export-resource/module.wit +11 -0
  1019. data/rust-vendor/wit-component/tests/components/export-type-name-conflict/component.wat +46 -0
  1020. data/rust-vendor/wit-component/tests/components/export-type-name-conflict/component.wit.print +11 -0
  1021. data/rust-vendor/wit-component/tests/components/export-type-name-conflict/module.wat +5 -0
  1022. data/rust-vendor/wit-component/tests/components/export-type-name-conflict/module.wit +15 -0
  1023. data/rust-vendor/wit-component/tests/components/export-with-type-alias/component.wat +40 -0
  1024. data/rust-vendor/wit-component/tests/components/export-with-type-alias/component.wit.print +5 -0
  1025. data/rust-vendor/wit-component/tests/components/export-with-type-alias/module.wat +3 -0
  1026. data/rust-vendor/wit-component/tests/components/export-with-type-alias/module.wit +11 -0
  1027. data/rust-vendor/wit-component/tests/components/exports/component.wat +139 -0
  1028. data/rust-vendor/wit-component/tests/components/exports/component.wit.print +29 -0
  1029. data/rust-vendor/wit-component/tests/components/exports/module.wat +14 -0
  1030. data/rust-vendor/wit-component/tests/components/exports/module.wit +29 -0
  1031. data/rust-vendor/wit-component/tests/components/fallible-constructor/component.wat +73 -0
  1032. data/rust-vendor/wit-component/tests/components/fallible-constructor/component.wit.print +9 -0
  1033. data/rust-vendor/wit-component/tests/components/fallible-constructor/module.wat +5 -0
  1034. data/rust-vendor/wit-component/tests/components/fallible-constructor/module.wit +9 -0
  1035. data/rust-vendor/wit-component/tests/components/import-and-export-resource/component.wat +53 -0
  1036. data/rust-vendor/wit-component/tests/components/import-and-export-resource/component.wit.print +8 -0
  1037. data/rust-vendor/wit-component/tests/components/import-and-export-resource/module.wat +6 -0
  1038. data/rust-vendor/wit-component/tests/components/import-and-export-resource/module.wit +12 -0
  1039. data/rust-vendor/wit-component/tests/components/import-conflict/component.wat +118 -0
  1040. data/rust-vendor/wit-component/tests/components/import-conflict/component.wit.print +7 -0
  1041. data/rust-vendor/wit-component/tests/components/import-conflict/module.wat +7 -0
  1042. data/rust-vendor/wit-component/tests/components/import-conflict/module.wit +19 -0
  1043. data/rust-vendor/wit-component/tests/components/import-empty-interface/component.wat +12 -0
  1044. data/rust-vendor/wit-component/tests/components/import-empty-interface/component.wit.print +4 -0
  1045. data/rust-vendor/wit-component/tests/components/import-empty-interface/module.wat +1 -0
  1046. data/rust-vendor/wit-component/tests/components/import-empty-interface/module.wit +5 -0
  1047. data/rust-vendor/wit-component/tests/components/import-export/component.wat +124 -0
  1048. data/rust-vendor/wit-component/tests/components/import-export/component.wit.print +14 -0
  1049. data/rust-vendor/wit-component/tests/components/import-export/module.wat +10 -0
  1050. data/rust-vendor/wit-component/tests/components/import-export/module.wit +14 -0
  1051. data/rust-vendor/wit-component/tests/components/import-export-same-iface-name/component.wat +59 -0
  1052. data/rust-vendor/wit-component/tests/components/import-export-same-iface-name/component.wit.print +8 -0
  1053. data/rust-vendor/wit-component/tests/components/import-export-same-iface-name/deps/dep/foo.wit +5 -0
  1054. data/rust-vendor/wit-component/tests/components/import-export-same-iface-name/module.wat +5 -0
  1055. data/rust-vendor/wit-component/tests/components/import-export-same-iface-name/module.wit +11 -0
  1056. data/rust-vendor/wit-component/tests/components/import-in-adapter-and-main-module/adapt-old.wat +23 -0
  1057. data/rust-vendor/wit-component/tests/components/import-in-adapter-and-main-module/adapt-old.wit +9 -0
  1058. data/rust-vendor/wit-component/tests/components/import-in-adapter-and-main-module/component.wat +220 -0
  1059. data/rust-vendor/wit-component/tests/components/import-in-adapter-and-main-module/component.wit.print +16 -0
  1060. data/rust-vendor/wit-component/tests/components/import-in-adapter-and-main-module/deps/shared-dependency/doc.wit +13 -0
  1061. data/rust-vendor/wit-component/tests/components/import-in-adapter-and-main-module/deps/shared-dependency/types.wit +3 -0
  1062. data/rust-vendor/wit-component/tests/components/import-in-adapter-and-main-module/module.wat +15 -0
  1063. data/rust-vendor/wit-component/tests/components/import-in-adapter-and-main-module/module.wit +11 -0
  1064. data/rust-vendor/wit-component/tests/components/import-only-resource-static-function/component.wat +30 -0
  1065. data/rust-vendor/wit-component/tests/components/import-only-resource-static-function/component.wit.print +5 -0
  1066. data/rust-vendor/wit-component/tests/components/import-only-resource-static-function/module.wat +3 -0
  1067. data/rust-vendor/wit-component/tests/components/import-only-resource-static-function/module.wit +11 -0
  1068. data/rust-vendor/wit-component/tests/components/import-partial-export-full/component.wat +34 -0
  1069. data/rust-vendor/wit-component/tests/components/import-partial-export-full/component.wit.print +8 -0
  1070. data/rust-vendor/wit-component/tests/components/import-partial-export-full/module.wat +1 -0
  1071. data/rust-vendor/wit-component/tests/components/import-partial-export-full/module.wit +19 -0
  1072. data/rust-vendor/wit-component/tests/components/import-resource-in-interface/component.wat +41 -0
  1073. data/rust-vendor/wit-component/tests/components/import-resource-in-interface/component.wit.print +10 -0
  1074. data/rust-vendor/wit-component/tests/components/import-resource-in-interface/module.wat +5 -0
  1075. data/rust-vendor/wit-component/tests/components/import-resource-in-interface/module.wit +11 -0
  1076. data/rust-vendor/wit-component/tests/components/import-resource-simple/component.wat +33 -0
  1077. data/rust-vendor/wit-component/tests/components/import-resource-simple/component.wit.print +8 -0
  1078. data/rust-vendor/wit-component/tests/components/import-resource-simple/module.wat +5 -0
  1079. data/rust-vendor/wit-component/tests/components/import-resource-simple/module.wit +9 -0
  1080. data/rust-vendor/wit-component/tests/components/imports/component.wat +149 -0
  1081. data/rust-vendor/wit-component/tests/components/imports/component.wit.print +29 -0
  1082. data/rust-vendor/wit-component/tests/components/imports/module.wat +12 -0
  1083. data/rust-vendor/wit-component/tests/components/imports/module.wit +33 -0
  1084. data/rust-vendor/wit-component/tests/components/initialize/component.wat +38 -0
  1085. data/rust-vendor/wit-component/tests/components/initialize/component.wit.print +5 -0
  1086. data/rust-vendor/wit-component/tests/components/initialize/module.wat +6 -0
  1087. data/rust-vendor/wit-component/tests/components/initialize/module.wit +5 -0
  1088. data/rust-vendor/wit-component/tests/components/lift-options/component.wat +286 -0
  1089. data/rust-vendor/wit-component/tests/components/lift-options/component.wit.print +5 -0
  1090. data/rust-vendor/wit-component/tests/components/lift-options/module.wat +24 -0
  1091. data/rust-vendor/wit-component/tests/components/lift-options/module.wit +40 -0
  1092. data/rust-vendor/wit-component/tests/components/link/component.wat +271 -0
  1093. data/rust-vendor/wit-component/tests/components/link/component.wit.print +7 -0
  1094. data/rust-vendor/wit-component/tests/components/link/lib-bar.wat +29 -0
  1095. data/rust-vendor/wit-component/tests/components/link/lib-bar.wit +10 -0
  1096. data/rust-vendor/wit-component/tests/components/link/lib-c.wat +27 -0
  1097. data/rust-vendor/wit-component/tests/components/link/lib-c.wit +3 -0
  1098. data/rust-vendor/wit-component/tests/components/link/lib-foo.wat +55 -0
  1099. data/rust-vendor/wit-component/tests/components/link/lib-foo.wit +3 -0
  1100. data/rust-vendor/wit-component/tests/components/link/lib-unused.wat +55 -0
  1101. data/rust-vendor/wit-component/tests/components/link/lib-unused.wit +3 -0
  1102. data/rust-vendor/wit-component/tests/components/link-asyncify/component.wat +267 -0
  1103. data/rust-vendor/wit-component/tests/components/link-asyncify/component.wit.print +5 -0
  1104. data/rust-vendor/wit-component/tests/components/link-asyncify/lib-bar.wat +81 -0
  1105. data/rust-vendor/wit-component/tests/components/link-asyncify/lib-bar.wit +9 -0
  1106. data/rust-vendor/wit-component/tests/components/link-asyncify/lib-foo.wat +78 -0
  1107. data/rust-vendor/wit-component/tests/components/link-asyncify/lib-foo.wit +3 -0
  1108. data/rust-vendor/wit-component/tests/components/link-bare-funcs/component.wat +212 -0
  1109. data/rust-vendor/wit-component/tests/components/link-bare-funcs/component.wit.print +9 -0
  1110. data/rust-vendor/wit-component/tests/components/link-bare-funcs/lib-c.wat +27 -0
  1111. data/rust-vendor/wit-component/tests/components/link-bare-funcs/lib-c.wit +3 -0
  1112. data/rust-vendor/wit-component/tests/components/link-bare-funcs/lib-foo.wat +18 -0
  1113. data/rust-vendor/wit-component/tests/components/link-bare-funcs/lib-foo.wit +7 -0
  1114. data/rust-vendor/wit-component/tests/components/link-circular/component.wat +133 -0
  1115. data/rust-vendor/wit-component/tests/components/link-circular/component.wit.print +7 -0
  1116. data/rust-vendor/wit-component/tests/components/link-circular/lib-bar.wat +12 -0
  1117. data/rust-vendor/wit-component/tests/components/link-circular/lib-bar.wit +3 -0
  1118. data/rust-vendor/wit-component/tests/components/link-circular/lib-foo.wat +15 -0
  1119. data/rust-vendor/wit-component/tests/components/link-circular/lib-foo.wit +10 -0
  1120. data/rust-vendor/wit-component/tests/components/link-dl-openable/component.wat +108 -0
  1121. data/rust-vendor/wit-component/tests/components/link-dl-openable/component.wit.print +7 -0
  1122. data/rust-vendor/wit-component/tests/components/link-dl-openable/dlopen-lib-foo.wat +15 -0
  1123. data/rust-vendor/wit-component/tests/components/link-dl-openable/dlopen-lib-foo.wit +10 -0
  1124. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl/component.wat +657 -0
  1125. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl/component.wit.print +7 -0
  1126. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl/dlopen-lib-foo.wat +17 -0
  1127. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl/dlopen-lib-foo.wit +10 -0
  1128. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl/lib-c.wat +30 -0
  1129. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl/lib-c.wit +3 -0
  1130. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl/stub-missing-functions +0 -0
  1131. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl/use-built-in-libdl +0 -0
  1132. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/component.wat +654 -0
  1133. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/component.wit.print +7 -0
  1134. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/dlopen-lib-foo.wat +19 -0
  1135. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/dlopen-lib-foo.wit +10 -0
  1136. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/lib-c.wat +39 -0
  1137. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/lib-c.wit +3 -0
  1138. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/lib-unused.wat +55 -0
  1139. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/lib-unused.wit +3 -0
  1140. data/rust-vendor/wit-component/tests/components/link-dl-openable-builtin-libdl-with-unused/use-built-in-libdl +0 -0
  1141. data/rust-vendor/wit-component/tests/components/link-duplicate-symbols/component.wat +135 -0
  1142. data/rust-vendor/wit-component/tests/components/link-duplicate-symbols/component.wit.print +7 -0
  1143. data/rust-vendor/wit-component/tests/components/link-duplicate-symbols/lib-bar.wat +13 -0
  1144. data/rust-vendor/wit-component/tests/components/link-duplicate-symbols/lib-bar.wit +3 -0
  1145. data/rust-vendor/wit-component/tests/components/link-duplicate-symbols/lib-foo.wat +15 -0
  1146. data/rust-vendor/wit-component/tests/components/link-duplicate-symbols/lib-foo.wit +10 -0
  1147. data/rust-vendor/wit-component/tests/components/link-got-func/component.wat +125 -0
  1148. data/rust-vendor/wit-component/tests/components/link-got-func/component.wit.print +7 -0
  1149. data/rust-vendor/wit-component/tests/components/link-got-func/lib-bar.wat +10 -0
  1150. data/rust-vendor/wit-component/tests/components/link-got-func/lib-bar.wit +3 -0
  1151. data/rust-vendor/wit-component/tests/components/link-got-func/lib-foo.wat +10 -0
  1152. data/rust-vendor/wit-component/tests/components/link-got-func/lib-foo.wit +10 -0
  1153. data/rust-vendor/wit-component/tests/components/link-initialize/component.wat +271 -0
  1154. data/rust-vendor/wit-component/tests/components/link-initialize/component.wit.print +7 -0
  1155. data/rust-vendor/wit-component/tests/components/link-initialize/lib-bar.wat +29 -0
  1156. data/rust-vendor/wit-component/tests/components/link-initialize/lib-bar.wit +10 -0
  1157. data/rust-vendor/wit-component/tests/components/link-initialize/lib-c.wat +27 -0
  1158. data/rust-vendor/wit-component/tests/components/link-initialize/lib-c.wit +3 -0
  1159. data/rust-vendor/wit-component/tests/components/link-initialize/lib-foo.wat +55 -0
  1160. data/rust-vendor/wit-component/tests/components/link-initialize/lib-foo.wit +3 -0
  1161. data/rust-vendor/wit-component/tests/components/link-lib-with-async-export/component.wat +148 -0
  1162. data/rust-vendor/wit-component/tests/components/link-lib-with-async-export/component.wit.print +19 -0
  1163. data/rust-vendor/wit-component/tests/components/link-lib-with-async-export/lib-c.wat +4 -0
  1164. data/rust-vendor/wit-component/tests/components/link-lib-with-async-export/lib-c.wit +3 -0
  1165. data/rust-vendor/wit-component/tests/components/link-lib-with-async-export/lib-foo.wat +12 -0
  1166. data/rust-vendor/wit-component/tests/components/link-lib-with-async-export/lib-foo.wit +16 -0
  1167. data/rust-vendor/wit-component/tests/components/link-resources/component.wat +150 -0
  1168. data/rust-vendor/wit-component/tests/components/link-resources/component.wit.print +6 -0
  1169. data/rust-vendor/wit-component/tests/components/link-resources/lib-bar.wat +15 -0
  1170. data/rust-vendor/wit-component/tests/components/link-resources/lib-bar.wit +13 -0
  1171. data/rust-vendor/wit-component/tests/components/link-resources/lib-foo.wat +17 -0
  1172. data/rust-vendor/wit-component/tests/components/link-resources/lib-foo.wit +13 -0
  1173. data/rust-vendor/wit-component/tests/components/link-stack-high-and-low/component.wat +146 -0
  1174. data/rust-vendor/wit-component/tests/components/link-stack-high-and-low/component.wit.print +5 -0
  1175. data/rust-vendor/wit-component/tests/components/link-stack-high-and-low/lib-bar.wat +19 -0
  1176. data/rust-vendor/wit-component/tests/components/link-stack-high-and-low/lib-bar.wit +9 -0
  1177. data/rust-vendor/wit-component/tests/components/link-stack-high-and-low/lib-foo.wat +17 -0
  1178. data/rust-vendor/wit-component/tests/components/link-stack-high-and-low/lib-foo.wit +3 -0
  1179. data/rust-vendor/wit-component/tests/components/link-stub-wasip2/adapt-wasip2.wat +8 -0
  1180. data/rust-vendor/wit-component/tests/components/link-stub-wasip2/adapt-wasip2.wit +1 -0
  1181. data/rust-vendor/wit-component/tests/components/link-stub-wasip2/component.wat +330 -0
  1182. data/rust-vendor/wit-component/tests/components/link-stub-wasip2/component.wit.print +7 -0
  1183. data/rust-vendor/wit-component/tests/components/link-stub-wasip2/deps/cli/environment.wit +5 -0
  1184. data/rust-vendor/wit-component/tests/components/link-stub-wasip2/lib-bar.wat +29 -0
  1185. data/rust-vendor/wit-component/tests/components/link-stub-wasip2/lib-bar.wit +10 -0
  1186. data/rust-vendor/wit-component/tests/components/link-stub-wasip2/lib-c.wat +29 -0
  1187. data/rust-vendor/wit-component/tests/components/link-stub-wasip2/lib-c.wit +5 -0
  1188. data/rust-vendor/wit-component/tests/components/link-stub-wasip2/lib-foo.wat +55 -0
  1189. data/rust-vendor/wit-component/tests/components/link-stub-wasip2/lib-foo.wit +3 -0
  1190. data/rust-vendor/wit-component/tests/components/link-stub-wasip2/lib-unused.wat +55 -0
  1191. data/rust-vendor/wit-component/tests/components/link-stub-wasip2/lib-unused.wit +3 -0
  1192. data/rust-vendor/wit-component/tests/components/link-stubs/component.wat +118 -0
  1193. data/rust-vendor/wit-component/tests/components/link-stubs/component.wit.print +7 -0
  1194. data/rust-vendor/wit-component/tests/components/link-stubs/lib-foo.wat +13 -0
  1195. data/rust-vendor/wit-component/tests/components/link-stubs/lib-foo.wit +10 -0
  1196. data/rust-vendor/wit-component/tests/components/link-stubs/stub-missing-functions +0 -0
  1197. data/rust-vendor/wit-component/tests/components/link-tag/component.wat +123 -0
  1198. data/rust-vendor/wit-component/tests/components/link-tag/component.wit.print +5 -0
  1199. data/rust-vendor/wit-component/tests/components/link-tag/lib-bar.wat +6 -0
  1200. data/rust-vendor/wit-component/tests/components/link-tag/lib-bar.wit +3 -0
  1201. data/rust-vendor/wit-component/tests/components/link-tag/lib-foo.wat +7 -0
  1202. data/rust-vendor/wit-component/tests/components/link-tag/lib-foo.wit +5 -0
  1203. data/rust-vendor/wit-component/tests/components/link-weak-cabi-realloc/component.wat +99 -0
  1204. data/rust-vendor/wit-component/tests/components/link-weak-cabi-realloc/component.wit.print +5 -0
  1205. data/rust-vendor/wit-component/tests/components/link-weak-cabi-realloc/lib-foo.wat +14 -0
  1206. data/rust-vendor/wit-component/tests/components/link-weak-cabi-realloc/lib-foo.wit +9 -0
  1207. data/rust-vendor/wit-component/tests/components/link-weak-import/component.wat +120 -0
  1208. data/rust-vendor/wit-component/tests/components/link-weak-import/component.wit.print +7 -0
  1209. data/rust-vendor/wit-component/tests/components/link-weak-import/lib-foo.wat +15 -0
  1210. data/rust-vendor/wit-component/tests/components/link-weak-import/lib-foo.wit +10 -0
  1211. data/rust-vendor/wit-component/tests/components/live-exports-dead-imports/component.wat +38 -0
  1212. data/rust-vendor/wit-component/tests/components/live-exports-dead-imports/component.wit.print +5 -0
  1213. data/rust-vendor/wit-component/tests/components/live-exports-dead-imports/module.wat +4 -0
  1214. data/rust-vendor/wit-component/tests/components/live-exports-dead-imports/module.wit +12 -0
  1215. data/rust-vendor/wit-component/tests/components/lower-options/component.wat +281 -0
  1216. data/rust-vendor/wit-component/tests/components/lower-options/component.wit.print +5 -0
  1217. data/rust-vendor/wit-component/tests/components/lower-options/module.wat +20 -0
  1218. data/rust-vendor/wit-component/tests/components/lower-options/module.wit +40 -0
  1219. data/rust-vendor/wit-component/tests/components/many-same-names/component.wat +48 -0
  1220. data/rust-vendor/wit-component/tests/components/many-same-names/component.wit.print +10 -0
  1221. data/rust-vendor/wit-component/tests/components/many-same-names/module.wat +3 -0
  1222. data/rust-vendor/wit-component/tests/components/many-same-names/module.wit +21 -0
  1223. data/rust-vendor/wit-component/tests/components/merge-import-versions/component.wat +125 -0
  1224. data/rust-vendor/wit-component/tests/components/merge-import-versions/component.wit.print +5 -0
  1225. data/rust-vendor/wit-component/tests/components/merge-import-versions/module.wat +15 -0
  1226. data/rust-vendor/wit-component/tests/components/merge-import-versions/module.wit +30 -0
  1227. data/rust-vendor/wit-component/tests/components/merge-import-versions-with-adapter/adapt-old.wat +10 -0
  1228. data/rust-vendor/wit-component/tests/components/merge-import-versions-with-adapter/adapt-old.wit +19 -0
  1229. data/rust-vendor/wit-component/tests/components/merge-import-versions-with-adapter/component.wat +104 -0
  1230. data/rust-vendor/wit-component/tests/components/merge-import-versions-with-adapter/component.wit.print +5 -0
  1231. data/rust-vendor/wit-component/tests/components/merge-import-versions-with-adapter/module.wat +9 -0
  1232. data/rust-vendor/wit-component/tests/components/merge-import-versions-with-adapter/module.wit +14 -0
  1233. data/rust-vendor/wit-component/tests/components/multi-package/baz/qux/component.wat +90 -0
  1234. data/rust-vendor/wit-component/tests/components/multi-package/baz/qux/component.wit.print +13 -0
  1235. data/rust-vendor/wit-component/tests/components/multi-package/baz/qux/module.wat +7 -0
  1236. data/rust-vendor/wit-component/tests/components/multi-package/component.wat +44 -0
  1237. data/rust-vendor/wit-component/tests/components/multi-package/component.wit.print +4 -0
  1238. data/rust-vendor/wit-component/tests/components/multi-package/foo/bar/component.wat +82 -0
  1239. data/rust-vendor/wit-component/tests/components/multi-package/foo/bar/component.wit.print +13 -0
  1240. data/rust-vendor/wit-component/tests/components/multi-package/foo/bar/module.wat +6 -0
  1241. data/rust-vendor/wit-component/tests/components/multi-package/module.wit +25 -0
  1242. data/rust-vendor/wit-component/tests/components/no-realloc-required/component.wat +67 -0
  1243. data/rust-vendor/wit-component/tests/components/no-realloc-required/component.wit.print +7 -0
  1244. data/rust-vendor/wit-component/tests/components/no-realloc-required/module.wat +4 -0
  1245. data/rust-vendor/wit-component/tests/components/no-realloc-required/module.wit +7 -0
  1246. data/rust-vendor/wit-component/tests/components/post-return/component.wat +36 -0
  1247. data/rust-vendor/wit-component/tests/components/post-return/component.wit.print +5 -0
  1248. data/rust-vendor/wit-component/tests/components/post-return/module.wat +6 -0
  1249. data/rust-vendor/wit-component/tests/components/post-return/module.wit +5 -0
  1250. data/rust-vendor/wit-component/tests/components/rename-import-interface/component.wat +29 -0
  1251. data/rust-vendor/wit-component/tests/components/rename-import-interface/component.wit.print +5 -0
  1252. data/rust-vendor/wit-component/tests/components/rename-import-interface/module.wat +3 -0
  1253. data/rust-vendor/wit-component/tests/components/rename-import-interface/module.wit +9 -0
  1254. data/rust-vendor/wit-component/tests/components/rename-interface/component.wat +39 -0
  1255. data/rust-vendor/wit-component/tests/components/rename-interface/component.wit.print +10 -0
  1256. data/rust-vendor/wit-component/tests/components/rename-interface/module.wat +3 -0
  1257. data/rust-vendor/wit-component/tests/components/rename-interface/module.wit +18 -0
  1258. data/rust-vendor/wit-component/tests/components/resource-intrinsics-with-just-import/component.wat +28 -0
  1259. data/rust-vendor/wit-component/tests/components/resource-intrinsics-with-just-import/component.wit.print +7 -0
  1260. data/rust-vendor/wit-component/tests/components/resource-intrinsics-with-just-import/module.wat +3 -0
  1261. data/rust-vendor/wit-component/tests/components/resource-intrinsics-with-just-import/module.wit +7 -0
  1262. data/rust-vendor/wit-component/tests/components/resource-used-through-import/component.wat +57 -0
  1263. data/rust-vendor/wit-component/tests/components/resource-used-through-import/component.wit.print +11 -0
  1264. data/rust-vendor/wit-component/tests/components/resource-used-through-import/module.wat +6 -0
  1265. data/rust-vendor/wit-component/tests/components/resource-used-through-import/module.wit +13 -0
  1266. data/rust-vendor/wit-component/tests/components/resource-using-export/component.wat +64 -0
  1267. data/rust-vendor/wit-component/tests/components/resource-using-export/component.wit.print +10 -0
  1268. data/rust-vendor/wit-component/tests/components/resource-using-export/module.wat +6 -0
  1269. data/rust-vendor/wit-component/tests/components/resource-using-export/module.wit +16 -0
  1270. data/rust-vendor/wit-component/tests/components/simple/component.wat +64 -0
  1271. data/rust-vendor/wit-component/tests/components/simple/component.wit.print +7 -0
  1272. data/rust-vendor/wit-component/tests/components/simple/module.wat +10 -0
  1273. data/rust-vendor/wit-component/tests/components/simple/module.wit +7 -0
  1274. data/rust-vendor/wit-component/tests/components/threading/component.wat +163 -0
  1275. data/rust-vendor/wit-component/tests/components/threading/component.wit.print +6 -0
  1276. data/rust-vendor/wit-component/tests/components/threading/module.wat +22 -0
  1277. data/rust-vendor/wit-component/tests/components/threading/module.wit +10 -0
  1278. data/rust-vendor/wit-component/tests/components/tricky-order/component.wat +44 -0
  1279. data/rust-vendor/wit-component/tests/components/tricky-order/component.wit.print +11 -0
  1280. data/rust-vendor/wit-component/tests/components/tricky-order/module.wat +1 -0
  1281. data/rust-vendor/wit-component/tests/components/tricky-order/module.wit +20 -0
  1282. data/rust-vendor/wit-component/tests/components/tricky-resources/component.wat +75 -0
  1283. data/rust-vendor/wit-component/tests/components/tricky-resources/component.wit.print +11 -0
  1284. data/rust-vendor/wit-component/tests/components/tricky-resources/module.wat +7 -0
  1285. data/rust-vendor/wit-component/tests/components/tricky-resources/module.wit +19 -0
  1286. data/rust-vendor/wit-component/tests/components/tricky-resources2/component.wat +50 -0
  1287. data/rust-vendor/wit-component/tests/components/tricky-resources2/component.wit.print +10 -0
  1288. data/rust-vendor/wit-component/tests/components/tricky-resources2/module.wat +4 -0
  1289. data/rust-vendor/wit-component/tests/components/tricky-resources2/module.wit +14 -0
  1290. data/rust-vendor/wit-component/tests/components/tricky-resources3/component.wat +44 -0
  1291. data/rust-vendor/wit-component/tests/components/tricky-resources3/component.wit.print +9 -0
  1292. data/rust-vendor/wit-component/tests/components/tricky-resources3/module.wat +1 -0
  1293. data/rust-vendor/wit-component/tests/components/tricky-resources3/module.wit +17 -0
  1294. data/rust-vendor/wit-component/tests/components/tricky-resources4/component.wat +64 -0
  1295. data/rust-vendor/wit-component/tests/components/tricky-resources4/component.wit.print +8 -0
  1296. data/rust-vendor/wit-component/tests/components/tricky-resources4/module.wat +6 -0
  1297. data/rust-vendor/wit-component/tests/components/tricky-resources4/module.wit +16 -0
  1298. data/rust-vendor/wit-component/tests/components/unused-import/component.wat +29 -0
  1299. data/rust-vendor/wit-component/tests/components/unused-import/component.wit.print +5 -0
  1300. data/rust-vendor/wit-component/tests/components/unused-import/module.wat +3 -0
  1301. data/rust-vendor/wit-component/tests/components/unused-import/module.wit +12 -0
  1302. data/rust-vendor/wit-component/tests/components/worlds-with-type-renamings/component.wat +67 -0
  1303. data/rust-vendor/wit-component/tests/components/worlds-with-type-renamings/component.wit.print +8 -0
  1304. data/rust-vendor/wit-component/tests/components/worlds-with-type-renamings/module.wat +12 -0
  1305. data/rust-vendor/wit-component/tests/components/worlds-with-type-renamings/module.wit +17 -0
  1306. data/rust-vendor/wit-component/tests/components/worlds-with-types/component.wat +25 -0
  1307. data/rust-vendor/wit-component/tests/components/worlds-with-types/component.wit.print +11 -0
  1308. data/rust-vendor/wit-component/tests/components/worlds-with-types/module.wat +3 -0
  1309. data/rust-vendor/wit-component/tests/components/worlds-with-types/module.wit +10 -0
  1310. data/rust-vendor/wit-component/tests/components.rs +291 -0
  1311. data/rust-vendor/wit-component/tests/interfaces/console.wat +18 -0
  1312. data/rust-vendor/wit-component/tests/interfaces/console.wit +5 -0
  1313. data/rust-vendor/wit-component/tests/interfaces/console.wit.print +6 -0
  1314. data/rust-vendor/wit-component/tests/interfaces/diamond-disambiguate/foo.wit.print +20 -0
  1315. data/rust-vendor/wit-component/tests/interfaces/diamond-disambiguate/join.wit +10 -0
  1316. data/rust-vendor/wit-component/tests/interfaces/diamond-disambiguate/shared1.wit +3 -0
  1317. data/rust-vendor/wit-component/tests/interfaces/diamond-disambiguate/shared2.wit +3 -0
  1318. data/rust-vendor/wit-component/tests/interfaces/diamond-disambiguate.wat +70 -0
  1319. data/rust-vendor/wit-component/tests/interfaces/diamond.wat +107 -0
  1320. data/rust-vendor/wit-component/tests/interfaces/diamond.wit +31 -0
  1321. data/rust-vendor/wit-component/tests/interfaces/diamond.wit.print +34 -0
  1322. data/rust-vendor/wit-component/tests/interfaces/doc-comments/foo.wit +79 -0
  1323. data/rust-vendor/wit-component/tests/interfaces/doc-comments/foo.wit.print +78 -0
  1324. data/rust-vendor/wit-component/tests/interfaces/doc-comments.wat +73 -0
  1325. data/rust-vendor/wit-component/tests/interfaces/empty.wat +50 -0
  1326. data/rust-vendor/wit-component/tests/interfaces/empty.wit +12 -0
  1327. data/rust-vendor/wit-component/tests/interfaces/empty.wit.print +16 -0
  1328. data/rust-vendor/wit-component/tests/interfaces/export-other-packages-interface/deps/the-dep/the-doc.wit +9 -0
  1329. data/rust-vendor/wit-component/tests/interfaces/export-other-packages-interface/foo.wit +5 -0
  1330. data/rust-vendor/wit-component/tests/interfaces/export-other-packages-interface/foo.wit.print +5 -0
  1331. data/rust-vendor/wit-component/tests/interfaces/export-other-packages-interface.wat +23 -0
  1332. data/rust-vendor/wit-component/tests/interfaces/exports.wat +39 -0
  1333. data/rust-vendor/wit-component/tests/interfaces/exports.wit +13 -0
  1334. data/rust-vendor/wit-component/tests/interfaces/exports.wit.print +13 -0
  1335. data/rust-vendor/wit-component/tests/interfaces/flags.wat +79 -0
  1336. data/rust-vendor/wit-component/tests/interfaces/flags.wit +100 -0
  1337. data/rust-vendor/wit-component/tests/interfaces/flags.wit.print +100 -0
  1338. data/rust-vendor/wit-component/tests/interfaces/floats.wat +47 -0
  1339. data/rust-vendor/wit-component/tests/interfaces/floats.wit +12 -0
  1340. data/rust-vendor/wit-component/tests/interfaces/floats.wit.print +15 -0
  1341. data/rust-vendor/wit-component/tests/interfaces/foreign-use-chain/deps/bar/bar.wit +9 -0
  1342. data/rust-vendor/wit-component/tests/interfaces/foreign-use-chain/foo.wit +5 -0
  1343. data/rust-vendor/wit-component/tests/interfaces/foreign-use-chain/foo.wit.print +6 -0
  1344. data/rust-vendor/wit-component/tests/interfaces/foreign-use-chain.wat +31 -0
  1345. data/rust-vendor/wit-component/tests/interfaces/import-and-export.wat +54 -0
  1346. data/rust-vendor/wit-component/tests/interfaces/import-and-export.wit +14 -0
  1347. data/rust-vendor/wit-component/tests/interfaces/import-and-export.wit.print +15 -0
  1348. data/rust-vendor/wit-component/tests/interfaces/integers.wat +107 -0
  1349. data/rust-vendor/wit-component/tests/interfaces/integers.wit +27 -0
  1350. data/rust-vendor/wit-component/tests/interfaces/integers.wit.print +45 -0
  1351. data/rust-vendor/wit-component/tests/interfaces/lists.wat +211 -0
  1352. data/rust-vendor/wit-component/tests/interfaces/lists.wit +96 -0
  1353. data/rust-vendor/wit-component/tests/interfaces/lists.wit.print +96 -0
  1354. data/rust-vendor/wit-component/tests/interfaces/maps.wat +186 -0
  1355. data/rust-vendor/wit-component/tests/interfaces/maps.wit +38 -0
  1356. data/rust-vendor/wit-component/tests/interfaces/maps.wit.print +57 -0
  1357. data/rust-vendor/wit-component/tests/interfaces/multi-doc/a.wit +9 -0
  1358. data/rust-vendor/wit-component/tests/interfaces/multi-doc/b.wit +9 -0
  1359. data/rust-vendor/wit-component/tests/interfaces/multi-doc/foo.wit.print +20 -0
  1360. data/rust-vendor/wit-component/tests/interfaces/multi-doc.wat +78 -0
  1361. data/rust-vendor/wit-component/tests/interfaces/multiple-use.wat +67 -0
  1362. data/rust-vendor/wit-component/tests/interfaces/multiple-use.wit +16 -0
  1363. data/rust-vendor/wit-component/tests/interfaces/multiple-use.wit.print +18 -0
  1364. data/rust-vendor/wit-component/tests/interfaces/pkg-use-chain/chain.wit.print +18 -0
  1365. data/rust-vendor/wit-component/tests/interfaces/pkg-use-chain/def.wit +13 -0
  1366. data/rust-vendor/wit-component/tests/interfaces/pkg-use-chain/the-use.wit +5 -0
  1367. data/rust-vendor/wit-component/tests/interfaces/pkg-use-chain.wat +70 -0
  1368. data/rust-vendor/wit-component/tests/interfaces/pkg-use-chain2/bar.wit +13 -0
  1369. data/rust-vendor/wit-component/tests/interfaces/pkg-use-chain2/foo.wit +5 -0
  1370. data/rust-vendor/wit-component/tests/interfaces/pkg-use-chain2/foo.wit.print +20 -0
  1371. data/rust-vendor/wit-component/tests/interfaces/pkg-use-chain2.wat +70 -0
  1372. data/rust-vendor/wit-component/tests/interfaces/preserve-dep-type-order/deps/dep/foo.wit +11 -0
  1373. data/rust-vendor/wit-component/tests/interfaces/preserve-dep-type-order/foo.wit +9 -0
  1374. data/rust-vendor/wit-component/tests/interfaces/preserve-dep-type-order/foo.wit.print +9 -0
  1375. data/rust-vendor/wit-component/tests/interfaces/preserve-dep-type-order.wat +47 -0
  1376. data/rust-vendor/wit-component/tests/interfaces/preserve-foreign-reexport/deps/my-dep/my-doc.wit +8 -0
  1377. data/rust-vendor/wit-component/tests/interfaces/preserve-foreign-reexport/foo.wit +5 -0
  1378. data/rust-vendor/wit-component/tests/interfaces/preserve-foreign-reexport/foo.wit.print +5 -0
  1379. data/rust-vendor/wit-component/tests/interfaces/preserve-foreign-reexport.wat +24 -0
  1380. data/rust-vendor/wit-component/tests/interfaces/print-keyword.wat +21 -0
  1381. data/rust-vendor/wit-component/tests/interfaces/print-keyword.wit +10 -0
  1382. data/rust-vendor/wit-component/tests/interfaces/print-keyword.wit.print +12 -0
  1383. data/rust-vendor/wit-component/tests/interfaces/records.wat +141 -0
  1384. data/rust-vendor/wit-component/tests/interfaces/records.wit +63 -0
  1385. data/rust-vendor/wit-component/tests/interfaces/records.wit.print +64 -0
  1386. data/rust-vendor/wit-component/tests/interfaces/reference-out-of-order.wat +63 -0
  1387. data/rust-vendor/wit-component/tests/interfaces/reference-out-of-order.wit +28 -0
  1388. data/rust-vendor/wit-component/tests/interfaces/reference-out-of-order.wit.print +31 -0
  1389. data/rust-vendor/wit-component/tests/interfaces/resources.wat +192 -0
  1390. data/rust-vendor/wit-component/tests/interfaces/resources.wit +80 -0
  1391. data/rust-vendor/wit-component/tests/interfaces/resources.wit.print +81 -0
  1392. data/rust-vendor/wit-component/tests/interfaces/simple-deps/deps/some-dep/types.wit +5 -0
  1393. data/rust-vendor/wit-component/tests/interfaces/simple-deps/foo.wit +4 -0
  1394. data/rust-vendor/wit-component/tests/interfaces/simple-deps/foo.wit.print +6 -0
  1395. data/rust-vendor/wit-component/tests/interfaces/simple-deps.wat +26 -0
  1396. data/rust-vendor/wit-component/tests/interfaces/simple-multi/bar.wit +1 -0
  1397. data/rust-vendor/wit-component/tests/interfaces/simple-multi/foo.wit +3 -0
  1398. data/rust-vendor/wit-component/tests/interfaces/simple-multi/foo.wit.print +8 -0
  1399. data/rust-vendor/wit-component/tests/interfaces/simple-multi.wat +24 -0
  1400. data/rust-vendor/wit-component/tests/interfaces/simple-use.wat +40 -0
  1401. data/rust-vendor/wit-component/tests/interfaces/simple-use.wit +13 -0
  1402. data/rust-vendor/wit-component/tests/interfaces/simple-use.wit.print +15 -0
  1403. data/rust-vendor/wit-component/tests/interfaces/simple-world.wat +35 -0
  1404. data/rust-vendor/wit-component/tests/interfaces/simple-world.wit +9 -0
  1405. data/rust-vendor/wit-component/tests/interfaces/simple-world.wit.print +9 -0
  1406. data/rust-vendor/wit-component/tests/interfaces/single-named-result.wat +18 -0
  1407. data/rust-vendor/wit-component/tests/interfaces/type-alias.wat +51 -0
  1408. data/rust-vendor/wit-component/tests/interfaces/type-alias.wit +13 -0
  1409. data/rust-vendor/wit-component/tests/interfaces/type-alias.wit.print +15 -0
  1410. data/rust-vendor/wit-component/tests/interfaces/type-alias2.wat +41 -0
  1411. data/rust-vendor/wit-component/tests/interfaces/type-alias2.wit +15 -0
  1412. data/rust-vendor/wit-component/tests/interfaces/type-alias2.wit.print +15 -0
  1413. data/rust-vendor/wit-component/tests/interfaces/upstream-deps-same-name/deps/a/the-name.wit +4 -0
  1414. data/rust-vendor/wit-component/tests/interfaces/upstream-deps-same-name/deps/b/the-name.wit +4 -0
  1415. data/rust-vendor/wit-component/tests/interfaces/upstream-deps-same-name/foo.wit +6 -0
  1416. data/rust-vendor/wit-component/tests/interfaces/upstream-deps-same-name/foo.wit.print +7 -0
  1417. data/rust-vendor/wit-component/tests/interfaces/upstream-deps-same-name.wat +36 -0
  1418. data/rust-vendor/wit-component/tests/interfaces/use-chain.wat +72 -0
  1419. data/rust-vendor/wit-component/tests/interfaces/use-chain.wit +15 -0
  1420. data/rust-vendor/wit-component/tests/interfaces/use-chain.wit.print +18 -0
  1421. data/rust-vendor/wit-component/tests/interfaces/use-for-type.wat +49 -0
  1422. data/rust-vendor/wit-component/tests/interfaces/use-for-type.wit +16 -0
  1423. data/rust-vendor/wit-component/tests/interfaces/use-for-type.wit.print +17 -0
  1424. data/rust-vendor/wit-component/tests/interfaces/variants.wat +197 -0
  1425. data/rust-vendor/wit-component/tests/interfaces/variants.wit +78 -0
  1426. data/rust-vendor/wit-component/tests/interfaces/variants.wit.print +95 -0
  1427. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/cli/command.wit +7 -0
  1428. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/cli/environment.wit +18 -0
  1429. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/cli/exit.wit +4 -0
  1430. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/cli/imports.wit +20 -0
  1431. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/cli/run.wit +4 -0
  1432. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/cli/stdio.wit +17 -0
  1433. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/cli/terminal.wit +47 -0
  1434. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/clocks/monotonic-clock.wit +45 -0
  1435. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/clocks/wall-clock.wit +42 -0
  1436. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/clocks/world.wit +6 -0
  1437. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/filesystem/preopens.wit +8 -0
  1438. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/filesystem/types.wit +634 -0
  1439. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/filesystem/world.wit +6 -0
  1440. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/io/error.wit +34 -0
  1441. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/io/poll.wit +41 -0
  1442. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/io/streams.wit +251 -0
  1443. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/io/world.wit +6 -0
  1444. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/random/insecure-seed.wit +25 -0
  1445. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/random/insecure.wit +22 -0
  1446. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/random/random.wit +26 -0
  1447. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/random/world.wit +7 -0
  1448. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/sockets/instance-network.wit +9 -0
  1449. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/sockets/ip-name-lookup.wit +51 -0
  1450. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/sockets/network.wit +147 -0
  1451. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/sockets/tcp-create-socket.wit +26 -0
  1452. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/sockets/tcp.wit +321 -0
  1453. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/sockets/udp-create-socket.wit +26 -0
  1454. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/sockets/udp.wit +277 -0
  1455. data/rust-vendor/wit-component/tests/interfaces/wasi-http/deps/sockets/world.wit +11 -0
  1456. data/rust-vendor/wit-component/tests/interfaces/wasi-http/handler.wit +43 -0
  1457. data/rust-vendor/wit-component/tests/interfaces/wasi-http/http.wit.print +571 -0
  1458. data/rust-vendor/wit-component/tests/interfaces/wasi-http/proxy.wit +32 -0
  1459. data/rust-vendor/wit-component/tests/interfaces/wasi-http/types.wit +570 -0
  1460. data/rust-vendor/wit-component/tests/interfaces/wasi-http.wat +881 -0
  1461. data/rust-vendor/wit-component/tests/interfaces/world-inline-interface.wat +24 -0
  1462. data/rust-vendor/wit-component/tests/interfaces/world-inline-interface.wit +6 -0
  1463. data/rust-vendor/wit-component/tests/interfaces/world-inline-interface.wit.print +9 -0
  1464. data/rust-vendor/wit-component/tests/interfaces/world-pkg-conflict/bar.wit +3 -0
  1465. data/rust-vendor/wit-component/tests/interfaces/world-pkg-conflict/foo.wit +9 -0
  1466. data/rust-vendor/wit-component/tests/interfaces/world-pkg-conflict/foo.wit.print +12 -0
  1467. data/rust-vendor/wit-component/tests/interfaces/world-pkg-conflict.wat +47 -0
  1468. data/rust-vendor/wit-component/tests/interfaces/world-top-level.wat +55 -0
  1469. data/rust-vendor/wit-component/tests/interfaces/world-top-level.wit +20 -0
  1470. data/rust-vendor/wit-component/tests/interfaces/world-top-level.wit.print +19 -0
  1471. data/rust-vendor/wit-component/tests/interfaces/worlds-with-types.wat +56 -0
  1472. data/rust-vendor/wit-component/tests/interfaces/worlds-with-types.wit +23 -0
  1473. data/rust-vendor/wit-component/tests/interfaces/worlds-with-types.wit.print +23 -0
  1474. data/rust-vendor/wit-component/tests/interfaces.rs +123 -0
  1475. data/rust-vendor/wit-component/tests/linking.rs +299 -0
  1476. data/rust-vendor/wit-component/tests/merge/bad-interface1/error.txt +1 -0
  1477. data/rust-vendor/wit-component/tests/merge/bad-interface1/from/a.wit +5 -0
  1478. data/rust-vendor/wit-component/tests/merge/bad-interface1/from/deps/foo/a.wit +5 -0
  1479. data/rust-vendor/wit-component/tests/merge/bad-interface1/into/a.wit +5 -0
  1480. data/rust-vendor/wit-component/tests/merge/bad-interface1/into/deps/foo/a.wit +5 -0
  1481. data/rust-vendor/wit-component/tests/merge/bad-interface2/error.txt +1 -0
  1482. data/rust-vendor/wit-component/tests/merge/bad-interface2/from/a.wit +5 -0
  1483. data/rust-vendor/wit-component/tests/merge/bad-interface2/from/deps/foo/a.wit +7 -0
  1484. data/rust-vendor/wit-component/tests/merge/bad-interface2/into/a.wit +5 -0
  1485. data/rust-vendor/wit-component/tests/merge/bad-interface2/into/deps/foo/a.wit +7 -0
  1486. data/rust-vendor/wit-component/tests/merge/bad-world1/error.txt +1 -0
  1487. data/rust-vendor/wit-component/tests/merge/bad-world1/from/a.wit +4 -0
  1488. data/rust-vendor/wit-component/tests/merge/bad-world1/from/deps/foo/a.wit +11 -0
  1489. data/rust-vendor/wit-component/tests/merge/bad-world1/into/a.wit +4 -0
  1490. data/rust-vendor/wit-component/tests/merge/bad-world1/into/deps/foo/a.wit +9 -0
  1491. data/rust-vendor/wit-component/tests/merge/bad-world2/error.txt +1 -0
  1492. data/rust-vendor/wit-component/tests/merge/bad-world2/from/a.wit +5 -0
  1493. data/rust-vendor/wit-component/tests/merge/bad-world2/from/deps/foo/a.wit +8 -0
  1494. data/rust-vendor/wit-component/tests/merge/bad-world2/into/a.wit +5 -0
  1495. data/rust-vendor/wit-component/tests/merge/bad-world2/into/deps/foo/a.wit +9 -0
  1496. data/rust-vendor/wit-component/tests/merge/bad-world3/error.txt +1 -0
  1497. data/rust-vendor/wit-component/tests/merge/bad-world3/from/a.wit +5 -0
  1498. data/rust-vendor/wit-component/tests/merge/bad-world3/from/deps/foo/a.wit +8 -0
  1499. data/rust-vendor/wit-component/tests/merge/bad-world3/into/a.wit +5 -0
  1500. data/rust-vendor/wit-component/tests/merge/bad-world3/into/deps/foo/a.wit +9 -0
  1501. data/rust-vendor/wit-component/tests/merge/bad-world4/error.txt +1 -0
  1502. data/rust-vendor/wit-component/tests/merge/bad-world4/from/a.wit +5 -0
  1503. data/rust-vendor/wit-component/tests/merge/bad-world4/from/deps/foo/a.wit +11 -0
  1504. data/rust-vendor/wit-component/tests/merge/bad-world4/into/a.wit +5 -0
  1505. data/rust-vendor/wit-component/tests/merge/bad-world4/into/deps/foo/a.wit +9 -0
  1506. data/rust-vendor/wit-component/tests/merge/bad-world5/error.txt +1 -0
  1507. data/rust-vendor/wit-component/tests/merge/bad-world5/from/a.wit +5 -0
  1508. data/rust-vendor/wit-component/tests/merge/bad-world5/from/deps/foo/a.wit +11 -0
  1509. data/rust-vendor/wit-component/tests/merge/bad-world5/into/a.wit +5 -0
  1510. data/rust-vendor/wit-component/tests/merge/bad-world5/into/deps/foo/a.wit +9 -0
  1511. data/rust-vendor/wit-component/tests/merge/success/from/a.wit +7 -0
  1512. data/rust-vendor/wit-component/tests/merge/success/from/deps/foo/only-from.wit +5 -0
  1513. data/rust-vendor/wit-component/tests/merge/success/from/deps/foo/shared.wit +46 -0
  1514. data/rust-vendor/wit-component/tests/merge/success/from/deps/only-from-dep/a.wit +5 -0
  1515. data/rust-vendor/wit-component/tests/merge/success/into/b.wit +7 -0
  1516. data/rust-vendor/wit-component/tests/merge/success/into/deps/foo/only-into.wit +5 -0
  1517. data/rust-vendor/wit-component/tests/merge/success/into/deps/foo/shared.wit +44 -0
  1518. data/rust-vendor/wit-component/tests/merge/success/merge/foo.wit +77 -0
  1519. data/rust-vendor/wit-component/tests/merge/success/merge/from.wit +8 -0
  1520. data/rust-vendor/wit-component/tests/merge/success/merge/into.wit +8 -0
  1521. data/rust-vendor/wit-component/tests/merge/success/merge/only-from-dep.wit +6 -0
  1522. data/rust-vendor/wit-component/tests/merge.rs +80 -0
  1523. data/rust-vendor/wit-component/tests/targets/error-missing-export/error.txt +2 -0
  1524. data/rust-vendor/wit-component/tests/targets/error-missing-export/test.wat +39 -0
  1525. data/rust-vendor/wit-component/tests/targets/error-missing-export/test.wit +18 -0
  1526. data/rust-vendor/wit-component/tests/targets/error-missing-import/error.txt +2 -0
  1527. data/rust-vendor/wit-component/tests/targets/error-missing-import/test.wat +37 -0
  1528. data/rust-vendor/wit-component/tests/targets/error-missing-import/test.wit +13 -0
  1529. data/rust-vendor/wit-component/tests/targets/success/test.wat +56 -0
  1530. data/rust-vendor/wit-component/tests/targets/success/test.wit +14 -0
  1531. data/rust-vendor/wit-component/tests/targets/success-empty/test.wat +1 -0
  1532. data/rust-vendor/wit-component/tests/targets/success-empty/test.wit +9 -0
  1533. data/rust-vendor/wit-component/tests/targets.rs +89 -0
  1534. data/rust-vendor/wit-component/tests/wit/parse-dir/wit/deps/bar/bar.wit +9 -0
  1535. data/rust-vendor/wit-component/tests/wit/parse-dir/wit/world.wit +5 -0
  1536. data/rust-vendor/wit-component/tests/wit.rs +49 -0
  1537. data/rust-vendor/wit-parser/.cargo-checksum.json +1 -0
  1538. data/rust-vendor/wit-parser/.cargo_vcs_info.json +6 -0
  1539. data/rust-vendor/wit-parser/Cargo.lock +576 -0
  1540. data/rust-vendor/wit-parser/Cargo.toml +157 -0
  1541. data/rust-vendor/wit-parser/Cargo.toml.orig +56 -0
  1542. data/rust-vendor/wit-parser/README.md +13 -0
  1543. data/rust-vendor/wit-parser/src/abi.rs +410 -0
  1544. data/rust-vendor/wit-parser/src/ast/lex.rs +751 -0
  1545. data/rust-vendor/wit-parser/src/ast/resolve.rs +1813 -0
  1546. data/rust-vendor/wit-parser/src/ast/toposort.rs +249 -0
  1547. data/rust-vendor/wit-parser/src/ast.rs +1958 -0
  1548. data/rust-vendor/wit-parser/src/decoding.rs +1864 -0
  1549. data/rust-vendor/wit-parser/src/lib.rs +1413 -0
  1550. data/rust-vendor/wit-parser/src/live.rs +264 -0
  1551. data/rust-vendor/wit-parser/src/metadata.rs +772 -0
  1552. data/rust-vendor/wit-parser/src/resolve/clone.rs +227 -0
  1553. data/rust-vendor/wit-parser/src/resolve.rs +4636 -0
  1554. data/rust-vendor/wit-parser/src/serde_.rs +140 -0
  1555. data/rust-vendor/wit-parser/src/sizealign.rs +626 -0
  1556. data/rust-vendor/wit-parser/tests/.gitignore +2 -0
  1557. data/rust-vendor/wit-parser/tests/all.rs +153 -0
  1558. data/rust-vendor/wit-parser/tests/ui/async.wit +24 -0
  1559. data/rust-vendor/wit-parser/tests/ui/async.wit.json +151 -0
  1560. data/rust-vendor/wit-parser/tests/ui/comments.wit +25 -0
  1561. data/rust-vendor/wit-parser/tests/ui/comments.wit.json +46 -0
  1562. data/rust-vendor/wit-parser/tests/ui/complex-include/deps/bar/root.wit +9 -0
  1563. data/rust-vendor/wit-parser/tests/ui/complex-include/deps/baz/root.wit +9 -0
  1564. data/rust-vendor/wit-parser/tests/ui/complex-include/root.wit +26 -0
  1565. data/rust-vendor/wit-parser/tests/ui/complex-include.wit.json +200 -0
  1566. data/rust-vendor/wit-parser/tests/ui/cross-package-resource/deps/foo/foo.wit +5 -0
  1567. data/rust-vendor/wit-parser/tests/ui/cross-package-resource/foo.wit +7 -0
  1568. data/rust-vendor/wit-parser/tests/ui/cross-package-resource.wit.json +67 -0
  1569. data/rust-vendor/wit-parser/tests/ui/diamond1/deps/dep1/types.wit +2 -0
  1570. data/rust-vendor/wit-parser/tests/ui/diamond1/deps/dep2/types.wit +2 -0
  1571. data/rust-vendor/wit-parser/tests/ui/diamond1/join.wit +6 -0
  1572. data/rust-vendor/wit-parser/tests/ui/diamond1.wit.json +59 -0
  1573. data/rust-vendor/wit-parser/tests/ui/disambiguate-diamond/shared1.wit +3 -0
  1574. data/rust-vendor/wit-parser/tests/ui/disambiguate-diamond/shared2.wit +3 -0
  1575. data/rust-vendor/wit-parser/tests/ui/disambiguate-diamond/world.wit +13 -0
  1576. data/rust-vendor/wit-parser/tests/ui/disambiguate-diamond.wit.json +115 -0
  1577. data/rust-vendor/wit-parser/tests/ui/empty.wit +1 -0
  1578. data/rust-vendor/wit-parser/tests/ui/empty.wit.json +12 -0
  1579. data/rust-vendor/wit-parser/tests/ui/error-context.wit +7 -0
  1580. data/rust-vendor/wit-parser/tests/ui/error-context.wit.json +59 -0
  1581. data/rust-vendor/wit-parser/tests/ui/feature-gates.wit +118 -0
  1582. data/rust-vendor/wit-parser/tests/ui/feature-gates.wit.json +301 -0
  1583. data/rust-vendor/wit-parser/tests/ui/feature-types.wit +13 -0
  1584. data/rust-vendor/wit-parser/tests/ui/feature-types.wit.json +66 -0
  1585. data/rust-vendor/wit-parser/tests/ui/foreign-deps/deps/another-pkg/other-doc.wit +3 -0
  1586. data/rust-vendor/wit-parser/tests/ui/foreign-deps/deps/corp/saas.wit +4 -0
  1587. data/rust-vendor/wit-parser/tests/ui/foreign-deps/deps/different-pkg/the-doc.wit +2 -0
  1588. data/rust-vendor/wit-parser/tests/ui/foreign-deps/deps/foreign-pkg/the-doc.wit +5 -0
  1589. data/rust-vendor/wit-parser/tests/ui/foreign-deps/deps/some-pkg/some-doc.wit +13 -0
  1590. data/rust-vendor/wit-parser/tests/ui/foreign-deps/deps/wasi/clocks.wit +5 -0
  1591. data/rust-vendor/wit-parser/tests/ui/foreign-deps/deps/wasi/filesystem.wit +7 -0
  1592. data/rust-vendor/wit-parser/tests/ui/foreign-deps/root.wit +44 -0
  1593. data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/deps/another-pkg/other-doc.wit +3 -0
  1594. data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/deps/corp/saas.wit +4 -0
  1595. data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/deps/different-pkg/the-doc.wit +2 -0
  1596. data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/deps/foreign-pkg/the-doc.wit +5 -0
  1597. data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/deps/some-pkg/some-doc.wit +13 -0
  1598. data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/deps/wasi/clocks.wit +5 -0
  1599. data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/deps/wasi/filesystem.wit +7 -0
  1600. data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/deps/wasi/wasi.wit +6 -0
  1601. data/rust-vendor/wit-parser/tests/ui/foreign-deps-union/root.wit +50 -0
  1602. data/rust-vendor/wit-parser/tests/ui/foreign-deps-union.wit.json +410 -0
  1603. data/rust-vendor/wit-parser/tests/ui/foreign-deps.wit.json +362 -0
  1604. data/rust-vendor/wit-parser/tests/ui/foreign-interface-dep-gated.wit +17 -0
  1605. data/rust-vendor/wit-parser/tests/ui/foreign-interface-dep-gated.wit.json +39 -0
  1606. data/rust-vendor/wit-parser/tests/ui/foreign-world-dep-gated.wit +17 -0
  1607. data/rust-vendor/wit-parser/tests/ui/foreign-world-dep-gated.wit.json +39 -0
  1608. data/rust-vendor/wit-parser/tests/ui/functions.wit +11 -0
  1609. data/rust-vendor/wit-parser/tests/ui/functions.wit.json +115 -0
  1610. data/rust-vendor/wit-parser/tests/ui/gated-include.wit +67 -0
  1611. data/rust-vendor/wit-parser/tests/ui/gated-include.wit.json +346 -0
  1612. data/rust-vendor/wit-parser/tests/ui/gated-use.wit +13 -0
  1613. data/rust-vendor/wit-parser/tests/ui/gated-use.wit.json +34 -0
  1614. data/rust-vendor/wit-parser/tests/ui/ignore-files-deps/deps/bar/types.wit +2 -0
  1615. data/rust-vendor/wit-parser/tests/ui/ignore-files-deps/deps/ignore-me.txt +1 -0
  1616. data/rust-vendor/wit-parser/tests/ui/ignore-files-deps/world.wit +5 -0
  1617. data/rust-vendor/wit-parser/tests/ui/ignore-files-deps.wit.json +41 -0
  1618. data/rust-vendor/wit-parser/tests/ui/import-export-overlap1.wit +5 -0
  1619. data/rust-vendor/wit-parser/tests/ui/import-export-overlap1.wit.json +37 -0
  1620. data/rust-vendor/wit-parser/tests/ui/import-export-overlap2.wit +5 -0
  1621. data/rust-vendor/wit-parser/tests/ui/import-export-overlap2.wit.json +42 -0
  1622. data/rust-vendor/wit-parser/tests/ui/include-reps.wit +15 -0
  1623. data/rust-vendor/wit-parser/tests/ui/include-reps.wit.json +68 -0
  1624. data/rust-vendor/wit-parser/tests/ui/kebab-name-include-with.wit +8 -0
  1625. data/rust-vendor/wit-parser/tests/ui/kebab-name-include-with.wit.json +66 -0
  1626. data/rust-vendor/wit-parser/tests/ui/kinds-of-deps/a.wit +8 -0
  1627. data/rust-vendor/wit-parser/tests/ui/kinds-of-deps/deps/b/root.wit +3 -0
  1628. data/rust-vendor/wit-parser/tests/ui/kinds-of-deps/deps/c.wit +3 -0
  1629. data/rust-vendor/wit-parser/tests/ui/kinds-of-deps/deps/d.wat +6 -0
  1630. data/rust-vendor/wit-parser/tests/ui/kinds-of-deps/deps/e.wasm +0 -0
  1631. data/rust-vendor/wit-parser/tests/ui/kinds-of-deps.wit.json +95 -0
  1632. data/rust-vendor/wit-parser/tests/ui/many-names/a.wit +2 -0
  1633. data/rust-vendor/wit-parser/tests/ui/many-names/b.wit +5 -0
  1634. data/rust-vendor/wit-parser/tests/ui/many-names.wit.json +42 -0
  1635. data/rust-vendor/wit-parser/tests/ui/maps.wit +34 -0
  1636. data/rust-vendor/wit-parser/tests/ui/maps.wit.json +255 -0
  1637. data/rust-vendor/wit-parser/tests/ui/multi-file/bar.wit +21 -0
  1638. data/rust-vendor/wit-parser/tests/ui/multi-file/cycle-a.wit +7 -0
  1639. data/rust-vendor/wit-parser/tests/ui/multi-file/cycle-b.wit +3 -0
  1640. data/rust-vendor/wit-parser/tests/ui/multi-file/foo.wit +31 -0
  1641. data/rust-vendor/wit-parser/tests/ui/multi-file-multi-package/a.wit +24 -0
  1642. data/rust-vendor/wit-parser/tests/ui/multi-file-multi-package/b.wit +23 -0
  1643. data/rust-vendor/wit-parser/tests/ui/multi-file-multi-package.wit.json +255 -0
  1644. data/rust-vendor/wit-parser/tests/ui/multi-file.wit.json +300 -0
  1645. data/rust-vendor/wit-parser/tests/ui/multi-package-deps/deps/dep.wit +13 -0
  1646. data/rust-vendor/wit-parser/tests/ui/multi-package-deps/root.wit +16 -0
  1647. data/rust-vendor/wit-parser/tests/ui/multi-package-deps.wit.json +161 -0
  1648. data/rust-vendor/wit-parser/tests/ui/multi-package-gated-include.wit +114 -0
  1649. data/rust-vendor/wit-parser/tests/ui/multi-package-gated-include.wit.json +697 -0
  1650. data/rust-vendor/wit-parser/tests/ui/multi-package-shared-deps/deps/dep1/types.wit +4 -0
  1651. data/rust-vendor/wit-parser/tests/ui/multi-package-shared-deps/deps/dep2/types.wit +4 -0
  1652. data/rust-vendor/wit-parser/tests/ui/multi-package-shared-deps/packages.wit +41 -0
  1653. data/rust-vendor/wit-parser/tests/ui/multi-package-shared-deps.wit.json +261 -0
  1654. data/rust-vendor/wit-parser/tests/ui/multi-package-transitive-deps/deps/dep1/types.wit +8 -0
  1655. data/rust-vendor/wit-parser/tests/ui/multi-package-transitive-deps/deps/dep2/types.wit +14 -0
  1656. data/rust-vendor/wit-parser/tests/ui/multi-package-transitive-deps/packages.wit +12 -0
  1657. data/rust-vendor/wit-parser/tests/ui/multi-package-transitive-deps.wit.json +174 -0
  1658. data/rust-vendor/wit-parser/tests/ui/name-both-resource-and-type/deps/dep/foo.wit +5 -0
  1659. data/rust-vendor/wit-parser/tests/ui/name-both-resource-and-type/foo.wit +9 -0
  1660. data/rust-vendor/wit-parser/tests/ui/name-both-resource-and-type.wit.json +89 -0
  1661. data/rust-vendor/wit-parser/tests/ui/package-syntax1.wit +1 -0
  1662. data/rust-vendor/wit-parser/tests/ui/package-syntax1.wit.json +12 -0
  1663. data/rust-vendor/wit-parser/tests/ui/package-syntax3.wit +1 -0
  1664. data/rust-vendor/wit-parser/tests/ui/package-syntax3.wit.json +12 -0
  1665. data/rust-vendor/wit-parser/tests/ui/package-syntax4.wit +1 -0
  1666. data/rust-vendor/wit-parser/tests/ui/package-syntax4.wit.json +12 -0
  1667. data/rust-vendor/wit-parser/tests/ui/packages-multiple-nested.wit +35 -0
  1668. data/rust-vendor/wit-parser/tests/ui/packages-multiple-nested.wit.json +184 -0
  1669. data/rust-vendor/wit-parser/tests/ui/packages-nested-colliding-decl-names.wit +24 -0
  1670. data/rust-vendor/wit-parser/tests/ui/packages-nested-colliding-decl-names.wit.json +135 -0
  1671. data/rust-vendor/wit-parser/tests/ui/packages-nested-internal-references.wit +16 -0
  1672. data/rust-vendor/wit-parser/tests/ui/packages-nested-internal-references.wit.json +91 -0
  1673. data/rust-vendor/wit-parser/tests/ui/packages-nested-with-semver.wit +24 -0
  1674. data/rust-vendor/wit-parser/tests/ui/packages-nested-with-semver.wit.json +135 -0
  1675. data/rust-vendor/wit-parser/tests/ui/packages-single-nested.wit +12 -0
  1676. data/rust-vendor/wit-parser/tests/ui/packages-single-nested.wit.json +75 -0
  1677. data/rust-vendor/wit-parser/tests/ui/parse-fail/alias-no-type.wit +6 -0
  1678. data/rust-vendor/wit-parser/tests/ui/parse-fail/alias-no-type.wit.result +5 -0
  1679. data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad-world.wit +6 -0
  1680. data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad-world.wit.result +5 -0
  1681. data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad-world2.wit +6 -0
  1682. data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad-world2.wit.result +5 -0
  1683. data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad-world3.wit +6 -0
  1684. data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad-world3.wit.result +5 -0
  1685. data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad-world4.wit +11 -0
  1686. data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad-world4.wit.result +5 -0
  1687. data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad1.wit +7 -0
  1688. data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad1.wit.result +5 -0
  1689. data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad2.wit +7 -0
  1690. data/rust-vendor/wit-parser/tests/ui/parse-fail/async-bad2.wit.result +5 -0
  1691. data/rust-vendor/wit-parser/tests/ui/parse-fail/async.wit.result +5 -0
  1692. data/rust-vendor/wit-parser/tests/ui/parse-fail/async1.wit.result +5 -0
  1693. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-deprecated1.wit +4 -0
  1694. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-deprecated1.wit.result +5 -0
  1695. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-deprecated2.wit +4 -0
  1696. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-deprecated2.wit.result +5 -0
  1697. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-deprecated3.wit +4 -0
  1698. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-deprecated3.wit.result +5 -0
  1699. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-deprecated4.wit +5 -0
  1700. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-deprecated4.wit.result +5 -0
  1701. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-function.wit +7 -0
  1702. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-function.wit.result +5 -0
  1703. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-function2.wit +7 -0
  1704. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-function2.wit.result +5 -0
  1705. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate1.wit +8 -0
  1706. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate1.wit.result +5 -0
  1707. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate2.wit +8 -0
  1708. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate2.wit.result +5 -0
  1709. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate3.wit +6 -0
  1710. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate3.wit.result +5 -0
  1711. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate4.wit +8 -0
  1712. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate4.wit.result +5 -0
  1713. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate5.wit +11 -0
  1714. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-gate5.wit.result +5 -0
  1715. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-include1.wit +5 -0
  1716. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-include1.wit.result +5 -0
  1717. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-include2.wit +9 -0
  1718. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-include2.wit.result +5 -0
  1719. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-include3.wit +5 -0
  1720. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-include3.wit.result +5 -0
  1721. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-list.wit +7 -0
  1722. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-list.wit.result +5 -0
  1723. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-list2.wit +7 -0
  1724. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-list2.wit.result +5 -0
  1725. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-list3.wit +7 -0
  1726. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-list3.wit.result +5 -0
  1727. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-list4.wit +7 -0
  1728. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-list4.wit.result +5 -0
  1729. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg1/root.wit +5 -0
  1730. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg1.wit.result +5 -0
  1731. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg2/deps/bar/empty.wit +1 -0
  1732. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg2/root.wit +5 -0
  1733. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg2.wit.result +5 -0
  1734. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg3/deps/bar/.gitkeep +0 -0
  1735. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg3/deps/bar/baz.wit +2 -0
  1736. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg3/root.wit +5 -0
  1737. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg3.wit.result +5 -0
  1738. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg4/deps/bar/.gitkeep +0 -0
  1739. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg4/deps/bar/baz.wit +4 -0
  1740. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg4/root.wit +4 -0
  1741. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg4.wit.result +5 -0
  1742. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg5/deps/bar/.gitkeep +0 -0
  1743. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg5/deps/bar/baz.wit +3 -0
  1744. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg5/root.wit +4 -0
  1745. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg5.wit.result +5 -0
  1746. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg6/deps/bar/.gitkeep +0 -0
  1747. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg6/deps/bar/baz.wit +4 -0
  1748. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg6/root.wit +4 -0
  1749. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-pkg6.wit.result +8 -0
  1750. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource1.wit +5 -0
  1751. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource1.wit.result +5 -0
  1752. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource10.wit +5 -0
  1753. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource10.wit.result +5 -0
  1754. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource11.wit +5 -0
  1755. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource11.wit.result +5 -0
  1756. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource12.wit +6 -0
  1757. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource12.wit.result +5 -0
  1758. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource13.wit +6 -0
  1759. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource13.wit.result +5 -0
  1760. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource14.wit +7 -0
  1761. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource14.wit.result +5 -0
  1762. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource15/deps/foo/foo.wit +5 -0
  1763. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource15/foo.wit +7 -0
  1764. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource15.wit.result +5 -0
  1765. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource16.wit +7 -0
  1766. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource16.wit.result +5 -0
  1767. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource17.wit +8 -0
  1768. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource17.wit.result +5 -0
  1769. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource2.wit +5 -0
  1770. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource2.wit.result +5 -0
  1771. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource3.wit +6 -0
  1772. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource3.wit.result +5 -0
  1773. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource4.wit +6 -0
  1774. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource4.wit.result +5 -0
  1775. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource5.wit +7 -0
  1776. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource5.wit.result +5 -0
  1777. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource6.wit +7 -0
  1778. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource6.wit.result +5 -0
  1779. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource7.wit +8 -0
  1780. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource7.wit.result +5 -0
  1781. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource8.wit +8 -0
  1782. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource8.wit.result +5 -0
  1783. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource9.wit +7 -0
  1784. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-resource9.wit.result +5 -0
  1785. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-since1.wit +4 -0
  1786. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-since1.wit.result +5 -0
  1787. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-since3.wit +5 -0
  1788. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-since3.wit.result +5 -0
  1789. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-world-type1.wit +5 -0
  1790. data/rust-vendor/wit-parser/tests/ui/parse-fail/bad-world-type1.wit.result +5 -0
  1791. data/rust-vendor/wit-parser/tests/ui/parse-fail/case-insensitive-duplicates.wit +9 -0
  1792. data/rust-vendor/wit-parser/tests/ui/parse-fail/case-insensitive-duplicates.wit.result +1 -0
  1793. data/rust-vendor/wit-parser/tests/ui/parse-fail/conflicting-package/a.wit +1 -0
  1794. data/rust-vendor/wit-parser/tests/ui/parse-fail/conflicting-package/b.wit +1 -0
  1795. data/rust-vendor/wit-parser/tests/ui/parse-fail/conflicting-package.wit.result +5 -0
  1796. data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle.wit +6 -0
  1797. data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle.wit.result +5 -0
  1798. data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle2.wit +7 -0
  1799. data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle2.wit.result +5 -0
  1800. data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle3.wit +7 -0
  1801. data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle3.wit.result +5 -0
  1802. data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle4.wit +7 -0
  1803. data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle4.wit.result +5 -0
  1804. data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle5.wit +7 -0
  1805. data/rust-vendor/wit-parser/tests/ui/parse-fail/cycle5.wit.result +5 -0
  1806. data/rust-vendor/wit-parser/tests/ui/parse-fail/dangling-type.wit +5 -0
  1807. data/rust-vendor/wit-parser/tests/ui/parse-fail/dangling-type.wit.result +5 -0
  1808. data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-function-params.wit +7 -0
  1809. data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-function-params.wit.result +5 -0
  1810. data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-functions.wit +8 -0
  1811. data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-functions.wit.result +5 -0
  1812. data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-interface.wit +6 -0
  1813. data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-interface.wit.result +5 -0
  1814. data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-interface2/foo.wit +3 -0
  1815. data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-interface2/foo2.wit +3 -0
  1816. data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-interface2.wit.result +5 -0
  1817. data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-type.wit +7 -0
  1818. data/rust-vendor/wit-parser/tests/ui/parse-fail/duplicate-type.wit.result +5 -0
  1819. data/rust-vendor/wit-parser/tests/ui/parse-fail/empty-enum.wit +6 -0
  1820. data/rust-vendor/wit-parser/tests/ui/parse-fail/empty-enum.wit.result +5 -0
  1821. data/rust-vendor/wit-parser/tests/ui/parse-fail/empty-variant1.wit +6 -0
  1822. data/rust-vendor/wit-parser/tests/ui/parse-fail/empty-variant1.wit.result +5 -0
  1823. data/rust-vendor/wit-parser/tests/ui/parse-fail/export-twice.wit +8 -0
  1824. data/rust-vendor/wit-parser/tests/ui/parse-fail/export-twice.wit.result +5 -0
  1825. data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export1.wit +17 -0
  1826. data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export1.wit.result +5 -0
  1827. data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export2.wit +18 -0
  1828. data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export2.wit.result +5 -0
  1829. data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export3.wit +37 -0
  1830. data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export3.wit.result +5 -0
  1831. data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export4.wit +44 -0
  1832. data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export4.wit.result +5 -0
  1833. data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export5.wit +18 -0
  1834. data/rust-vendor/wit-parser/tests/ui/parse-fail/import-and-export5.wit.result +5 -0
  1835. data/rust-vendor/wit-parser/tests/ui/parse-fail/import-twice.wit +8 -0
  1836. data/rust-vendor/wit-parser/tests/ui/parse-fail/import-twice.wit.result +5 -0
  1837. data/rust-vendor/wit-parser/tests/ui/parse-fail/include-cycle.wit +9 -0
  1838. data/rust-vendor/wit-parser/tests/ui/parse-fail/include-cycle.wit.result +5 -0
  1839. data/rust-vendor/wit-parser/tests/ui/parse-fail/include-foreign/deps/bar/empty.wit +3 -0
  1840. data/rust-vendor/wit-parser/tests/ui/parse-fail/include-foreign/root.wit +5 -0
  1841. data/rust-vendor/wit-parser/tests/ui/parse-fail/include-foreign.wit.result +5 -0
  1842. data/rust-vendor/wit-parser/tests/ui/parse-fail/include-with-id.wit +11 -0
  1843. data/rust-vendor/wit-parser/tests/ui/parse-fail/include-with-id.wit.result +5 -0
  1844. data/rust-vendor/wit-parser/tests/ui/parse-fail/include-with-on-id.wit +11 -0
  1845. data/rust-vendor/wit-parser/tests/ui/parse-fail/include-with-on-id.wit.result +5 -0
  1846. data/rust-vendor/wit-parser/tests/ui/parse-fail/invalid-toplevel.wit +5 -0
  1847. data/rust-vendor/wit-parser/tests/ui/parse-fail/invalid-toplevel.wit.result +5 -0
  1848. data/rust-vendor/wit-parser/tests/ui/parse-fail/invalid-type-reference.wit +10 -0
  1849. data/rust-vendor/wit-parser/tests/ui/parse-fail/invalid-type-reference.wit.result +5 -0
  1850. data/rust-vendor/wit-parser/tests/ui/parse-fail/invalid-type-reference2.wit +6 -0
  1851. data/rust-vendor/wit-parser/tests/ui/parse-fail/invalid-type-reference2.wit.result +5 -0
  1852. data/rust-vendor/wit-parser/tests/ui/parse-fail/kebab-name-include-not-found.wit +8 -0
  1853. data/rust-vendor/wit-parser/tests/ui/parse-fail/kebab-name-include-not-found.wit.result +5 -0
  1854. data/rust-vendor/wit-parser/tests/ui/parse-fail/kebab-name-include.wit +8 -0
  1855. data/rust-vendor/wit-parser/tests/ui/parse-fail/kebab-name-include.wit.result +5 -0
  1856. data/rust-vendor/wit-parser/tests/ui/parse-fail/keyword.wit +5 -0
  1857. data/rust-vendor/wit-parser/tests/ui/parse-fail/keyword.wit.result +5 -0
  1858. data/rust-vendor/wit-parser/tests/ui/parse-fail/map-invalid-key.wit +7 -0
  1859. data/rust-vendor/wit-parser/tests/ui/parse-fail/map-invalid-key.wit.result +5 -0
  1860. data/rust-vendor/wit-parser/tests/ui/parse-fail/missing-main-declaration-initial-main.wit +23 -0
  1861. data/rust-vendor/wit-parser/tests/ui/parse-fail/missing-main-declaration-initial-main.wit.result +1 -0
  1862. data/rust-vendor/wit-parser/tests/ui/parse-fail/missing-main-declaration-initial-nested.wit +23 -0
  1863. data/rust-vendor/wit-parser/tests/ui/parse-fail/missing-main-declaration-initial-nested.wit.result +1 -0
  1864. data/rust-vendor/wit-parser/tests/ui/parse-fail/missing-package.wit +0 -0
  1865. data/rust-vendor/wit-parser/tests/ui/parse-fail/missing-package.wit.result +1 -0
  1866. data/rust-vendor/wit-parser/tests/ui/parse-fail/multi-file-missing-delimiter/observe.wit +5 -0
  1867. data/rust-vendor/wit-parser/tests/ui/parse-fail/multi-file-missing-delimiter/world.wit +5 -0
  1868. data/rust-vendor/wit-parser/tests/ui/parse-fail/multi-file-missing-delimiter.wit.result +5 -0
  1869. data/rust-vendor/wit-parser/tests/ui/parse-fail/multi-package-deps-share-nest/deps/dep1/types.wit +12 -0
  1870. data/rust-vendor/wit-parser/tests/ui/parse-fail/multi-package-deps-share-nest/deps/dep2/types.wit +12 -0
  1871. data/rust-vendor/wit-parser/tests/ui/parse-fail/multi-package-deps-share-nest/root.wit +8 -0
  1872. data/rust-vendor/wit-parser/tests/ui/parse-fail/multi-package-deps-share-nest.wit.result +3 -0
  1873. data/rust-vendor/wit-parser/tests/ui/parse-fail/multiple-package-docs/a.wit +2 -0
  1874. data/rust-vendor/wit-parser/tests/ui/parse-fail/multiple-package-docs/b.wit +2 -0
  1875. data/rust-vendor/wit-parser/tests/ui/parse-fail/multiple-package-docs.wit.result +5 -0
  1876. data/rust-vendor/wit-parser/tests/ui/parse-fail/multiple-package-inline-cycle.wit +12 -0
  1877. data/rust-vendor/wit-parser/tests/ui/parse-fail/multiple-package-inline-cycle.wit.result +5 -0
  1878. data/rust-vendor/wit-parser/tests/ui/parse-fail/multiple-packages-no-scope-blocks.wit +15 -0
  1879. data/rust-vendor/wit-parser/tests/ui/parse-fail/multiple-packages-no-scope-blocks.wit.result +5 -0
  1880. data/rust-vendor/wit-parser/tests/ui/parse-fail/nested-packages-colliding-names.wit +5 -0
  1881. data/rust-vendor/wit-parser/tests/ui/parse-fail/nested-packages-colliding-names.wit.result +3 -0
  1882. data/rust-vendor/wit-parser/tests/ui/parse-fail/nested-packages-with-error.wit +14 -0
  1883. data/rust-vendor/wit-parser/tests/ui/parse-fail/nested-packages-with-error.wit.result +5 -0
  1884. data/rust-vendor/wit-parser/tests/ui/parse-fail/no-access-to-sibling-use/bar.wit +1 -0
  1885. data/rust-vendor/wit-parser/tests/ui/parse-fail/no-access-to-sibling-use/foo.wit +5 -0
  1886. data/rust-vendor/wit-parser/tests/ui/parse-fail/no-access-to-sibling-use.wit.result +5 -0
  1887. data/rust-vendor/wit-parser/tests/ui/parse-fail/non-existance-world-include/deps/bar/.gitkeep +0 -0
  1888. data/rust-vendor/wit-parser/tests/ui/parse-fail/non-existance-world-include/deps/bar/baz.wit +4 -0
  1889. data/rust-vendor/wit-parser/tests/ui/parse-fail/non-existance-world-include/root.wit +5 -0
  1890. data/rust-vendor/wit-parser/tests/ui/parse-fail/non-existance-world-include.wit.result +5 -0
  1891. data/rust-vendor/wit-parser/tests/ui/parse-fail/old-float-types.wit +5 -0
  1892. data/rust-vendor/wit-parser/tests/ui/parse-fail/old-float-types.wit.result +5 -0
  1893. data/rust-vendor/wit-parser/tests/ui/parse-fail/pkg-cycle/deps/a1/root.wit +4 -0
  1894. data/rust-vendor/wit-parser/tests/ui/parse-fail/pkg-cycle/root.wit +4 -0
  1895. data/rust-vendor/wit-parser/tests/ui/parse-fail/pkg-cycle.wit.result +5 -0
  1896. data/rust-vendor/wit-parser/tests/ui/parse-fail/pkg-cycle2/deps/a1/root.wit +4 -0
  1897. data/rust-vendor/wit-parser/tests/ui/parse-fail/pkg-cycle2/deps/a2/root.wit +4 -0
  1898. data/rust-vendor/wit-parser/tests/ui/parse-fail/pkg-cycle2/root.wit +4 -0
  1899. data/rust-vendor/wit-parser/tests/ui/parse-fail/pkg-cycle2.wit.result +5 -0
  1900. data/rust-vendor/wit-parser/tests/ui/parse-fail/resources-multiple-returns-borrow.wit +10 -0
  1901. data/rust-vendor/wit-parser/tests/ui/parse-fail/resources-multiple-returns-borrow.wit.result +5 -0
  1902. data/rust-vendor/wit-parser/tests/ui/parse-fail/resources-return-borrow.wit +10 -0
  1903. data/rust-vendor/wit-parser/tests/ui/parse-fail/resources-return-borrow.wit.result +5 -0
  1904. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow1.wit +7 -0
  1905. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow1.wit.result +5 -0
  1906. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow2.wit +8 -0
  1907. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow2.wit.result +5 -0
  1908. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow3.wit +7 -0
  1909. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow3.wit.result +5 -0
  1910. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow4.wit +7 -0
  1911. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow4.wit.result +5 -0
  1912. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow5.wit +7 -0
  1913. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow5.wit.result +5 -0
  1914. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow6.wit +7 -0
  1915. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow6.wit.result +5 -0
  1916. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow7.wit +11 -0
  1917. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow7.wit.result +5 -0
  1918. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow8/deps/baz.wit +9 -0
  1919. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow8/foo.wit +7 -0
  1920. data/rust-vendor/wit-parser/tests/ui/parse-fail/return-borrow8.wit.result +5 -0
  1921. data/rust-vendor/wit-parser/tests/ui/parse-fail/type-and-resource-same-name/deps/dep/foo.wit +5 -0
  1922. data/rust-vendor/wit-parser/tests/ui/parse-fail/type-and-resource-same-name/foo.wit +8 -0
  1923. data/rust-vendor/wit-parser/tests/ui/parse-fail/type-and-resource-same-name.wit.result +5 -0
  1924. data/rust-vendor/wit-parser/tests/ui/parse-fail/undefined-typed.wit +6 -0
  1925. data/rust-vendor/wit-parser/tests/ui/parse-fail/undefined-typed.wit.result +5 -0
  1926. data/rust-vendor/wit-parser/tests/ui/parse-fail/unknown-interface.wit +7 -0
  1927. data/rust-vendor/wit-parser/tests/ui/parse-fail/unknown-interface.wit.result +5 -0
  1928. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-interface1.wit +7 -0
  1929. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-interface1.wit.result +5 -0
  1930. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-interface2.wit +8 -0
  1931. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-interface2.wit.result +5 -0
  1932. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-interface3.wit +5 -0
  1933. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-interface3.wit.result +5 -0
  1934. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-interface4.wit +7 -0
  1935. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-interface4.wit.result +7 -0
  1936. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use1.wit +7 -0
  1937. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use1.wit.result +5 -0
  1938. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use10/bar.wit +5 -0
  1939. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use10/foo.wit +2 -0
  1940. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use10.wit.result +5 -0
  1941. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use2.wit +10 -0
  1942. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use2.wit.result +5 -0
  1943. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use3.wit +11 -0
  1944. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use3.wit.result +5 -0
  1945. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use7.wit +10 -0
  1946. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use7.wit.result +5 -0
  1947. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use8.wit +9 -0
  1948. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use8.wit.result +5 -0
  1949. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use9.wit +9 -0
  1950. data/rust-vendor/wit-parser/tests/ui/parse-fail/unresolved-use9.wit.result +5 -0
  1951. data/rust-vendor/wit-parser/tests/ui/parse-fail/unterminated-string.wit.result +5 -0
  1952. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-and-include-world/deps/bar/.gitkeep +0 -0
  1953. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-and-include-world/deps/bar/baz.wit +4 -0
  1954. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-and-include-world/root.wit +7 -0
  1955. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-and-include-world.wit.result +5 -0
  1956. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-conflict.wit +11 -0
  1957. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-conflict.wit.result +5 -0
  1958. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-conflict2.wit +13 -0
  1959. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-conflict2.wit.result +5 -0
  1960. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-conflict3.wit +13 -0
  1961. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-conflict3.wit.result +5 -0
  1962. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-cycle1.wit +7 -0
  1963. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-cycle1.wit.result +5 -0
  1964. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-cycle4.wit +14 -0
  1965. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-cycle4.wit.result +5 -0
  1966. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-shadow1.wit +7 -0
  1967. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-shadow1.wit.result +5 -0
  1968. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-world/deps/bar/.gitkeep +0 -0
  1969. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-world/deps/bar/baz.wit +4 -0
  1970. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-world/root.wit +7 -0
  1971. data/rust-vendor/wit-parser/tests/ui/parse-fail/use-world.wit.result +5 -0
  1972. data/rust-vendor/wit-parser/tests/ui/parse-fail/very-nested-packages.wit +8 -0
  1973. data/rust-vendor/wit-parser/tests/ui/parse-fail/very-nested-packages.wit.result +5 -0
  1974. data/rust-vendor/wit-parser/tests/ui/parse-fail/world-interface-clash.wit +3 -0
  1975. data/rust-vendor/wit-parser/tests/ui/parse-fail/world-interface-clash.wit.result +5 -0
  1976. data/rust-vendor/wit-parser/tests/ui/parse-fail/world-same-fields2.wit +8 -0
  1977. data/rust-vendor/wit-parser/tests/ui/parse-fail/world-same-fields2.wit.result +5 -0
  1978. data/rust-vendor/wit-parser/tests/ui/parse-fail/world-same-fields3.wit +8 -0
  1979. data/rust-vendor/wit-parser/tests/ui/parse-fail/world-same-fields3.wit.result +5 -0
  1980. data/rust-vendor/wit-parser/tests/ui/parse-fail/world-top-level-func.wit +5 -0
  1981. data/rust-vendor/wit-parser/tests/ui/parse-fail/world-top-level-func.wit.result +5 -0
  1982. data/rust-vendor/wit-parser/tests/ui/parse-fail/world-top-level-func2.wit +4 -0
  1983. data/rust-vendor/wit-parser/tests/ui/parse-fail/world-top-level-func2.wit.result +5 -0
  1984. data/rust-vendor/wit-parser/tests/ui/random.wit +27 -0
  1985. data/rust-vendor/wit-parser/tests/ui/random.wit.json +56 -0
  1986. data/rust-vendor/wit-parser/tests/ui/resources-empty.wit +10 -0
  1987. data/rust-vendor/wit-parser/tests/ui/resources-empty.wit.json +70 -0
  1988. data/rust-vendor/wit-parser/tests/ui/resources-multiple-returns-own.wit +10 -0
  1989. data/rust-vendor/wit-parser/tests/ui/resources-multiple-returns-own.wit.json +85 -0
  1990. data/rust-vendor/wit-parser/tests/ui/resources-multiple.wit +17 -0
  1991. data/rust-vendor/wit-parser/tests/ui/resources-multiple.wit.json +207 -0
  1992. data/rust-vendor/wit-parser/tests/ui/resources-return-own.wit +10 -0
  1993. data/rust-vendor/wit-parser/tests/ui/resources-return-own.wit.json +73 -0
  1994. data/rust-vendor/wit-parser/tests/ui/resources.wit +55 -0
  1995. data/rust-vendor/wit-parser/tests/ui/resources.wit.json +387 -0
  1996. data/rust-vendor/wit-parser/tests/ui/resources1.wit +12 -0
  1997. data/rust-vendor/wit-parser/tests/ui/resources1.wit.json +92 -0
  1998. data/rust-vendor/wit-parser/tests/ui/same-name-import-export.wit +6 -0
  1999. data/rust-vendor/wit-parser/tests/ui/same-name-import-export.wit.json +39 -0
  2000. data/rust-vendor/wit-parser/tests/ui/shared-types.wit +10 -0
  2001. data/rust-vendor/wit-parser/tests/ui/shared-types.wit.json +79 -0
  2002. data/rust-vendor/wit-parser/tests/ui/simple-wasm-text.wat +6 -0
  2003. data/rust-vendor/wit-parser/tests/ui/simple-wasm-text.wit.json +21 -0
  2004. data/rust-vendor/wit-parser/tests/ui/since-and-unstable.wit +107 -0
  2005. data/rust-vendor/wit-parser/tests/ui/since-and-unstable.wit.json +608 -0
  2006. data/rust-vendor/wit-parser/tests/ui/streams-and-futures.wit +15 -0
  2007. data/rust-vendor/wit-parser/tests/ui/streams-and-futures.wit.json +205 -0
  2008. data/rust-vendor/wit-parser/tests/ui/stress-export-elaborate.wit +54 -0
  2009. data/rust-vendor/wit-parser/tests/ui/stress-export-elaborate.wit.json +1156 -0
  2010. data/rust-vendor/wit-parser/tests/ui/type-then-eof.wit +5 -0
  2011. data/rust-vendor/wit-parser/tests/ui/type-then-eof.wit.json +28 -0
  2012. data/rust-vendor/wit-parser/tests/ui/types.wit +59 -0
  2013. data/rust-vendor/wit-parser/tests/ui/types.wit.json +768 -0
  2014. data/rust-vendor/wit-parser/tests/ui/union-fuzz-1.wit +9 -0
  2015. data/rust-vendor/wit-parser/tests/ui/union-fuzz-1.wit.json +35 -0
  2016. data/rust-vendor/wit-parser/tests/ui/union-fuzz-2.wit +12 -0
  2017. data/rust-vendor/wit-parser/tests/ui/union-fuzz-2.wit.json +62 -0
  2018. data/rust-vendor/wit-parser/tests/ui/unstable-resource.wit +17 -0
  2019. data/rust-vendor/wit-parser/tests/ui/unstable-resource.wit.json +44 -0
  2020. data/rust-vendor/wit-parser/tests/ui/use-chain.wit +11 -0
  2021. data/rust-vendor/wit-parser/tests/ui/use-chain.wit.json +53 -0
  2022. data/rust-vendor/wit-parser/tests/ui/use.wit +34 -0
  2023. data/rust-vendor/wit-parser/tests/ui/use.wit.json +168 -0
  2024. data/rust-vendor/wit-parser/tests/ui/version-syntax.wit +10 -0
  2025. data/rust-vendor/wit-parser/tests/ui/version-syntax.wit.json +57 -0
  2026. data/rust-vendor/wit-parser/tests/ui/versions/deps/a1/foo.wit +5 -0
  2027. data/rust-vendor/wit-parser/tests/ui/versions/deps/a2/foo.wit +5 -0
  2028. data/rust-vendor/wit-parser/tests/ui/versions/foo.wit +7 -0
  2029. data/rust-vendor/wit-parser/tests/ui/versions.wit.json +91 -0
  2030. data/rust-vendor/wit-parser/tests/ui/wasi.wit +178 -0
  2031. data/rust-vendor/wit-parser/tests/ui/wasi.wit.json +539 -0
  2032. data/rust-vendor/wit-parser/tests/ui/with-resource-as.wit +15 -0
  2033. data/rust-vendor/wit-parser/tests/ui/with-resource-as.wit.json +221 -0
  2034. data/rust-vendor/wit-parser/tests/ui/world-diamond.wit +23 -0
  2035. data/rust-vendor/wit-parser/tests/ui/world-diamond.wit.json +115 -0
  2036. data/rust-vendor/wit-parser/tests/ui/world-iface-no-collide.wit +11 -0
  2037. data/rust-vendor/wit-parser/tests/ui/world-iface-no-collide.wit.json +67 -0
  2038. data/rust-vendor/wit-parser/tests/ui/world-implicit-import1.wit +12 -0
  2039. data/rust-vendor/wit-parser/tests/ui/world-implicit-import1.wit.json +81 -0
  2040. data/rust-vendor/wit-parser/tests/ui/world-implicit-import2.wit +11 -0
  2041. data/rust-vendor/wit-parser/tests/ui/world-implicit-import2.wit.json +68 -0
  2042. data/rust-vendor/wit-parser/tests/ui/world-implicit-import3.wit +11 -0
  2043. data/rust-vendor/wit-parser/tests/ui/world-implicit-import3.wit.json +69 -0
  2044. data/rust-vendor/wit-parser/tests/ui/world-same-fields4.wit +13 -0
  2045. data/rust-vendor/wit-parser/tests/ui/world-same-fields4.wit.json +82 -0
  2046. data/rust-vendor/wit-parser/tests/ui/world-top-level-funcs.wit +9 -0
  2047. data/rust-vendor/wit-parser/tests/ui/world-top-level-funcs.wit.json +79 -0
  2048. data/rust-vendor/wit-parser/tests/ui/world-top-level-resources.wit +24 -0
  2049. data/rust-vendor/wit-parser/tests/ui/world-top-level-resources.wit.json +225 -0
  2050. data/rust-vendor/wit-parser/tests/ui/worlds-union-dedup.wit +23 -0
  2051. data/rust-vendor/wit-parser/tests/ui/worlds-union-dedup.wit.json +112 -0
  2052. data/rust-vendor/wit-parser/tests/ui/worlds-with-types.wit +34 -0
  2053. data/rust-vendor/wit-parser/tests/ui/worlds-with-types.wit.json +188 -0
  2054. data/rust-vendor/zerocopy/.cargo-checksum.json +1 -1
  2055. data/rust-vendor/zerocopy/.cargo_vcs_info.json +1 -2
  2056. data/rust-vendor/zerocopy/Cargo.lock +3 -3
  2057. data/rust-vendor/zerocopy/Cargo.toml +4 -4
  2058. data/rust-vendor/zerocopy/Cargo.toml.orig +4 -4
  2059. data/rust-vendor/zerocopy/agent_docs/reviewing.md +8 -0
  2060. data/rust-vendor/zerocopy/build.rs +1 -0
  2061. data/rust-vendor/zerocopy/ci/release_crate_version.sh +3 -0
  2062. data/rust-vendor/zerocopy/src/doctests.rs +18 -2
  2063. data/rust-vendor/zerocopy/src/impls.rs +7 -4
  2064. data/rust-vendor/zerocopy/src/lib.rs +60 -28
  2065. data/rust-vendor/zerocopy/src/macros.rs +24 -4
  2066. data/rust-vendor/zerocopy/src/pointer/invariant.rs +31 -3
  2067. data/rust-vendor/zerocopy/src/pointer/mod.rs +2 -2
  2068. data/rust-vendor/zerocopy/src/pointer/ptr.rs +3 -3
  2069. data/rust-vendor/zerocopy/src/util/macros.rs +21 -6
  2070. data/rust-vendor/zerocopy/tests/trybuild.rs +3 -18
  2071. data/rust-vendor/zerocopy-derive/.cargo-checksum.json +1 -1
  2072. data/rust-vendor/zerocopy-derive/.cargo_vcs_info.json +1 -1
  2073. data/rust-vendor/zerocopy-derive/Cargo.lock +1 -1
  2074. data/rust-vendor/zerocopy-derive/Cargo.toml +9 -2
  2075. data/rust-vendor/zerocopy-derive/Cargo.toml.orig +5 -2
  2076. data/rust-vendor/zerocopy-derive/src/derive/from_bytes.rs +9 -7
  2077. data/rust-vendor/zerocopy-derive/src/derive/into_bytes.rs +8 -4
  2078. data/rust-vendor/zerocopy-derive/src/derive/try_from_bytes.rs +52 -18
  2079. data/rust-vendor/zerocopy-derive/src/derive/unaligned.rs +3 -3
  2080. data/rust-vendor/zerocopy-derive/src/output_tests/expected/from_bytes_enum.expected.rs +7 -3
  2081. data/rust-vendor/zerocopy-derive/src/output_tests/expected/from_bytes_struct.expected.rs +7 -3
  2082. data/rust-vendor/zerocopy-derive/src/output_tests/expected/from_bytes_union.expected.rs +7 -3
  2083. data/rust-vendor/zerocopy-derive/src/output_tests/expected/from_zeros.expected.rs +7 -3
  2084. data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes.expected.rs +7 -3
  2085. data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes_enum_1.expected.rs +22 -10
  2086. data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes_enum_2.expected.rs +22 -10
  2087. data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes_enum_3.expected.rs +22 -10
  2088. data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes_trivial_is_bit_valid_enum.expected.rs +7 -3
  2089. data/rust-vendor/zerocopy-derive/src/util.rs +72 -5
  2090. data/rust-vendor/zerocopy-derive/tests/on_error.rs +169 -0
  2091. data/rust-vendor/zerocopy-derive/tests/trybuild.rs +9 -7
  2092. data/rust-vendor/zerocopy-derive/tests/ui-msrv/cfgs/on_error.rs +19 -0
  2093. data/rust-vendor/zerocopy-derive/tests/ui-msrv/cfgs/on_error.stderr +16 -0
  2094. data/rust-vendor/zerocopy-derive/tests/ui-msrv/{union_into_bytes_cfg → cfgs}/union_into_bytes_cfg.stderr +1 -1
  2095. data/rust-vendor/zerocopy-derive/tests/ui-nightly/cfgs/on_error.rs +19 -0
  2096. data/rust-vendor/zerocopy-derive/tests/ui-nightly/cfgs/on_error.stderr +31 -0
  2097. data/rust-vendor/zerocopy-derive/tests/ui-nightly/cfgs/union_into_bytes_cfg.stderr +8 -0
  2098. data/rust-vendor/zerocopy-derive/tests/ui-nightly/union.stderr +0 -14
  2099. data/rust-vendor/zerocopy-derive/tests/ui-stable/cfgs/on_error.rs +19 -0
  2100. data/rust-vendor/zerocopy-derive/tests/ui-stable/cfgs/on_error.stderr +27 -0
  2101. data/rust-vendor/zerocopy-derive/tests/ui-stable/cfgs/union_into_bytes_cfg.stderr +8 -0
  2102. data/rust-vendor/zerocopy-derive/tests/ui-stable/union.stderr +0 -14
  2103. data/rust-vendor/zmij/.cargo-checksum.json +1 -1
  2104. data/rust-vendor/zmij/.cargo_vcs_info.json +1 -1
  2105. data/rust-vendor/zmij/.github/workflows/ci.yml +9 -6
  2106. data/rust-vendor/zmij/Cargo.lock +281 -58
  2107. data/rust-vendor/zmij/Cargo.toml +3 -3
  2108. data/rust-vendor/zmij/Cargo.toml.orig +3 -3
  2109. data/rust-vendor/zmij/README.md +1 -1
  2110. data/rust-vendor/zmij/src/lib.rs +124 -79
  2111. data/rust-vendor/zmij/src/tests.rs +11 -5
  2112. data/rust-vendor/zmij/tests/ryu_comparison.rs +3 -3
  2113. metadata +1841 -55
  2114. data/rust-vendor/libc/src/qurt/hexagon.rs +0 -340
  2115. data/rust-vendor/regex/.vim/coc-settings.json +0 -6
  2116. data/rust-vendor/regex/Cross.toml +0 -7
  2117. data/rust-vendor/regex/rustfmt.toml +0 -2
  2118. data/rust-vendor/regex/test +0 -46
  2119. data/rust-vendor/regex/testdata/README.md +0 -22
  2120. data/rust-vendor/regex/testdata/fowler/basic.toml +0 -1611
  2121. data/rust-vendor/regex/testdata/fowler/dat/README +0 -25
  2122. data/rust-vendor/regex/testdata/fowler/dat/basic.dat +0 -223
  2123. data/rust-vendor/regex/testdata/fowler/dat/nullsubexpr.dat +0 -74
  2124. data/rust-vendor/regex/testdata/fowler/dat/repetition.dat +0 -169
  2125. data/rust-vendor/regex/testdata/fowler/nullsubexpr.toml +0 -405
  2126. data/rust-vendor/regex/testdata/fowler/repetition.toml +0 -746
  2127. data/rust-vendor/regex-automata/test +0 -95
  2128. data/rust-vendor/regex-automata/tests/fuzz/mod.rs +0 -2
  2129. data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_dense_crash-9486fb7c8a93b12c12a62166b43d31640c0208a9 +0 -0
  2130. data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_dense_minimized-from-9486fb7c8a93b12c12a62166b43d31640c0208a9 +0 -0
  2131. data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_sparse_crash-0da59c0434eaf35e5a6b470fa9244bb79c72b000 +0 -0
  2132. data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_sparse_crash-18cfc246f2ddfc3dfc92b0c7893178c7cf65efa9 +0 -0
  2133. data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_sparse_crash-61fd8e3003bf9d99f6c1e5a8488727eefd234b98 +0 -0
  2134. data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_sparse_crash-a1b839d899ced76d5d7d0f78f9edb7a421505838 +0 -0
  2135. data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_sparse_crash-c383ae07ec5e191422eadc492117439011816570 +0 -0
  2136. data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_sparse_crash-d07703ceb94b10dcd9e4acb809f2051420449e2b +0 -0
  2137. data/rust-vendor/regex-automata/tests/fuzz/testdata/deserialize_sparse_crash-dbb8172d3984e7e7d03f4b5f8bb86ecd1460eff9 +0 -0
  2138. data/rust-vendor/regex-automata/tests/gen/README.md +0 -65
  2139. data/rust-vendor/regex-automata/tests/gen/dense/multi_pattern_v2_fwd.bigendian.dfa +0 -0
  2140. data/rust-vendor/regex-automata/tests/gen/dense/multi_pattern_v2_fwd.littleendian.dfa +0 -0
  2141. data/rust-vendor/regex-automata/tests/gen/dense/multi_pattern_v2_rev.bigendian.dfa +0 -0
  2142. data/rust-vendor/regex-automata/tests/gen/dense/multi_pattern_v2_rev.littleendian.dfa +0 -0
  2143. data/rust-vendor/regex-automata/tests/gen/sparse/multi_pattern_v2_fwd.bigendian.dfa +0 -0
  2144. data/rust-vendor/regex-automata/tests/gen/sparse/multi_pattern_v2_fwd.littleendian.dfa +0 -0
  2145. data/rust-vendor/regex-automata/tests/gen/sparse/multi_pattern_v2_rev.bigendian.dfa +0 -0
  2146. data/rust-vendor/regex-automata/tests/gen/sparse/multi_pattern_v2_rev.littleendian.dfa +0 -0
  2147. data/rust-vendor/regex-syntax/benches/bench.rs +0 -63
  2148. data/rust-vendor/regex-syntax/test +0 -30
  2149. data/rust-vendor/zerocopy/tests/ui-msrv/invalid-impls/invalid-impls.rs +0 -31
  2150. data/rust-vendor/zerocopy/tests/ui-msrv/invalid-impls/invalid-impls.stderr +0 -159
  2151. data/rust-vendor/zerocopy/tests/ui-nightly/invalid-impls/invalid-impls.rs +0 -31
  2152. data/rust-vendor/zerocopy/tests/ui-nightly/invalid-impls/invalid-impls.stderr +0 -139
  2153. data/rust-vendor/zerocopy/tests/ui-stable/invalid-impls/invalid-impls.rs +0 -31
  2154. data/rust-vendor/zerocopy/tests/ui-stable/invalid-impls/invalid-impls.stderr +0 -155
  2155. data/rust-vendor/zerocopy-derive/tests/ui-nightly/union_into_bytes_cfg/union_into_bytes_cfg.stderr +0 -22
  2156. data/rust-vendor/zerocopy-derive/tests/ui-stable/union_into_bytes_cfg/union_into_bytes_cfg.stderr +0 -22
  2157. /data/rust-vendor/{getrandom → getrandom-0.3.4}/src/backends/sanitizer.rs +0 -0
  2158. /data/rust-vendor/{getrandom → getrandom-0.3.4}/src/backends/wasi_p2.rs +0 -0
  2159. /data/rust-vendor/{getrandom → getrandom-0.3.4}/src/lazy.rs +0 -0
  2160. /data/rust-vendor/{getrandom → getrandom-0.3.4}/src/util_libc.rs +0 -0
  2161. /data/rust-vendor/{wit-bindgen → wit-bindgen-0.46.0}/src/rt/wit_bindgen_cabi.c +0 -0
  2162. /data/rust-vendor/{wit-bindgen → wit-bindgen-0.46.0}/src/rt/wit_bindgen_cabi.o +0 -0
  2163. /data/rust-vendor/zerocopy-derive/tests/ui-msrv/{union_into_bytes_cfg → cfgs}/union_into_bytes_cfg.rs +0 -0
  2164. /data/rust-vendor/zerocopy-derive/tests/ui-nightly/{union_into_bytes_cfg → cfgs}/union_into_bytes_cfg.rs +0 -0
  2165. /data/rust-vendor/zerocopy-derive/tests/ui-stable/{union_into_bytes_cfg → cfgs}/union_into_bytes_cfg.rs +0 -0
@@ -0,0 +1,2380 @@
1
+ use core::{fmt, iter::FusedIterator, marker::PhantomData};
2
+
3
+ use crate::{
4
+ raw::{
5
+ Allocator, Bucket, Global, InsertSlot, RawDrain, RawExtractIf, RawIntoIter, RawIter,
6
+ RawIterHash, RawTable,
7
+ },
8
+ TryReserveError,
9
+ };
10
+
11
+ /// Low-level hash table with explicit hashing.
12
+ ///
13
+ /// The primary use case for this type over [`HashMap`] or [`HashSet`] is to
14
+ /// support types that do not implement the [`Hash`] and [`Eq`] traits, but
15
+ /// instead require additional data not contained in the key itself to compute a
16
+ /// hash and compare two elements for equality.
17
+ ///
18
+ /// Examples of when this can be useful include:
19
+ /// - An `IndexMap` implementation where indices into a `Vec` are stored as
20
+ /// elements in a `HashTable<usize>`. Hashing and comparing the elements
21
+ /// requires indexing the associated `Vec` to get the actual value referred to
22
+ /// by the index.
23
+ /// - Avoiding re-computing a hash when it is already known.
24
+ /// - Mutating the key of an element in a way that doesn't affect its hash.
25
+ ///
26
+ /// To achieve this, `HashTable` methods that search for an element in the table
27
+ /// require a hash value and equality function to be explicitly passed in as
28
+ /// arguments. The method will then iterate over the elements with the given
29
+ /// hash and call the equality function on each of them, until a match is found.
30
+ ///
31
+ /// In most cases, a `HashTable` will not be exposed directly in an API. It will
32
+ /// instead be wrapped in a helper type which handles the work of calculating
33
+ /// hash values and comparing elements.
34
+ ///
35
+ /// Due to its low-level nature, this type provides fewer guarantees than
36
+ /// [`HashMap`] and [`HashSet`]. Specifically, the API allows you to shoot
37
+ /// yourself in the foot by having multiple elements with identical keys in the
38
+ /// table. The table itself will still function correctly and lookups will
39
+ /// arbitrarily return one of the matching elements. However you should avoid
40
+ /// doing this because it changes the runtime of hash table operations from
41
+ /// `O(1)` to `O(k)` where `k` is the number of duplicate entries.
42
+ ///
43
+ /// [`HashMap`]: super::HashMap
44
+ /// [`HashSet`]: super::HashSet
45
+ /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html
46
+ /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html
47
+ pub struct HashTable<T, A = Global>
48
+ where
49
+ A: Allocator,
50
+ {
51
+ pub(crate) raw: RawTable<T, A>,
52
+ }
53
+
54
+ impl<T> HashTable<T, Global> {
55
+ /// Creates an empty `HashTable`.
56
+ ///
57
+ /// The hash table is initially created with a capacity of 0, so it will not allocate until it
58
+ /// is first inserted into.
59
+ ///
60
+ /// # Examples
61
+ ///
62
+ /// ```
63
+ /// use hashbrown::HashTable;
64
+ /// let mut table: HashTable<&str> = HashTable::new();
65
+ /// assert_eq!(table.len(), 0);
66
+ /// assert_eq!(table.capacity(), 0);
67
+ /// ```
68
+ pub const fn new() -> Self {
69
+ Self {
70
+ raw: RawTable::new(),
71
+ }
72
+ }
73
+
74
+ /// Creates an empty `HashTable` with the specified capacity.
75
+ ///
76
+ /// The hash table will be able to hold at least `capacity` elements without
77
+ /// reallocating. If `capacity` is 0, the hash table will not allocate.
78
+ ///
79
+ /// # Examples
80
+ ///
81
+ /// ```
82
+ /// use hashbrown::HashTable;
83
+ /// let mut table: HashTable<&str> = HashTable::with_capacity(10);
84
+ /// assert_eq!(table.len(), 0);
85
+ /// assert!(table.capacity() >= 10);
86
+ /// ```
87
+ pub fn with_capacity(capacity: usize) -> Self {
88
+ Self {
89
+ raw: RawTable::with_capacity(capacity),
90
+ }
91
+ }
92
+ }
93
+
94
+ impl<T, A> HashTable<T, A>
95
+ where
96
+ A: Allocator,
97
+ {
98
+ /// Creates an empty `HashTable` using the given allocator.
99
+ ///
100
+ /// The hash table is initially created with a capacity of 0, so it will not allocate until it
101
+ /// is first inserted into.
102
+ ///
103
+ /// # Examples
104
+ ///
105
+ /// ```
106
+ /// # #[cfg(feature = "nightly")]
107
+ /// # fn test() {
108
+ /// use bumpalo::Bump;
109
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
110
+ /// use std::hash::BuildHasher;
111
+ ///
112
+ /// let bump = Bump::new();
113
+ /// let mut table = HashTable::new_in(&bump);
114
+ /// let hasher = DefaultHashBuilder::default();
115
+ /// let hasher = |val: &_| hasher.hash_one(val);
116
+ ///
117
+ /// // The created HashTable holds none elements
118
+ /// assert_eq!(table.len(), 0);
119
+ ///
120
+ /// // The created HashTable also doesn't allocate memory
121
+ /// assert_eq!(table.capacity(), 0);
122
+ ///
123
+ /// // Now we insert element inside created HashTable
124
+ /// table.insert_unique(hasher(&"One"), "One", hasher);
125
+ /// // We can see that the HashTable holds 1 element
126
+ /// assert_eq!(table.len(), 1);
127
+ /// // And it also allocates some capacity
128
+ /// assert!(table.capacity() > 1);
129
+ /// # }
130
+ /// # fn main() {
131
+ /// # #[cfg(feature = "nightly")]
132
+ /// # test()
133
+ /// # }
134
+ /// ```
135
+ pub const fn new_in(alloc: A) -> Self {
136
+ Self {
137
+ raw: RawTable::new_in(alloc),
138
+ }
139
+ }
140
+
141
+ /// Creates an empty `HashTable` with the specified capacity using the given allocator.
142
+ ///
143
+ /// The hash table will be able to hold at least `capacity` elements without
144
+ /// reallocating. If `capacity` is 0, the hash table will not allocate.
145
+ ///
146
+ /// # Examples
147
+ ///
148
+ /// ```
149
+ /// # #[cfg(feature = "nightly")]
150
+ /// # fn test() {
151
+ /// use bumpalo::Bump;
152
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
153
+ /// use std::hash::BuildHasher;
154
+ ///
155
+ /// let bump = Bump::new();
156
+ /// let mut table = HashTable::with_capacity_in(5, &bump);
157
+ /// let hasher = DefaultHashBuilder::default();
158
+ /// let hasher = |val: &_| hasher.hash_one(val);
159
+ ///
160
+ /// // The created HashTable holds none elements
161
+ /// assert_eq!(table.len(), 0);
162
+ /// // But it can hold at least 5 elements without reallocating
163
+ /// let empty_map_capacity = table.capacity();
164
+ /// assert!(empty_map_capacity >= 5);
165
+ ///
166
+ /// // Now we insert some 5 elements inside created HashTable
167
+ /// table.insert_unique(hasher(&"One"), "One", hasher);
168
+ /// table.insert_unique(hasher(&"Two"), "Two", hasher);
169
+ /// table.insert_unique(hasher(&"Three"), "Three", hasher);
170
+ /// table.insert_unique(hasher(&"Four"), "Four", hasher);
171
+ /// table.insert_unique(hasher(&"Five"), "Five", hasher);
172
+ ///
173
+ /// // We can see that the HashTable holds 5 elements
174
+ /// assert_eq!(table.len(), 5);
175
+ /// // But its capacity isn't changed
176
+ /// assert_eq!(table.capacity(), empty_map_capacity)
177
+ /// # }
178
+ /// # fn main() {
179
+ /// # #[cfg(feature = "nightly")]
180
+ /// # test()
181
+ /// # }
182
+ /// ```
183
+ pub fn with_capacity_in(capacity: usize, alloc: A) -> Self {
184
+ Self {
185
+ raw: RawTable::with_capacity_in(capacity, alloc),
186
+ }
187
+ }
188
+
189
+ /// Returns a reference to the underlying allocator.
190
+ pub fn allocator(&self) -> &A {
191
+ self.raw.allocator()
192
+ }
193
+
194
+ /// Returns a reference to an entry in the table with the given hash and
195
+ /// which satisfies the equality function passed.
196
+ ///
197
+ /// This method will call `eq` for all entries with the given hash, but may
198
+ /// also call it for entries with a different hash. `eq` should only return
199
+ /// true for the desired entry, at which point the search is stopped.
200
+ ///
201
+ /// # Examples
202
+ ///
203
+ /// ```
204
+ /// # #[cfg(feature = "nightly")]
205
+ /// # fn test() {
206
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
207
+ /// use std::hash::BuildHasher;
208
+ ///
209
+ /// let mut table = HashTable::new();
210
+ /// let hasher = DefaultHashBuilder::default();
211
+ /// let hasher = |val: &_| hasher.hash_one(val);
212
+ /// table.insert_unique(hasher(&1), 1, hasher);
213
+ /// table.insert_unique(hasher(&2), 2, hasher);
214
+ /// table.insert_unique(hasher(&3), 3, hasher);
215
+ /// assert_eq!(table.find(hasher(&2), |&val| val == 2), Some(&2));
216
+ /// assert_eq!(table.find(hasher(&4), |&val| val == 4), None);
217
+ /// # }
218
+ /// # fn main() {
219
+ /// # #[cfg(feature = "nightly")]
220
+ /// # test()
221
+ /// # }
222
+ /// ```
223
+ pub fn find(&self, hash: u64, eq: impl FnMut(&T) -> bool) -> Option<&T> {
224
+ self.raw.get(hash, eq)
225
+ }
226
+
227
+ /// Returns a mutable reference to an entry in the table with the given hash
228
+ /// and which satisfies the equality function passed.
229
+ ///
230
+ /// This method will call `eq` for all entries with the given hash, but may
231
+ /// also call it for entries with a different hash. `eq` should only return
232
+ /// true for the desired entry, at which point the search is stopped.
233
+ ///
234
+ /// When mutating an entry, you should ensure that it still retains the same
235
+ /// hash value as when it was inserted, otherwise lookups of that entry may
236
+ /// fail to find it.
237
+ ///
238
+ /// # Examples
239
+ ///
240
+ /// ```
241
+ /// # #[cfg(feature = "nightly")]
242
+ /// # fn test() {
243
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
244
+ /// use std::hash::BuildHasher;
245
+ ///
246
+ /// let mut table = HashTable::new();
247
+ /// let hasher = DefaultHashBuilder::default();
248
+ /// let hasher = |val: &_| hasher.hash_one(val);
249
+ /// table.insert_unique(hasher(&1), (1, "a"), |val| hasher(&val.0));
250
+ /// if let Some(val) = table.find_mut(hasher(&1), |val| val.0 == 1) {
251
+ /// val.1 = "b";
252
+ /// }
253
+ /// assert_eq!(table.find(hasher(&1), |val| val.0 == 1), Some(&(1, "b")));
254
+ /// assert_eq!(table.find(hasher(&2), |val| val.0 == 2), None);
255
+ /// # }
256
+ /// # fn main() {
257
+ /// # #[cfg(feature = "nightly")]
258
+ /// # test()
259
+ /// # }
260
+ /// ```
261
+ pub fn find_mut(&mut self, hash: u64, eq: impl FnMut(&T) -> bool) -> Option<&mut T> {
262
+ self.raw.get_mut(hash, eq)
263
+ }
264
+
265
+ /// Returns an `OccupiedEntry` for an entry in the table with the given hash
266
+ /// and which satisfies the equality function passed.
267
+ ///
268
+ /// This can be used to remove the entry from the table. Call
269
+ /// [`HashTable::entry`] instead if you wish to insert an entry if the
270
+ /// lookup fails.
271
+ ///
272
+ /// This method will call `eq` for all entries with the given hash, but may
273
+ /// also call it for entries with a different hash. `eq` should only return
274
+ /// true for the desired entry, at which point the search is stopped.
275
+ ///
276
+ /// # Examples
277
+ ///
278
+ /// ```
279
+ /// # #[cfg(feature = "nightly")]
280
+ /// # fn test() {
281
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
282
+ /// use std::hash::BuildHasher;
283
+ ///
284
+ /// let mut table = HashTable::new();
285
+ /// let hasher = DefaultHashBuilder::default();
286
+ /// let hasher = |val: &_| hasher.hash_one(val);
287
+ /// table.insert_unique(hasher(&1), (1, "a"), |val| hasher(&val.0));
288
+ /// if let Ok(entry) = table.find_entry(hasher(&1), |val| val.0 == 1) {
289
+ /// entry.remove();
290
+ /// }
291
+ /// assert_eq!(table.find(hasher(&1), |val| val.0 == 1), None);
292
+ /// # }
293
+ /// # fn main() {
294
+ /// # #[cfg(feature = "nightly")]
295
+ /// # test()
296
+ /// # }
297
+ /// ```
298
+ #[cfg_attr(feature = "inline-more", inline)]
299
+ pub fn find_entry(
300
+ &mut self,
301
+ hash: u64,
302
+ eq: impl FnMut(&T) -> bool,
303
+ ) -> Result<OccupiedEntry<'_, T, A>, AbsentEntry<'_, T, A>> {
304
+ match self.raw.find(hash, eq) {
305
+ Some(bucket) => Ok(OccupiedEntry {
306
+ hash,
307
+ bucket,
308
+ table: self,
309
+ }),
310
+ None => Err(AbsentEntry { table: self }),
311
+ }
312
+ }
313
+
314
+ /// Returns an `Entry` for an entry in the table with the given hash
315
+ /// and which satisfies the equality function passed.
316
+ ///
317
+ /// This can be used to remove the entry from the table, or insert a new
318
+ /// entry with the given hash if one doesn't already exist.
319
+ ///
320
+ /// This method will call `eq` for all entries with the given hash, but may
321
+ /// also call it for entries with a different hash. `eq` should only return
322
+ /// true for the desired entry, at which point the search is stopped.
323
+ ///
324
+ /// This method may grow the table in preparation for an insertion. Call
325
+ /// [`HashTable::find_entry`] if this is undesirable.
326
+ ///
327
+ /// `hasher` is called if entries need to be moved or copied to a new table.
328
+ /// This must return the same hash value that each entry was inserted with.
329
+ ///
330
+ /// # Examples
331
+ ///
332
+ /// ```
333
+ /// # #[cfg(feature = "nightly")]
334
+ /// # fn test() {
335
+ /// use hashbrown::hash_table::Entry;
336
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
337
+ /// use std::hash::BuildHasher;
338
+ ///
339
+ /// let mut table = HashTable::new();
340
+ /// let hasher = DefaultHashBuilder::default();
341
+ /// let hasher = |val: &_| hasher.hash_one(val);
342
+ /// table.insert_unique(hasher(&1), (1, "a"), |val| hasher(&val.0));
343
+ /// if let Entry::Occupied(entry) = table.entry(hasher(&1), |val| val.0 == 1, |val| hasher(&val.0))
344
+ /// {
345
+ /// entry.remove();
346
+ /// }
347
+ /// if let Entry::Vacant(entry) = table.entry(hasher(&2), |val| val.0 == 2, |val| hasher(&val.0)) {
348
+ /// entry.insert((2, "b"));
349
+ /// }
350
+ /// assert_eq!(table.find(hasher(&1), |val| val.0 == 1), None);
351
+ /// assert_eq!(table.find(hasher(&2), |val| val.0 == 2), Some(&(2, "b")));
352
+ /// # }
353
+ /// # fn main() {
354
+ /// # #[cfg(feature = "nightly")]
355
+ /// # test()
356
+ /// # }
357
+ /// ```
358
+ #[cfg_attr(feature = "inline-more", inline)]
359
+ pub fn entry(
360
+ &mut self,
361
+ hash: u64,
362
+ eq: impl FnMut(&T) -> bool,
363
+ hasher: impl Fn(&T) -> u64,
364
+ ) -> Entry<'_, T, A> {
365
+ match self.raw.find_or_find_insert_slot(hash, eq, hasher) {
366
+ Ok(bucket) => Entry::Occupied(OccupiedEntry {
367
+ hash,
368
+ bucket,
369
+ table: self,
370
+ }),
371
+ Err(insert_slot) => Entry::Vacant(VacantEntry {
372
+ hash,
373
+ insert_slot,
374
+ table: self,
375
+ }),
376
+ }
377
+ }
378
+
379
+ /// Inserts an element into the `HashTable` with the given hash value, but
380
+ /// without checking whether an equivalent element already exists within the
381
+ /// table.
382
+ ///
383
+ /// `hasher` is called if entries need to be moved or copied to a new table.
384
+ /// This must return the same hash value that each entry was inserted with.
385
+ ///
386
+ /// # Examples
387
+ ///
388
+ /// ```
389
+ /// # #[cfg(feature = "nightly")]
390
+ /// # fn test() {
391
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
392
+ /// use std::hash::BuildHasher;
393
+ ///
394
+ /// let mut v = HashTable::new();
395
+ /// let hasher = DefaultHashBuilder::default();
396
+ /// let hasher = |val: &_| hasher.hash_one(val);
397
+ /// v.insert_unique(hasher(&1), 1, hasher);
398
+ /// # }
399
+ /// # fn main() {
400
+ /// # #[cfg(feature = "nightly")]
401
+ /// # test()
402
+ /// # }
403
+ /// ```
404
+ pub fn insert_unique(
405
+ &mut self,
406
+ hash: u64,
407
+ value: T,
408
+ hasher: impl Fn(&T) -> u64,
409
+ ) -> OccupiedEntry<'_, T, A> {
410
+ let bucket = self.raw.insert(hash, value, hasher);
411
+ OccupiedEntry {
412
+ hash,
413
+ bucket,
414
+ table: self,
415
+ }
416
+ }
417
+
418
+ /// Clears the table, removing all values.
419
+ ///
420
+ /// # Examples
421
+ ///
422
+ /// ```
423
+ /// # #[cfg(feature = "nightly")]
424
+ /// # fn test() {
425
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
426
+ /// use std::hash::BuildHasher;
427
+ ///
428
+ /// let mut v = HashTable::new();
429
+ /// let hasher = DefaultHashBuilder::default();
430
+ /// let hasher = |val: &_| hasher.hash_one(val);
431
+ /// v.insert_unique(hasher(&1), 1, hasher);
432
+ /// v.clear();
433
+ /// assert!(v.is_empty());
434
+ /// # }
435
+ /// # fn main() {
436
+ /// # #[cfg(feature = "nightly")]
437
+ /// # test()
438
+ /// # }
439
+ /// ```
440
+ pub fn clear(&mut self) {
441
+ self.raw.clear();
442
+ }
443
+
444
+ /// Shrinks the capacity of the table as much as possible. It will drop
445
+ /// down as much as possible while maintaining the internal rules
446
+ /// and possibly leaving some space in accordance with the resize policy.
447
+ ///
448
+ /// `hasher` is called if entries need to be moved or copied to a new table.
449
+ /// This must return the same hash value that each entry was inserted with.
450
+ ///
451
+ /// # Examples
452
+ ///
453
+ /// ```
454
+ /// # #[cfg(feature = "nightly")]
455
+ /// # fn test() {
456
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
457
+ /// use std::hash::BuildHasher;
458
+ ///
459
+ /// let mut table = HashTable::with_capacity(100);
460
+ /// let hasher = DefaultHashBuilder::default();
461
+ /// let hasher = |val: &_| hasher.hash_one(val);
462
+ /// table.insert_unique(hasher(&1), 1, hasher);
463
+ /// table.insert_unique(hasher(&2), 2, hasher);
464
+ /// assert!(table.capacity() >= 100);
465
+ /// table.shrink_to_fit(hasher);
466
+ /// assert!(table.capacity() >= 2);
467
+ /// # }
468
+ /// # fn main() {
469
+ /// # #[cfg(feature = "nightly")]
470
+ /// # test()
471
+ /// # }
472
+ /// ```
473
+ pub fn shrink_to_fit(&mut self, hasher: impl Fn(&T) -> u64) {
474
+ self.raw.shrink_to(self.len(), hasher)
475
+ }
476
+
477
+ /// Shrinks the capacity of the table with a lower limit. It will drop
478
+ /// down no lower than the supplied limit while maintaining the internal rules
479
+ /// and possibly leaving some space in accordance with the resize policy.
480
+ ///
481
+ /// `hasher` is called if entries need to be moved or copied to a new table.
482
+ /// This must return the same hash value that each entry was inserted with.
483
+ ///
484
+ /// Panics if the current capacity is smaller than the supplied
485
+ /// minimum capacity.
486
+ ///
487
+ /// # Examples
488
+ ///
489
+ /// ```
490
+ /// # #[cfg(feature = "nightly")]
491
+ /// # fn test() {
492
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
493
+ /// use std::hash::BuildHasher;
494
+ ///
495
+ /// let mut table = HashTable::with_capacity(100);
496
+ /// let hasher = DefaultHashBuilder::default();
497
+ /// let hasher = |val: &_| hasher.hash_one(val);
498
+ /// table.insert_unique(hasher(&1), 1, hasher);
499
+ /// table.insert_unique(hasher(&2), 2, hasher);
500
+ /// assert!(table.capacity() >= 100);
501
+ /// table.shrink_to(10, hasher);
502
+ /// assert!(table.capacity() >= 10);
503
+ /// table.shrink_to(0, hasher);
504
+ /// assert!(table.capacity() >= 2);
505
+ /// # }
506
+ /// # fn main() {
507
+ /// # #[cfg(feature = "nightly")]
508
+ /// # test()
509
+ /// # }
510
+ /// ```
511
+ pub fn shrink_to(&mut self, min_capacity: usize, hasher: impl Fn(&T) -> u64) {
512
+ self.raw.shrink_to(min_capacity, hasher);
513
+ }
514
+
515
+ /// Reserves capacity for at least `additional` more elements to be inserted
516
+ /// in the `HashTable`. The collection may reserve more space to avoid
517
+ /// frequent reallocations.
518
+ ///
519
+ /// `hasher` is called if entries need to be moved or copied to a new table.
520
+ /// This must return the same hash value that each entry was inserted with.
521
+ ///
522
+ /// # Panics
523
+ ///
524
+ /// Panics if the new capacity exceeds [`isize::MAX`] bytes and [`abort`] the program
525
+ /// in case of allocation error. Use [`try_reserve`](HashTable::try_reserve) instead
526
+ /// if you want to handle memory allocation failure.
527
+ ///
528
+ /// [`isize::MAX`]: https://doc.rust-lang.org/std/primitive.isize.html
529
+ /// [`abort`]: https://doc.rust-lang.org/alloc/alloc/fn.handle_alloc_error.html
530
+ ///
531
+ /// # Examples
532
+ ///
533
+ /// ```
534
+ /// # #[cfg(feature = "nightly")]
535
+ /// # fn test() {
536
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
537
+ /// use std::hash::BuildHasher;
538
+ ///
539
+ /// let mut table: HashTable<i32> = HashTable::new();
540
+ /// let hasher = DefaultHashBuilder::default();
541
+ /// let hasher = |val: &_| hasher.hash_one(val);
542
+ /// table.reserve(10, hasher);
543
+ /// assert!(table.capacity() >= 10);
544
+ /// # }
545
+ /// # fn main() {
546
+ /// # #[cfg(feature = "nightly")]
547
+ /// # test()
548
+ /// # }
549
+ /// ```
550
+ pub fn reserve(&mut self, additional: usize, hasher: impl Fn(&T) -> u64) {
551
+ self.raw.reserve(additional, hasher)
552
+ }
553
+
554
+ /// Tries to reserve capacity for at least `additional` more elements to be inserted
555
+ /// in the given `HashTable`. The collection may reserve more space to avoid
556
+ /// frequent reallocations.
557
+ ///
558
+ /// `hasher` is called if entries need to be moved or copied to a new table.
559
+ /// This must return the same hash value that each entry was inserted with.
560
+ ///
561
+ /// # Errors
562
+ ///
563
+ /// If the capacity overflows, or the allocator reports a failure, then an error
564
+ /// is returned.
565
+ ///
566
+ /// # Examples
567
+ ///
568
+ /// ```
569
+ /// # #[cfg(feature = "nightly")]
570
+ /// # fn test() {
571
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
572
+ /// use std::hash::BuildHasher;
573
+ ///
574
+ /// let mut table: HashTable<i32> = HashTable::new();
575
+ /// let hasher = DefaultHashBuilder::default();
576
+ /// let hasher = |val: &_| hasher.hash_one(val);
577
+ /// table
578
+ /// .try_reserve(10, hasher)
579
+ /// .expect("why is the test harness OOMing on 10 bytes?");
580
+ /// # }
581
+ /// # fn main() {
582
+ /// # #[cfg(feature = "nightly")]
583
+ /// # test()
584
+ /// # }
585
+ /// ```
586
+ pub fn try_reserve(
587
+ &mut self,
588
+ additional: usize,
589
+ hasher: impl Fn(&T) -> u64,
590
+ ) -> Result<(), TryReserveError> {
591
+ self.raw.try_reserve(additional, hasher)
592
+ }
593
+
594
+ /// Returns the number of elements the table can hold without reallocating.
595
+ ///
596
+ /// # Examples
597
+ ///
598
+ /// ```
599
+ /// use hashbrown::HashTable;
600
+ /// let table: HashTable<i32> = HashTable::with_capacity(100);
601
+ /// assert!(table.capacity() >= 100);
602
+ /// ```
603
+ pub fn capacity(&self) -> usize {
604
+ self.raw.capacity()
605
+ }
606
+
607
+ /// Returns the number of elements in the table.
608
+ ///
609
+ /// # Examples
610
+ ///
611
+ /// ```
612
+ /// # #[cfg(feature = "nightly")]
613
+ /// # fn test() {
614
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
615
+ /// use std::hash::BuildHasher;
616
+ ///
617
+ /// let hasher = DefaultHashBuilder::default();
618
+ /// let hasher = |val: &_| hasher.hash_one(val);
619
+ /// let mut v = HashTable::new();
620
+ /// assert_eq!(v.len(), 0);
621
+ /// v.insert_unique(hasher(&1), 1, hasher);
622
+ /// assert_eq!(v.len(), 1);
623
+ /// # }
624
+ /// # fn main() {
625
+ /// # #[cfg(feature = "nightly")]
626
+ /// # test()
627
+ /// # }
628
+ /// ```
629
+ pub fn len(&self) -> usize {
630
+ self.raw.len()
631
+ }
632
+
633
+ /// Returns `true` if the set contains no elements.
634
+ ///
635
+ /// # Examples
636
+ ///
637
+ /// ```
638
+ /// # #[cfg(feature = "nightly")]
639
+ /// # fn test() {
640
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
641
+ /// use std::hash::BuildHasher;
642
+ ///
643
+ /// let hasher = DefaultHashBuilder::default();
644
+ /// let hasher = |val: &_| hasher.hash_one(val);
645
+ /// let mut v = HashTable::new();
646
+ /// assert!(v.is_empty());
647
+ /// v.insert_unique(hasher(&1), 1, hasher);
648
+ /// assert!(!v.is_empty());
649
+ /// # }
650
+ /// # fn main() {
651
+ /// # #[cfg(feature = "nightly")]
652
+ /// # test()
653
+ /// # }
654
+ /// ```
655
+ pub fn is_empty(&self) -> bool {
656
+ self.raw.is_empty()
657
+ }
658
+
659
+ /// An iterator visiting all elements in arbitrary order.
660
+ /// The iterator element type is `&'a T`.
661
+ ///
662
+ /// # Examples
663
+ ///
664
+ /// ```
665
+ /// # #[cfg(feature = "nightly")]
666
+ /// # fn test() {
667
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
668
+ /// use std::hash::BuildHasher;
669
+ ///
670
+ /// let mut table = HashTable::new();
671
+ /// let hasher = DefaultHashBuilder::default();
672
+ /// let hasher = |val: &_| hasher.hash_one(val);
673
+ /// table.insert_unique(hasher(&"a"), "b", hasher);
674
+ /// table.insert_unique(hasher(&"b"), "b", hasher);
675
+ ///
676
+ /// // Will print in an arbitrary order.
677
+ /// for x in table.iter() {
678
+ /// println!("{}", x);
679
+ /// }
680
+ /// # }
681
+ /// # fn main() {
682
+ /// # #[cfg(feature = "nightly")]
683
+ /// # test()
684
+ /// # }
685
+ /// ```
686
+ pub fn iter(&self) -> Iter<'_, T> {
687
+ Iter {
688
+ inner: unsafe { self.raw.iter() },
689
+ marker: PhantomData,
690
+ }
691
+ }
692
+
693
+ /// An iterator visiting all elements in arbitrary order,
694
+ /// with mutable references to the elements.
695
+ /// The iterator element type is `&'a mut T`.
696
+ ///
697
+ /// # Examples
698
+ ///
699
+ /// ```
700
+ /// # #[cfg(feature = "nightly")]
701
+ /// # fn test() {
702
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
703
+ /// use std::hash::BuildHasher;
704
+ ///
705
+ /// let mut table = HashTable::new();
706
+ /// let hasher = DefaultHashBuilder::default();
707
+ /// let hasher = |val: &_| hasher.hash_one(val);
708
+ /// table.insert_unique(hasher(&1), 1, hasher);
709
+ /// table.insert_unique(hasher(&2), 2, hasher);
710
+ /// table.insert_unique(hasher(&3), 3, hasher);
711
+ ///
712
+ /// // Update all values
713
+ /// for val in table.iter_mut() {
714
+ /// *val *= 2;
715
+ /// }
716
+ ///
717
+ /// assert_eq!(table.len(), 3);
718
+ /// let mut vec: Vec<i32> = Vec::new();
719
+ ///
720
+ /// for val in &table {
721
+ /// println!("val: {}", val);
722
+ /// vec.push(*val);
723
+ /// }
724
+ ///
725
+ /// // The `Iter` iterator produces items in arbitrary order, so the
726
+ /// // items must be sorted to test them against a sorted array.
727
+ /// vec.sort_unstable();
728
+ /// assert_eq!(vec, [2, 4, 6]);
729
+ ///
730
+ /// assert_eq!(table.len(), 3);
731
+ /// # }
732
+ /// # fn main() {
733
+ /// # #[cfg(feature = "nightly")]
734
+ /// # test()
735
+ /// # }
736
+ /// ```
737
+ pub fn iter_mut(&mut self) -> IterMut<'_, T> {
738
+ IterMut {
739
+ inner: unsafe { self.raw.iter() },
740
+ marker: PhantomData,
741
+ }
742
+ }
743
+
744
+ /// An iterator visiting all elements which may match a hash.
745
+ /// The iterator element type is `&'a T`.
746
+ ///
747
+ /// This iterator may return elements from the table that have a hash value
748
+ /// different than the one provided. You should always validate the returned
749
+ /// values before using them.
750
+ ///
751
+ /// # Examples
752
+ ///
753
+ /// ```
754
+ /// # #[cfg(feature = "nightly")]
755
+ /// # fn test() {
756
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
757
+ /// use std::hash::BuildHasher;
758
+ ///
759
+ /// let mut table = HashTable::new();
760
+ /// let hasher = DefaultHashBuilder::default();
761
+ /// let hasher = |val: &_| hasher.hash_one(val);
762
+ /// table.insert_unique(hasher(&"a"), "a", hasher);
763
+ /// table.insert_unique(hasher(&"a"), "b", hasher);
764
+ /// table.insert_unique(hasher(&"b"), "c", hasher);
765
+ ///
766
+ /// // Will print "a" and "b" (and possibly "c") in an arbitrary order.
767
+ /// for x in table.iter_hash(hasher(&"a")) {
768
+ /// println!("{}", x);
769
+ /// }
770
+ /// # }
771
+ /// # fn main() {
772
+ /// # #[cfg(feature = "nightly")]
773
+ /// # test()
774
+ /// # }
775
+ /// ```
776
+ pub fn iter_hash(&self, hash: u64) -> IterHash<'_, T> {
777
+ IterHash {
778
+ inner: unsafe { self.raw.iter_hash(hash) },
779
+ marker: PhantomData,
780
+ }
781
+ }
782
+
783
+ /// A mutable iterator visiting all elements which may match a hash.
784
+ /// The iterator element type is `&'a mut T`.
785
+ ///
786
+ /// This iterator may return elements from the table that have a hash value
787
+ /// different than the one provided. You should always validate the returned
788
+ /// values before using them.
789
+ ///
790
+ /// # Examples
791
+ ///
792
+ /// ```
793
+ /// # #[cfg(feature = "nightly")]
794
+ /// # fn test() {
795
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
796
+ /// use std::hash::BuildHasher;
797
+ ///
798
+ /// let mut table = HashTable::new();
799
+ /// let hasher = DefaultHashBuilder::default();
800
+ /// let hasher = |val: &_| hasher.hash_one(val);
801
+ /// table.insert_unique(hasher(&1), 2, hasher);
802
+ /// table.insert_unique(hasher(&1), 3, hasher);
803
+ /// table.insert_unique(hasher(&2), 5, hasher);
804
+ ///
805
+ /// // Update matching values
806
+ /// for val in table.iter_hash_mut(hasher(&1)) {
807
+ /// *val *= 2;
808
+ /// }
809
+ ///
810
+ /// assert_eq!(table.len(), 3);
811
+ /// let mut vec: Vec<i32> = Vec::new();
812
+ ///
813
+ /// for val in &table {
814
+ /// println!("val: {}", val);
815
+ /// vec.push(*val);
816
+ /// }
817
+ ///
818
+ /// // The values will contain 4 and 6 and may contain either 5 or 10.
819
+ /// assert!(vec.contains(&4));
820
+ /// assert!(vec.contains(&6));
821
+ ///
822
+ /// assert_eq!(table.len(), 3);
823
+ /// # }
824
+ /// # fn main() {
825
+ /// # #[cfg(feature = "nightly")]
826
+ /// # test()
827
+ /// # }
828
+ /// ```
829
+ pub fn iter_hash_mut(&mut self, hash: u64) -> IterHashMut<'_, T> {
830
+ IterHashMut {
831
+ inner: unsafe { self.raw.iter_hash(hash) },
832
+ marker: PhantomData,
833
+ }
834
+ }
835
+
836
+ /// Retains only the elements specified by the predicate.
837
+ ///
838
+ /// In other words, remove all elements `e` such that `f(&e)` returns `false`.
839
+ ///
840
+ /// # Examples
841
+ ///
842
+ /// ```
843
+ /// # #[cfg(feature = "nightly")]
844
+ /// # fn test() {
845
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
846
+ /// use std::hash::BuildHasher;
847
+ ///
848
+ /// let mut table = HashTable::new();
849
+ /// let hasher = DefaultHashBuilder::default();
850
+ /// let hasher = |val: &_| hasher.hash_one(val);
851
+ /// for x in 1..=6 {
852
+ /// table.insert_unique(hasher(&x), x, hasher);
853
+ /// }
854
+ /// table.retain(|&mut x| x % 2 == 0);
855
+ /// assert_eq!(table.len(), 3);
856
+ /// # }
857
+ /// # fn main() {
858
+ /// # #[cfg(feature = "nightly")]
859
+ /// # test()
860
+ /// # }
861
+ /// ```
862
+ pub fn retain(&mut self, mut f: impl FnMut(&mut T) -> bool) {
863
+ // Here we only use `iter` as a temporary, preventing use-after-free
864
+ unsafe {
865
+ for item in self.raw.iter() {
866
+ if !f(item.as_mut()) {
867
+ self.raw.erase(item);
868
+ }
869
+ }
870
+ }
871
+ }
872
+
873
+ /// Clears the set, returning all elements in an iterator.
874
+ ///
875
+ /// # Examples
876
+ ///
877
+ /// ```
878
+ /// # #[cfg(feature = "nightly")]
879
+ /// # fn test() {
880
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
881
+ /// use std::hash::BuildHasher;
882
+ ///
883
+ /// let mut table = HashTable::new();
884
+ /// let hasher = DefaultHashBuilder::default();
885
+ /// let hasher = |val: &_| hasher.hash_one(val);
886
+ /// for x in 1..=3 {
887
+ /// table.insert_unique(hasher(&x), x, hasher);
888
+ /// }
889
+ /// assert!(!table.is_empty());
890
+ ///
891
+ /// // print 1, 2, 3 in an arbitrary order
892
+ /// for i in table.drain() {
893
+ /// println!("{}", i);
894
+ /// }
895
+ ///
896
+ /// assert!(table.is_empty());
897
+ /// # }
898
+ /// # fn main() {
899
+ /// # #[cfg(feature = "nightly")]
900
+ /// # test()
901
+ /// # }
902
+ /// ```
903
+ pub fn drain(&mut self) -> Drain<'_, T, A> {
904
+ Drain {
905
+ inner: self.raw.drain(),
906
+ }
907
+ }
908
+
909
+ /// Drains elements which are true under the given predicate,
910
+ /// and returns an iterator over the removed items.
911
+ ///
912
+ /// In other words, move all elements `e` such that `f(&e)` returns `true` out
913
+ /// into another iterator.
914
+ ///
915
+ /// If the returned `ExtractIf` is not exhausted, e.g. because it is dropped without iterating
916
+ /// or the iteration short-circuits, then the remaining elements will be retained.
917
+ /// Use [`retain()`] with a negated predicate if you do not need the returned iterator.
918
+ ///
919
+ /// [`retain()`]: HashTable::retain
920
+ ///
921
+ /// # Examples
922
+ ///
923
+ /// ```
924
+ /// # #[cfg(feature = "nightly")]
925
+ /// # fn test() {
926
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
927
+ /// use std::hash::BuildHasher;
928
+ ///
929
+ /// let mut table = HashTable::new();
930
+ /// let hasher = DefaultHashBuilder::default();
931
+ /// let hasher = |val: &_| hasher.hash_one(val);
932
+ /// for x in 0..8 {
933
+ /// table.insert_unique(hasher(&x), x, hasher);
934
+ /// }
935
+ /// let drained: Vec<i32> = table.extract_if(|&mut v| v % 2 == 0).collect();
936
+ ///
937
+ /// let mut evens = drained.into_iter().collect::<Vec<_>>();
938
+ /// let mut odds = table.into_iter().collect::<Vec<_>>();
939
+ /// evens.sort();
940
+ /// odds.sort();
941
+ ///
942
+ /// assert_eq!(evens, vec![0, 2, 4, 6]);
943
+ /// assert_eq!(odds, vec![1, 3, 5, 7]);
944
+ /// # }
945
+ /// # fn main() {
946
+ /// # #[cfg(feature = "nightly")]
947
+ /// # test()
948
+ /// # }
949
+ /// ```
950
+ pub fn extract_if<F>(&mut self, f: F) -> ExtractIf<'_, T, F, A>
951
+ where
952
+ F: FnMut(&mut T) -> bool,
953
+ {
954
+ ExtractIf {
955
+ f,
956
+ inner: RawExtractIf {
957
+ iter: unsafe { self.raw.iter() },
958
+ table: &mut self.raw,
959
+ },
960
+ }
961
+ }
962
+
963
+ /// Attempts to get mutable references to `N` values in the map at once.
964
+ ///
965
+ /// The `eq` argument should be a closure such that `eq(i, k)` returns true if `k` is equal to
966
+ /// the `i`th key to be looked up.
967
+ ///
968
+ /// Returns an array of length `N` with the results of each query. For soundness, at most one
969
+ /// mutable reference will be returned to any value. `None` will be used if the key is missing.
970
+ ///
971
+ /// # Panics
972
+ ///
973
+ /// Panics if any keys are overlapping.
974
+ ///
975
+ /// # Examples
976
+ ///
977
+ /// ```
978
+ /// # #[cfg(feature = "nightly")]
979
+ /// # fn test() {
980
+ /// use hashbrown::hash_table::Entry;
981
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
982
+ /// use std::hash::BuildHasher;
983
+ ///
984
+ /// let mut libraries: HashTable<(&str, u32)> = HashTable::new();
985
+ /// let hasher = DefaultHashBuilder::default();
986
+ /// let hasher = |val: &_| hasher.hash_one(val);
987
+ /// for (k, v) in [
988
+ /// ("Bodleian Library", 1602),
989
+ /// ("Athenæum", 1807),
990
+ /// ("Herzogin-Anna-Amalia-Bibliothek", 1691),
991
+ /// ("Library of Congress", 1800),
992
+ /// ] {
993
+ /// libraries.insert_unique(hasher(&k), (k, v), |(k, _)| hasher(&k));
994
+ /// }
995
+ ///
996
+ /// let keys = ["Athenæum", "Library of Congress"];
997
+ /// let got = libraries.get_many_mut(keys.map(|k| hasher(&k)), |i, val| keys[i] == val.0);
998
+ /// assert_eq!(
999
+ /// got,
1000
+ /// [Some(&mut ("Athenæum", 1807)), Some(&mut ("Library of Congress", 1800))],
1001
+ /// );
1002
+ ///
1003
+ /// // Missing keys result in None
1004
+ /// let keys = ["Athenæum", "New York Public Library"];
1005
+ /// let got = libraries.get_many_mut(keys.map(|k| hasher(&k)), |i, val| keys[i] == val.0);
1006
+ /// assert_eq!(got, [Some(&mut ("Athenæum", 1807)), None]);
1007
+ /// # }
1008
+ /// # fn main() {
1009
+ /// # #[cfg(feature = "nightly")]
1010
+ /// # test()
1011
+ /// # }
1012
+ /// ```
1013
+ ///
1014
+ /// ```should_panic
1015
+ /// # #[cfg(feature = "nightly")]
1016
+ /// # fn test() {
1017
+ /// # use hashbrown::{HashTable, DefaultHashBuilder};
1018
+ /// # use std::hash::BuildHasher;
1019
+ ///
1020
+ /// let mut libraries: HashTable<(&str, u32)> = HashTable::new();
1021
+ /// let hasher = DefaultHashBuilder::default();
1022
+ /// let hasher = |val: &_| hasher.hash_one(val);
1023
+ /// for (k, v) in [
1024
+ /// ("Athenæum", 1807),
1025
+ /// ("Library of Congress", 1800),
1026
+ /// ] {
1027
+ /// libraries.insert_unique(hasher(&k), (k, v), |(k, _)| hasher(&k));
1028
+ /// }
1029
+ ///
1030
+ /// // Duplicate keys result in a panic!
1031
+ /// let keys = ["Athenæum", "Athenæum"];
1032
+ /// let got = libraries.get_many_mut(keys.map(|k| hasher(&k)), |i, val| keys[i] == val.0);
1033
+ /// # }
1034
+ /// # fn main() {
1035
+ /// # #[cfg(feature = "nightly")]
1036
+ /// # test();
1037
+ /// # #[cfg(not(feature = "nightly"))]
1038
+ /// # panic!();
1039
+ /// # }
1040
+ /// ```
1041
+ pub fn get_many_mut<const N: usize>(
1042
+ &mut self,
1043
+ hashes: [u64; N],
1044
+ eq: impl FnMut(usize, &T) -> bool,
1045
+ ) -> [Option<&'_ mut T>; N] {
1046
+ self.raw.get_many_mut(hashes, eq)
1047
+ }
1048
+
1049
+ /// Attempts to get mutable references to `N` values in the map at once, without validating that
1050
+ /// the values are unique.
1051
+ ///
1052
+ /// The `eq` argument should be a closure such that `eq(i, k)` returns true if `k` is equal to
1053
+ /// the `i`th key to be looked up.
1054
+ ///
1055
+ /// Returns an array of length `N` with the results of each query. `None` will be returned if
1056
+ /// any of the keys are missing.
1057
+ ///
1058
+ /// For a safe alternative see [`get_many_mut`](`HashTable::get_many_mut`).
1059
+ ///
1060
+ /// # Safety
1061
+ ///
1062
+ /// Calling this method with overlapping keys is *[undefined behavior]* even if the resulting
1063
+ /// references are not used.
1064
+ ///
1065
+ /// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
1066
+ ///
1067
+ /// # Examples
1068
+ ///
1069
+ /// ```
1070
+ /// # #[cfg(feature = "nightly")]
1071
+ /// # fn test() {
1072
+ /// use hashbrown::hash_table::Entry;
1073
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
1074
+ /// use std::hash::BuildHasher;
1075
+ ///
1076
+ /// let mut libraries: HashTable<(&str, u32)> = HashTable::new();
1077
+ /// let hasher = DefaultHashBuilder::default();
1078
+ /// let hasher = |val: &_| hasher.hash_one(val);
1079
+ /// for (k, v) in [
1080
+ /// ("Bodleian Library", 1602),
1081
+ /// ("Athenæum", 1807),
1082
+ /// ("Herzogin-Anna-Amalia-Bibliothek", 1691),
1083
+ /// ("Library of Congress", 1800),
1084
+ /// ] {
1085
+ /// libraries.insert_unique(hasher(&k), (k, v), |(k, _)| hasher(&k));
1086
+ /// }
1087
+ ///
1088
+ /// let keys = ["Athenæum", "Library of Congress"];
1089
+ /// let got = libraries.get_many_mut(keys.map(|k| hasher(&k)), |i, val| keys[i] == val.0);
1090
+ /// assert_eq!(
1091
+ /// got,
1092
+ /// [Some(&mut ("Athenæum", 1807)), Some(&mut ("Library of Congress", 1800))],
1093
+ /// );
1094
+ ///
1095
+ /// // Missing keys result in None
1096
+ /// let keys = ["Athenæum", "New York Public Library"];
1097
+ /// let got = libraries.get_many_mut(keys.map(|k| hasher(&k)), |i, val| keys[i] == val.0);
1098
+ /// assert_eq!(got, [Some(&mut ("Athenæum", 1807)), None]);
1099
+ /// # }
1100
+ /// # fn main() {
1101
+ /// # #[cfg(feature = "nightly")]
1102
+ /// # test()
1103
+ /// # }
1104
+ /// ```
1105
+ pub unsafe fn get_many_unchecked_mut<const N: usize>(
1106
+ &mut self,
1107
+ hashes: [u64; N],
1108
+ eq: impl FnMut(usize, &T) -> bool,
1109
+ ) -> [Option<&'_ mut T>; N] {
1110
+ self.raw.get_many_unchecked_mut(hashes, eq)
1111
+ }
1112
+
1113
+ /// Returns the total amount of memory allocated internally by the hash
1114
+ /// table, in bytes.
1115
+ ///
1116
+ /// The returned number is informational only. It is intended to be
1117
+ /// primarily used for memory profiling.
1118
+ #[inline]
1119
+ pub fn allocation_size(&self) -> usize {
1120
+ self.raw.allocation_size()
1121
+ }
1122
+ }
1123
+
1124
+ impl<T, A> IntoIterator for HashTable<T, A>
1125
+ where
1126
+ A: Allocator,
1127
+ {
1128
+ type Item = T;
1129
+ type IntoIter = IntoIter<T, A>;
1130
+
1131
+ fn into_iter(self) -> IntoIter<T, A> {
1132
+ IntoIter {
1133
+ inner: self.raw.into_iter(),
1134
+ }
1135
+ }
1136
+ }
1137
+
1138
+ impl<'a, T, A> IntoIterator for &'a HashTable<T, A>
1139
+ where
1140
+ A: Allocator,
1141
+ {
1142
+ type Item = &'a T;
1143
+ type IntoIter = Iter<'a, T>;
1144
+
1145
+ fn into_iter(self) -> Iter<'a, T> {
1146
+ self.iter()
1147
+ }
1148
+ }
1149
+
1150
+ impl<'a, T, A> IntoIterator for &'a mut HashTable<T, A>
1151
+ where
1152
+ A: Allocator,
1153
+ {
1154
+ type Item = &'a mut T;
1155
+ type IntoIter = IterMut<'a, T>;
1156
+
1157
+ fn into_iter(self) -> IterMut<'a, T> {
1158
+ self.iter_mut()
1159
+ }
1160
+ }
1161
+
1162
+ impl<T, A> Default for HashTable<T, A>
1163
+ where
1164
+ A: Allocator + Default,
1165
+ {
1166
+ fn default() -> Self {
1167
+ Self {
1168
+ raw: Default::default(),
1169
+ }
1170
+ }
1171
+ }
1172
+
1173
+ impl<T, A> Clone for HashTable<T, A>
1174
+ where
1175
+ T: Clone,
1176
+ A: Allocator + Clone,
1177
+ {
1178
+ fn clone(&self) -> Self {
1179
+ Self {
1180
+ raw: self.raw.clone(),
1181
+ }
1182
+ }
1183
+ }
1184
+
1185
+ impl<T, A> fmt::Debug for HashTable<T, A>
1186
+ where
1187
+ T: fmt::Debug,
1188
+ A: Allocator,
1189
+ {
1190
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1191
+ f.debug_set().entries(self.iter()).finish()
1192
+ }
1193
+ }
1194
+
1195
+ /// A view into a single entry in a table, which may either be vacant or occupied.
1196
+ ///
1197
+ /// This `enum` is constructed from the [`entry`] method on [`HashTable`].
1198
+ ///
1199
+ /// [`HashTable`]: struct.HashTable.html
1200
+ /// [`entry`]: struct.HashTable.html#method.entry
1201
+ ///
1202
+ /// # Examples
1203
+ ///
1204
+ /// ```
1205
+ /// # #[cfg(feature = "nightly")]
1206
+ /// # fn test() {
1207
+ /// use hashbrown::hash_table::{Entry, OccupiedEntry};
1208
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
1209
+ /// use std::hash::BuildHasher;
1210
+ ///
1211
+ /// let mut table = HashTable::new();
1212
+ /// let hasher = DefaultHashBuilder::default();
1213
+ /// let hasher = |val: &_| hasher.hash_one(val);
1214
+ /// for x in ["a", "b", "c"] {
1215
+ /// table.insert_unique(hasher(&x), x, hasher);
1216
+ /// }
1217
+ /// assert_eq!(table.len(), 3);
1218
+ ///
1219
+ /// // Existing value (insert)
1220
+ /// let entry: Entry<_> = table.entry(hasher(&"a"), |&x| x == "a", hasher);
1221
+ /// let _raw_o: OccupiedEntry<_, _> = entry.insert("a");
1222
+ /// assert_eq!(table.len(), 3);
1223
+ /// // Nonexistent value (insert)
1224
+ /// table.entry(hasher(&"d"), |&x| x == "d", hasher).insert("d");
1225
+ ///
1226
+ /// // Existing value (or_insert)
1227
+ /// table
1228
+ /// .entry(hasher(&"b"), |&x| x == "b", hasher)
1229
+ /// .or_insert("b");
1230
+ /// // Nonexistent value (or_insert)
1231
+ /// table
1232
+ /// .entry(hasher(&"e"), |&x| x == "e", hasher)
1233
+ /// .or_insert("e");
1234
+ ///
1235
+ /// println!("Our HashTable: {:?}", table);
1236
+ ///
1237
+ /// let mut vec: Vec<_> = table.iter().copied().collect();
1238
+ /// // The `Iter` iterator produces items in arbitrary order, so the
1239
+ /// // items must be sorted to test them against a sorted array.
1240
+ /// vec.sort_unstable();
1241
+ /// assert_eq!(vec, ["a", "b", "c", "d", "e"]);
1242
+ /// # }
1243
+ /// # fn main() {
1244
+ /// # #[cfg(feature = "nightly")]
1245
+ /// # test()
1246
+ /// # }
1247
+ /// ```
1248
+ pub enum Entry<'a, T, A = Global>
1249
+ where
1250
+ A: Allocator,
1251
+ {
1252
+ /// An occupied entry.
1253
+ ///
1254
+ /// # Examples
1255
+ ///
1256
+ /// ```
1257
+ /// # #[cfg(feature = "nightly")]
1258
+ /// # fn test() {
1259
+ /// use hashbrown::hash_table::{Entry, OccupiedEntry};
1260
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
1261
+ /// use std::hash::BuildHasher;
1262
+ ///
1263
+ /// let mut table = HashTable::new();
1264
+ /// let hasher = DefaultHashBuilder::default();
1265
+ /// let hasher = |val: &_| hasher.hash_one(val);
1266
+ /// for x in ["a", "b"] {
1267
+ /// table.insert_unique(hasher(&x), x, hasher);
1268
+ /// }
1269
+ ///
1270
+ /// match table.entry(hasher(&"a"), |&x| x == "a", hasher) {
1271
+ /// Entry::Vacant(_) => unreachable!(),
1272
+ /// Entry::Occupied(_) => {}
1273
+ /// }
1274
+ /// # }
1275
+ /// # fn main() {
1276
+ /// # #[cfg(feature = "nightly")]
1277
+ /// # test()
1278
+ /// # }
1279
+ /// ```
1280
+ Occupied(OccupiedEntry<'a, T, A>),
1281
+
1282
+ /// A vacant entry.
1283
+ ///
1284
+ /// # Examples
1285
+ ///
1286
+ /// ```
1287
+ /// # #[cfg(feature = "nightly")]
1288
+ /// # fn test() {
1289
+ /// use hashbrown::hash_table::{Entry, OccupiedEntry};
1290
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
1291
+ /// use std::hash::BuildHasher;
1292
+ ///
1293
+ /// let mut table = HashTable::<&str>::new();
1294
+ /// let hasher = DefaultHashBuilder::default();
1295
+ /// let hasher = |val: &_| hasher.hash_one(val);
1296
+ ///
1297
+ /// match table.entry(hasher(&"a"), |&x| x == "a", hasher) {
1298
+ /// Entry::Vacant(_) => {}
1299
+ /// Entry::Occupied(_) => unreachable!(),
1300
+ /// }
1301
+ /// # }
1302
+ /// # fn main() {
1303
+ /// # #[cfg(feature = "nightly")]
1304
+ /// # test()
1305
+ /// # }
1306
+ /// ```
1307
+ Vacant(VacantEntry<'a, T, A>),
1308
+ }
1309
+
1310
+ impl<T: fmt::Debug, A: Allocator> fmt::Debug for Entry<'_, T, A> {
1311
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1312
+ match *self {
1313
+ Entry::Vacant(ref v) => f.debug_tuple("Entry").field(v).finish(),
1314
+ Entry::Occupied(ref o) => f.debug_tuple("Entry").field(o).finish(),
1315
+ }
1316
+ }
1317
+ }
1318
+
1319
+ impl<'a, T, A> Entry<'a, T, A>
1320
+ where
1321
+ A: Allocator,
1322
+ {
1323
+ /// Sets the value of the entry, replacing any existing value if there is
1324
+ /// one, and returns an [`OccupiedEntry`].
1325
+ ///
1326
+ /// # Examples
1327
+ ///
1328
+ /// ```
1329
+ /// # #[cfg(feature = "nightly")]
1330
+ /// # fn test() {
1331
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
1332
+ /// use std::hash::BuildHasher;
1333
+ ///
1334
+ /// let mut table: HashTable<&str> = HashTable::new();
1335
+ /// let hasher = DefaultHashBuilder::default();
1336
+ /// let hasher = |val: &_| hasher.hash_one(val);
1337
+ ///
1338
+ /// let entry = table
1339
+ /// .entry(hasher(&"horseyland"), |&x| x == "horseyland", hasher)
1340
+ /// .insert("horseyland");
1341
+ ///
1342
+ /// assert_eq!(entry.get(), &"horseyland");
1343
+ /// # }
1344
+ /// # fn main() {
1345
+ /// # #[cfg(feature = "nightly")]
1346
+ /// # test()
1347
+ /// # }
1348
+ /// ```
1349
+ pub fn insert(self, value: T) -> OccupiedEntry<'a, T, A> {
1350
+ match self {
1351
+ Entry::Occupied(mut entry) => {
1352
+ *entry.get_mut() = value;
1353
+ entry
1354
+ }
1355
+ Entry::Vacant(entry) => entry.insert(value),
1356
+ }
1357
+ }
1358
+
1359
+ /// Ensures a value is in the entry by inserting if it was vacant.
1360
+ ///
1361
+ /// Returns an [`OccupiedEntry`] pointing to the now-occupied entry.
1362
+ ///
1363
+ /// # Examples
1364
+ ///
1365
+ /// ```
1366
+ /// # #[cfg(feature = "nightly")]
1367
+ /// # fn test() {
1368
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
1369
+ /// use std::hash::BuildHasher;
1370
+ ///
1371
+ /// let mut table: HashTable<&str> = HashTable::new();
1372
+ /// let hasher = DefaultHashBuilder::default();
1373
+ /// let hasher = |val: &_| hasher.hash_one(val);
1374
+ ///
1375
+ /// // nonexistent key
1376
+ /// table
1377
+ /// .entry(hasher(&"poneyland"), |&x| x == "poneyland", hasher)
1378
+ /// .or_insert("poneyland");
1379
+ /// assert!(table
1380
+ /// .find(hasher(&"poneyland"), |&x| x == "poneyland")
1381
+ /// .is_some());
1382
+ ///
1383
+ /// // existing key
1384
+ /// table
1385
+ /// .entry(hasher(&"poneyland"), |&x| x == "poneyland", hasher)
1386
+ /// .or_insert("poneyland");
1387
+ /// assert!(table
1388
+ /// .find(hasher(&"poneyland"), |&x| x == "poneyland")
1389
+ /// .is_some());
1390
+ /// assert_eq!(table.len(), 1);
1391
+ /// # }
1392
+ /// # fn main() {
1393
+ /// # #[cfg(feature = "nightly")]
1394
+ /// # test()
1395
+ /// # }
1396
+ /// ```
1397
+ pub fn or_insert(self, default: T) -> OccupiedEntry<'a, T, A> {
1398
+ match self {
1399
+ Entry::Occupied(entry) => entry,
1400
+ Entry::Vacant(entry) => entry.insert(default),
1401
+ }
1402
+ }
1403
+
1404
+ /// Ensures a value is in the entry by inserting the result of the default function if empty..
1405
+ ///
1406
+ /// Returns an [`OccupiedEntry`] pointing to the now-occupied entry.
1407
+ ///
1408
+ /// # Examples
1409
+ ///
1410
+ /// ```
1411
+ /// # #[cfg(feature = "nightly")]
1412
+ /// # fn test() {
1413
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
1414
+ /// use std::hash::BuildHasher;
1415
+ ///
1416
+ /// let mut table: HashTable<String> = HashTable::new();
1417
+ /// let hasher = DefaultHashBuilder::default();
1418
+ /// let hasher = |val: &_| hasher.hash_one(val);
1419
+ ///
1420
+ /// table
1421
+ /// .entry(hasher("poneyland"), |x| x == "poneyland", |val| hasher(val))
1422
+ /// .or_insert_with(|| "poneyland".to_string());
1423
+ ///
1424
+ /// assert!(table
1425
+ /// .find(hasher(&"poneyland"), |x| x == "poneyland")
1426
+ /// .is_some());
1427
+ /// # }
1428
+ /// # fn main() {
1429
+ /// # #[cfg(feature = "nightly")]
1430
+ /// # test()
1431
+ /// # }
1432
+ /// ```
1433
+ pub fn or_insert_with(self, default: impl FnOnce() -> T) -> OccupiedEntry<'a, T, A> {
1434
+ match self {
1435
+ Entry::Occupied(entry) => entry,
1436
+ Entry::Vacant(entry) => entry.insert(default()),
1437
+ }
1438
+ }
1439
+
1440
+ /// Provides in-place mutable access to an occupied entry before any
1441
+ /// potential inserts into the table.
1442
+ ///
1443
+ /// # Examples
1444
+ ///
1445
+ /// ```
1446
+ /// # #[cfg(feature = "nightly")]
1447
+ /// # fn test() {
1448
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
1449
+ /// use std::hash::BuildHasher;
1450
+ ///
1451
+ /// let mut table: HashTable<(&str, u32)> = HashTable::new();
1452
+ /// let hasher = DefaultHashBuilder::default();
1453
+ /// let hasher = |val: &_| hasher.hash_one(val);
1454
+ ///
1455
+ /// table
1456
+ /// .entry(
1457
+ /// hasher(&"poneyland"),
1458
+ /// |&(x, _)| x == "poneyland",
1459
+ /// |(k, _)| hasher(&k),
1460
+ /// )
1461
+ /// .and_modify(|(_, v)| *v += 1)
1462
+ /// .or_insert(("poneyland", 42));
1463
+ /// assert_eq!(
1464
+ /// table.find(hasher(&"poneyland"), |&(k, _)| k == "poneyland"),
1465
+ /// Some(&("poneyland", 42))
1466
+ /// );
1467
+ ///
1468
+ /// table
1469
+ /// .entry(
1470
+ /// hasher(&"poneyland"),
1471
+ /// |&(x, _)| x == "poneyland",
1472
+ /// |(k, _)| hasher(&k),
1473
+ /// )
1474
+ /// .and_modify(|(_, v)| *v += 1)
1475
+ /// .or_insert(("poneyland", 42));
1476
+ /// assert_eq!(
1477
+ /// table.find(hasher(&"poneyland"), |&(k, _)| k == "poneyland"),
1478
+ /// Some(&("poneyland", 43))
1479
+ /// );
1480
+ /// # }
1481
+ /// # fn main() {
1482
+ /// # #[cfg(feature = "nightly")]
1483
+ /// # test()
1484
+ /// # }
1485
+ /// ```
1486
+ pub fn and_modify(self, f: impl FnOnce(&mut T)) -> Self {
1487
+ match self {
1488
+ Entry::Occupied(mut entry) => {
1489
+ f(entry.get_mut());
1490
+ Entry::Occupied(entry)
1491
+ }
1492
+ Entry::Vacant(entry) => Entry::Vacant(entry),
1493
+ }
1494
+ }
1495
+ }
1496
+
1497
+ /// A view into an occupied entry in a `HashTable`.
1498
+ /// It is part of the [`Entry`] enum.
1499
+ ///
1500
+ /// [`Entry`]: enum.Entry.html
1501
+ ///
1502
+ /// # Examples
1503
+ ///
1504
+ /// ```
1505
+ /// # #[cfg(feature = "nightly")]
1506
+ /// # fn test() {
1507
+ /// use hashbrown::hash_table::{Entry, OccupiedEntry};
1508
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
1509
+ /// use std::hash::BuildHasher;
1510
+ ///
1511
+ /// let mut table = HashTable::new();
1512
+ /// let hasher = DefaultHashBuilder::default();
1513
+ /// let hasher = |val: &_| hasher.hash_one(val);
1514
+ /// for x in ["a", "b", "c"] {
1515
+ /// table.insert_unique(hasher(&x), x, hasher);
1516
+ /// }
1517
+ /// assert_eq!(table.len(), 3);
1518
+ ///
1519
+ /// let _entry_o: OccupiedEntry<_, _> = table.find_entry(hasher(&"a"), |&x| x == "a").unwrap();
1520
+ /// assert_eq!(table.len(), 3);
1521
+ ///
1522
+ /// // Existing key
1523
+ /// match table.entry(hasher(&"a"), |&x| x == "a", hasher) {
1524
+ /// Entry::Vacant(_) => unreachable!(),
1525
+ /// Entry::Occupied(view) => {
1526
+ /// assert_eq!(view.get(), &"a");
1527
+ /// }
1528
+ /// }
1529
+ ///
1530
+ /// assert_eq!(table.len(), 3);
1531
+ ///
1532
+ /// // Existing key (take)
1533
+ /// match table.entry(hasher(&"c"), |&x| x == "c", hasher) {
1534
+ /// Entry::Vacant(_) => unreachable!(),
1535
+ /// Entry::Occupied(view) => {
1536
+ /// assert_eq!(view.remove().0, "c");
1537
+ /// }
1538
+ /// }
1539
+ /// assert_eq!(table.find(hasher(&"c"), |&x| x == "c"), None);
1540
+ /// assert_eq!(table.len(), 2);
1541
+ /// # }
1542
+ /// # fn main() {
1543
+ /// # #[cfg(feature = "nightly")]
1544
+ /// # test()
1545
+ /// # }
1546
+ /// ```
1547
+ pub struct OccupiedEntry<'a, T, A = Global>
1548
+ where
1549
+ A: Allocator,
1550
+ {
1551
+ hash: u64,
1552
+ bucket: Bucket<T>,
1553
+ table: &'a mut HashTable<T, A>,
1554
+ }
1555
+
1556
+ unsafe impl<T, A> Send for OccupiedEntry<'_, T, A>
1557
+ where
1558
+ T: Send,
1559
+ A: Send + Allocator,
1560
+ {
1561
+ }
1562
+ unsafe impl<T, A> Sync for OccupiedEntry<'_, T, A>
1563
+ where
1564
+ T: Sync,
1565
+ A: Sync + Allocator,
1566
+ {
1567
+ }
1568
+
1569
+ impl<T: fmt::Debug, A: Allocator> fmt::Debug for OccupiedEntry<'_, T, A> {
1570
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1571
+ f.debug_struct("OccupiedEntry")
1572
+ .field("value", self.get())
1573
+ .finish()
1574
+ }
1575
+ }
1576
+
1577
+ impl<'a, T, A> OccupiedEntry<'a, T, A>
1578
+ where
1579
+ A: Allocator,
1580
+ {
1581
+ /// Takes the value out of the entry, and returns it along with a
1582
+ /// `VacantEntry` that can be used to insert another value with the same
1583
+ /// hash as the one that was just removed.
1584
+ ///
1585
+ /// # Examples
1586
+ ///
1587
+ /// ```
1588
+ /// # #[cfg(feature = "nightly")]
1589
+ /// # fn test() {
1590
+ /// use hashbrown::hash_table::Entry;
1591
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
1592
+ /// use std::hash::BuildHasher;
1593
+ ///
1594
+ /// let mut table: HashTable<&str> = HashTable::new();
1595
+ /// let hasher = DefaultHashBuilder::default();
1596
+ /// let hasher = |val: &_| hasher.hash_one(val);
1597
+ /// // The table is empty
1598
+ /// assert!(table.is_empty() && table.capacity() == 0);
1599
+ ///
1600
+ /// table.insert_unique(hasher(&"poneyland"), "poneyland", hasher);
1601
+ /// let capacity_before_remove = table.capacity();
1602
+ ///
1603
+ /// if let Entry::Occupied(o) = table.entry(hasher(&"poneyland"), |&x| x == "poneyland", hasher) {
1604
+ /// assert_eq!(o.remove().0, "poneyland");
1605
+ /// }
1606
+ ///
1607
+ /// assert!(table
1608
+ /// .find(hasher(&"poneyland"), |&x| x == "poneyland")
1609
+ /// .is_none());
1610
+ /// // Now table hold none elements but capacity is equal to the old one
1611
+ /// assert!(table.len() == 0 && table.capacity() == capacity_before_remove);
1612
+ /// # }
1613
+ /// # fn main() {
1614
+ /// # #[cfg(feature = "nightly")]
1615
+ /// # test()
1616
+ /// # }
1617
+ /// ```
1618
+ #[cfg_attr(feature = "inline-more", inline)]
1619
+ pub fn remove(self) -> (T, VacantEntry<'a, T, A>) {
1620
+ let (val, slot) = unsafe { self.table.raw.remove(self.bucket) };
1621
+ (
1622
+ val,
1623
+ VacantEntry {
1624
+ hash: self.hash,
1625
+ insert_slot: slot,
1626
+ table: self.table,
1627
+ },
1628
+ )
1629
+ }
1630
+
1631
+ /// Gets a reference to the value in the entry.
1632
+ ///
1633
+ /// # Examples
1634
+ ///
1635
+ /// ```
1636
+ /// # #[cfg(feature = "nightly")]
1637
+ /// # fn test() {
1638
+ /// use hashbrown::hash_table::Entry;
1639
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
1640
+ /// use std::hash::BuildHasher;
1641
+ ///
1642
+ /// let mut table: HashTable<&str> = HashTable::new();
1643
+ /// let hasher = DefaultHashBuilder::default();
1644
+ /// let hasher = |val: &_| hasher.hash_one(val);
1645
+ /// table.insert_unique(hasher(&"poneyland"), "poneyland", hasher);
1646
+ ///
1647
+ /// match table.entry(hasher(&"poneyland"), |&x| x == "poneyland", hasher) {
1648
+ /// Entry::Vacant(_) => panic!(),
1649
+ /// Entry::Occupied(entry) => assert_eq!(entry.get(), &"poneyland"),
1650
+ /// }
1651
+ /// # }
1652
+ /// # fn main() {
1653
+ /// # #[cfg(feature = "nightly")]
1654
+ /// # test()
1655
+ /// # }
1656
+ /// ```
1657
+ #[inline]
1658
+ pub fn get(&self) -> &T {
1659
+ unsafe { self.bucket.as_ref() }
1660
+ }
1661
+
1662
+ /// Gets a mutable reference to the value in the entry.
1663
+ ///
1664
+ /// If you need a reference to the `OccupiedEntry` which may outlive the
1665
+ /// destruction of the `Entry` value, see [`into_mut`].
1666
+ ///
1667
+ /// [`into_mut`]: #method.into_mut
1668
+ ///
1669
+ /// # Examples
1670
+ ///
1671
+ /// ```
1672
+ /// # #[cfg(feature = "nightly")]
1673
+ /// # fn test() {
1674
+ /// use hashbrown::hash_table::Entry;
1675
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
1676
+ /// use std::hash::BuildHasher;
1677
+ ///
1678
+ /// let mut table: HashTable<(&str, u32)> = HashTable::new();
1679
+ /// let hasher = DefaultHashBuilder::default();
1680
+ /// let hasher = |val: &_| hasher.hash_one(val);
1681
+ /// table.insert_unique(hasher(&"poneyland"), ("poneyland", 12), |(k, _)| hasher(&k));
1682
+ ///
1683
+ /// assert_eq!(
1684
+ /// table.find(hasher(&"poneyland"), |&(x, _)| x == "poneyland",),
1685
+ /// Some(&("poneyland", 12))
1686
+ /// );
1687
+ ///
1688
+ /// if let Entry::Occupied(mut o) = table.entry(
1689
+ /// hasher(&"poneyland"),
1690
+ /// |&(x, _)| x == "poneyland",
1691
+ /// |(k, _)| hasher(&k),
1692
+ /// ) {
1693
+ /// o.get_mut().1 += 10;
1694
+ /// assert_eq!(o.get().1, 22);
1695
+ ///
1696
+ /// // We can use the same Entry multiple times.
1697
+ /// o.get_mut().1 += 2;
1698
+ /// }
1699
+ ///
1700
+ /// assert_eq!(
1701
+ /// table.find(hasher(&"poneyland"), |&(x, _)| x == "poneyland",),
1702
+ /// Some(&("poneyland", 24))
1703
+ /// );
1704
+ /// # }
1705
+ /// # fn main() {
1706
+ /// # #[cfg(feature = "nightly")]
1707
+ /// # test()
1708
+ /// # }
1709
+ /// ```
1710
+ #[inline]
1711
+ pub fn get_mut(&mut self) -> &mut T {
1712
+ unsafe { self.bucket.as_mut() }
1713
+ }
1714
+
1715
+ /// Converts the `OccupiedEntry` into a mutable reference to the value in the entry
1716
+ /// with a lifetime bound to the table itself.
1717
+ ///
1718
+ /// If you need multiple references to the `OccupiedEntry`, see [`get_mut`].
1719
+ ///
1720
+ /// [`get_mut`]: #method.get_mut
1721
+ ///
1722
+ /// # Examples
1723
+ ///
1724
+ /// ```
1725
+ /// # #[cfg(feature = "nightly")]
1726
+ /// # fn test() {
1727
+ /// use hashbrown::hash_table::Entry;
1728
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
1729
+ /// use std::hash::BuildHasher;
1730
+ ///
1731
+ /// let mut table: HashTable<(&str, u32)> = HashTable::new();
1732
+ /// let hasher = DefaultHashBuilder::default();
1733
+ /// let hasher = |val: &_| hasher.hash_one(val);
1734
+ /// table.insert_unique(hasher(&"poneyland"), ("poneyland", 12), |(k, _)| hasher(&k));
1735
+ ///
1736
+ /// assert_eq!(
1737
+ /// table.find(hasher(&"poneyland"), |&(x, _)| x == "poneyland",),
1738
+ /// Some(&("poneyland", 12))
1739
+ /// );
1740
+ ///
1741
+ /// let value: &mut (&str, u32);
1742
+ /// match table.entry(
1743
+ /// hasher(&"poneyland"),
1744
+ /// |&(x, _)| x == "poneyland",
1745
+ /// |(k, _)| hasher(&k),
1746
+ /// ) {
1747
+ /// Entry::Occupied(entry) => value = entry.into_mut(),
1748
+ /// Entry::Vacant(_) => panic!(),
1749
+ /// }
1750
+ /// value.1 += 10;
1751
+ ///
1752
+ /// assert_eq!(
1753
+ /// table.find(hasher(&"poneyland"), |&(x, _)| x == "poneyland",),
1754
+ /// Some(&("poneyland", 22))
1755
+ /// );
1756
+ /// # }
1757
+ /// # fn main() {
1758
+ /// # #[cfg(feature = "nightly")]
1759
+ /// # test()
1760
+ /// # }
1761
+ /// ```
1762
+ pub fn into_mut(self) -> &'a mut T {
1763
+ unsafe { self.bucket.as_mut() }
1764
+ }
1765
+
1766
+ /// Converts the `OccupiedEntry` into a mutable reference to the underlying
1767
+ /// table.
1768
+ pub fn into_table(self) -> &'a mut HashTable<T, A> {
1769
+ self.table
1770
+ }
1771
+ }
1772
+
1773
+ /// A view into a vacant entry in a `HashTable`.
1774
+ /// It is part of the [`Entry`] enum.
1775
+ ///
1776
+ /// [`Entry`]: enum.Entry.html
1777
+ ///
1778
+ /// # Examples
1779
+ ///
1780
+ /// ```
1781
+ /// # #[cfg(feature = "nightly")]
1782
+ /// # fn test() {
1783
+ /// use hashbrown::hash_table::{Entry, VacantEntry};
1784
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
1785
+ /// use std::hash::BuildHasher;
1786
+ ///
1787
+ /// let mut table: HashTable<&str> = HashTable::new();
1788
+ /// let hasher = DefaultHashBuilder::default();
1789
+ /// let hasher = |val: &_| hasher.hash_one(val);
1790
+ ///
1791
+ /// let entry_v: VacantEntry<_, _> = match table.entry(hasher(&"a"), |&x| x == "a", hasher) {
1792
+ /// Entry::Vacant(view) => view,
1793
+ /// Entry::Occupied(_) => unreachable!(),
1794
+ /// };
1795
+ /// entry_v.insert("a");
1796
+ /// assert!(table.find(hasher(&"a"), |&x| x == "a").is_some() && table.len() == 1);
1797
+ ///
1798
+ /// // Nonexistent key (insert)
1799
+ /// match table.entry(hasher(&"b"), |&x| x == "b", hasher) {
1800
+ /// Entry::Vacant(view) => {
1801
+ /// view.insert("b");
1802
+ /// }
1803
+ /// Entry::Occupied(_) => unreachable!(),
1804
+ /// }
1805
+ /// assert!(table.find(hasher(&"b"), |&x| x == "b").is_some() && table.len() == 2);
1806
+ /// # }
1807
+ /// # fn main() {
1808
+ /// # #[cfg(feature = "nightly")]
1809
+ /// # test()
1810
+ /// # }
1811
+ /// ```
1812
+ pub struct VacantEntry<'a, T, A = Global>
1813
+ where
1814
+ A: Allocator,
1815
+ {
1816
+ hash: u64,
1817
+ insert_slot: InsertSlot,
1818
+ table: &'a mut HashTable<T, A>,
1819
+ }
1820
+
1821
+ impl<T: fmt::Debug, A: Allocator> fmt::Debug for VacantEntry<'_, T, A> {
1822
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1823
+ f.write_str("VacantEntry")
1824
+ }
1825
+ }
1826
+
1827
+ impl<'a, T, A> VacantEntry<'a, T, A>
1828
+ where
1829
+ A: Allocator,
1830
+ {
1831
+ /// Inserts a new element into the table with the hash that was used to
1832
+ /// obtain the `VacantEntry`.
1833
+ ///
1834
+ /// An `OccupiedEntry` is returned for the newly inserted element.
1835
+ ///
1836
+ /// # Examples
1837
+ ///
1838
+ /// ```
1839
+ /// # #[cfg(feature = "nightly")]
1840
+ /// # fn test() {
1841
+ /// use hashbrown::hash_table::Entry;
1842
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
1843
+ /// use std::hash::BuildHasher;
1844
+ ///
1845
+ /// let mut table: HashTable<&str> = HashTable::new();
1846
+ /// let hasher = DefaultHashBuilder::default();
1847
+ /// let hasher = |val: &_| hasher.hash_one(val);
1848
+ ///
1849
+ /// if let Entry::Vacant(o) = table.entry(hasher(&"poneyland"), |&x| x == "poneyland", hasher) {
1850
+ /// o.insert("poneyland");
1851
+ /// }
1852
+ /// assert_eq!(
1853
+ /// table.find(hasher(&"poneyland"), |&x| x == "poneyland"),
1854
+ /// Some(&"poneyland")
1855
+ /// );
1856
+ /// # }
1857
+ /// # fn main() {
1858
+ /// # #[cfg(feature = "nightly")]
1859
+ /// # test()
1860
+ /// # }
1861
+ /// ```
1862
+ #[inline]
1863
+ pub fn insert(self, value: T) -> OccupiedEntry<'a, T, A> {
1864
+ let bucket = unsafe {
1865
+ self.table
1866
+ .raw
1867
+ .insert_in_slot(self.hash, self.insert_slot, value)
1868
+ };
1869
+ OccupiedEntry {
1870
+ hash: self.hash,
1871
+ bucket,
1872
+ table: self.table,
1873
+ }
1874
+ }
1875
+
1876
+ /// Converts the `VacantEntry` into a mutable reference to the underlying
1877
+ /// table.
1878
+ pub fn into_table(self) -> &'a mut HashTable<T, A> {
1879
+ self.table
1880
+ }
1881
+ }
1882
+
1883
+ /// Type representing the absence of an entry, as returned by [`HashTable::find_entry`].
1884
+ ///
1885
+ /// This type only exists due to [limitations] in Rust's NLL borrow checker. In
1886
+ /// the future, `find_entry` will return an `Option<OccupiedEntry>` and this
1887
+ /// type will be removed.
1888
+ ///
1889
+ /// [limitations]: https://smallcultfollowing.com/babysteps/blog/2018/06/15/mir-based-borrow-check-nll-status-update/#polonius
1890
+ ///
1891
+ /// # Examples
1892
+ ///
1893
+ /// ```
1894
+ /// # #[cfg(feature = "nightly")]
1895
+ /// # fn test() {
1896
+ /// use hashbrown::hash_table::{AbsentEntry, Entry};
1897
+ /// use hashbrown::{HashTable, DefaultHashBuilder};
1898
+ /// use std::hash::BuildHasher;
1899
+ ///
1900
+ /// let mut table: HashTable<&str> = HashTable::new();
1901
+ /// let hasher = DefaultHashBuilder::default();
1902
+ /// let hasher = |val: &_| hasher.hash_one(val);
1903
+ ///
1904
+ /// let entry_v: AbsentEntry<_, _> = table.find_entry(hasher(&"a"), |&x| x == "a").unwrap_err();
1905
+ /// entry_v
1906
+ /// .into_table()
1907
+ /// .insert_unique(hasher(&"a"), "a", hasher);
1908
+ /// assert!(table.find(hasher(&"a"), |&x| x == "a").is_some() && table.len() == 1);
1909
+ ///
1910
+ /// // Nonexistent key (insert)
1911
+ /// match table.entry(hasher(&"b"), |&x| x == "b", hasher) {
1912
+ /// Entry::Vacant(view) => {
1913
+ /// view.insert("b");
1914
+ /// }
1915
+ /// Entry::Occupied(_) => unreachable!(),
1916
+ /// }
1917
+ /// assert!(table.find(hasher(&"b"), |&x| x == "b").is_some() && table.len() == 2);
1918
+ /// # }
1919
+ /// # fn main() {
1920
+ /// # #[cfg(feature = "nightly")]
1921
+ /// # test()
1922
+ /// # }
1923
+ /// ```
1924
+ pub struct AbsentEntry<'a, T, A = Global>
1925
+ where
1926
+ A: Allocator,
1927
+ {
1928
+ table: &'a mut HashTable<T, A>,
1929
+ }
1930
+
1931
+ impl<T: fmt::Debug, A: Allocator> fmt::Debug for AbsentEntry<'_, T, A> {
1932
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1933
+ f.write_str("AbsentEntry")
1934
+ }
1935
+ }
1936
+
1937
+ impl<'a, T, A> AbsentEntry<'a, T, A>
1938
+ where
1939
+ A: Allocator,
1940
+ {
1941
+ /// Converts the `AbsentEntry` into a mutable reference to the underlying
1942
+ /// table.
1943
+ pub fn into_table(self) -> &'a mut HashTable<T, A> {
1944
+ self.table
1945
+ }
1946
+ }
1947
+
1948
+ /// An iterator over the entries of a `HashTable` in arbitrary order.
1949
+ /// The iterator element type is `&'a T`.
1950
+ ///
1951
+ /// This `struct` is created by the [`iter`] method on [`HashTable`]. See its
1952
+ /// documentation for more.
1953
+ ///
1954
+ /// [`iter`]: struct.HashTable.html#method.iter
1955
+ /// [`HashTable`]: struct.HashTable.html
1956
+ pub struct Iter<'a, T> {
1957
+ inner: RawIter<T>,
1958
+ marker: PhantomData<&'a T>,
1959
+ }
1960
+
1961
+ impl<T> Default for Iter<'_, T> {
1962
+ #[cfg_attr(feature = "inline-more", inline)]
1963
+ fn default() -> Self {
1964
+ Iter {
1965
+ inner: Default::default(),
1966
+ marker: PhantomData,
1967
+ }
1968
+ }
1969
+ }
1970
+
1971
+ impl<'a, T> Iterator for Iter<'a, T> {
1972
+ type Item = &'a T;
1973
+
1974
+ fn next(&mut self) -> Option<Self::Item> {
1975
+ // Avoid `Option::map` because it bloats LLVM IR.
1976
+ match self.inner.next() {
1977
+ Some(bucket) => Some(unsafe { bucket.as_ref() }),
1978
+ None => None,
1979
+ }
1980
+ }
1981
+
1982
+ fn size_hint(&self) -> (usize, Option<usize>) {
1983
+ self.inner.size_hint()
1984
+ }
1985
+
1986
+ fn fold<B, F>(self, init: B, mut f: F) -> B
1987
+ where
1988
+ Self: Sized,
1989
+ F: FnMut(B, Self::Item) -> B,
1990
+ {
1991
+ self.inner
1992
+ .fold(init, |acc, bucket| unsafe { f(acc, bucket.as_ref()) })
1993
+ }
1994
+ }
1995
+
1996
+ impl<T> ExactSizeIterator for Iter<'_, T> {
1997
+ fn len(&self) -> usize {
1998
+ self.inner.len()
1999
+ }
2000
+ }
2001
+
2002
+ impl<T> FusedIterator for Iter<'_, T> {}
2003
+
2004
+ // FIXME(#26925) Remove in favor of `#[derive(Clone)]`
2005
+ impl<'a, T> Clone for Iter<'a, T> {
2006
+ #[cfg_attr(feature = "inline-more", inline)]
2007
+ fn clone(&self) -> Iter<'a, T> {
2008
+ Iter {
2009
+ inner: self.inner.clone(),
2010
+ marker: PhantomData,
2011
+ }
2012
+ }
2013
+ }
2014
+
2015
+ impl<T: fmt::Debug> fmt::Debug for Iter<'_, T> {
2016
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2017
+ f.debug_list().entries(self.clone()).finish()
2018
+ }
2019
+ }
2020
+
2021
+ /// A mutable iterator over the entries of a `HashTable` in arbitrary order.
2022
+ /// The iterator element type is `&'a mut T`.
2023
+ ///
2024
+ /// This `struct` is created by the [`iter_mut`] method on [`HashTable`]. See its
2025
+ /// documentation for more.
2026
+ ///
2027
+ /// [`iter_mut`]: struct.HashTable.html#method.iter_mut
2028
+ /// [`HashTable`]: struct.HashTable.html
2029
+ pub struct IterMut<'a, T> {
2030
+ inner: RawIter<T>,
2031
+ marker: PhantomData<&'a mut T>,
2032
+ }
2033
+
2034
+ impl<T> Default for IterMut<'_, T> {
2035
+ #[cfg_attr(feature = "inline-more", inline)]
2036
+ fn default() -> Self {
2037
+ IterMut {
2038
+ inner: Default::default(),
2039
+ marker: PhantomData,
2040
+ }
2041
+ }
2042
+ }
2043
+ impl<'a, T> Iterator for IterMut<'a, T> {
2044
+ type Item = &'a mut T;
2045
+
2046
+ fn next(&mut self) -> Option<Self::Item> {
2047
+ // Avoid `Option::map` because it bloats LLVM IR.
2048
+ match self.inner.next() {
2049
+ Some(bucket) => Some(unsafe { bucket.as_mut() }),
2050
+ None => None,
2051
+ }
2052
+ }
2053
+
2054
+ fn size_hint(&self) -> (usize, Option<usize>) {
2055
+ self.inner.size_hint()
2056
+ }
2057
+
2058
+ fn fold<B, F>(self, init: B, mut f: F) -> B
2059
+ where
2060
+ Self: Sized,
2061
+ F: FnMut(B, Self::Item) -> B,
2062
+ {
2063
+ self.inner
2064
+ .fold(init, |acc, bucket| unsafe { f(acc, bucket.as_mut()) })
2065
+ }
2066
+ }
2067
+
2068
+ impl<T> ExactSizeIterator for IterMut<'_, T> {
2069
+ fn len(&self) -> usize {
2070
+ self.inner.len()
2071
+ }
2072
+ }
2073
+
2074
+ impl<T> FusedIterator for IterMut<'_, T> {}
2075
+
2076
+ impl<T> fmt::Debug for IterMut<'_, T>
2077
+ where
2078
+ T: fmt::Debug,
2079
+ {
2080
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2081
+ f.debug_list()
2082
+ .entries(Iter {
2083
+ inner: self.inner.clone(),
2084
+ marker: PhantomData,
2085
+ })
2086
+ .finish()
2087
+ }
2088
+ }
2089
+
2090
+ /// An iterator over the entries of a `HashTable` that could match a given hash.
2091
+ /// The iterator element type is `&'a T`.
2092
+ ///
2093
+ /// This `struct` is created by the [`iter_hash`] method on [`HashTable`]. See its
2094
+ /// documentation for more.
2095
+ ///
2096
+ /// [`iter_hash`]: struct.HashTable.html#method.iter_hash
2097
+ /// [`HashTable`]: struct.HashTable.html
2098
+ pub struct IterHash<'a, T> {
2099
+ inner: RawIterHash<T>,
2100
+ marker: PhantomData<&'a T>,
2101
+ }
2102
+
2103
+ impl<T> Default for IterHash<'_, T> {
2104
+ #[cfg_attr(feature = "inline-more", inline)]
2105
+ fn default() -> Self {
2106
+ IterHash {
2107
+ inner: Default::default(),
2108
+ marker: PhantomData,
2109
+ }
2110
+ }
2111
+ }
2112
+
2113
+ impl<'a, T> Iterator for IterHash<'a, T> {
2114
+ type Item = &'a T;
2115
+
2116
+ fn next(&mut self) -> Option<Self::Item> {
2117
+ // Avoid `Option::map` because it bloats LLVM IR.
2118
+ match self.inner.next() {
2119
+ Some(bucket) => Some(unsafe { bucket.as_ref() }),
2120
+ None => None,
2121
+ }
2122
+ }
2123
+
2124
+ fn fold<B, F>(self, init: B, mut f: F) -> B
2125
+ where
2126
+ Self: Sized,
2127
+ F: FnMut(B, Self::Item) -> B,
2128
+ {
2129
+ self.inner
2130
+ .fold(init, |acc, bucket| unsafe { f(acc, bucket.as_ref()) })
2131
+ }
2132
+ }
2133
+
2134
+ impl<T> FusedIterator for IterHash<'_, T> {}
2135
+
2136
+ // FIXME(#26925) Remove in favor of `#[derive(Clone)]`
2137
+ impl<'a, T> Clone for IterHash<'a, T> {
2138
+ #[cfg_attr(feature = "inline-more", inline)]
2139
+ fn clone(&self) -> IterHash<'a, T> {
2140
+ IterHash {
2141
+ inner: self.inner.clone(),
2142
+ marker: PhantomData,
2143
+ }
2144
+ }
2145
+ }
2146
+
2147
+ impl<T> fmt::Debug for IterHash<'_, T>
2148
+ where
2149
+ T: fmt::Debug,
2150
+ {
2151
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2152
+ f.debug_list().entries(self.clone()).finish()
2153
+ }
2154
+ }
2155
+
2156
+ /// A mutable iterator over the entries of a `HashTable` that could match a given hash.
2157
+ /// The iterator element type is `&'a mut T`.
2158
+ ///
2159
+ /// This `struct` is created by the [`iter_hash_mut`] method on [`HashTable`]. See its
2160
+ /// documentation for more.
2161
+ ///
2162
+ /// [`iter_hash_mut`]: struct.HashTable.html#method.iter_hash_mut
2163
+ /// [`HashTable`]: struct.HashTable.html
2164
+ pub struct IterHashMut<'a, T> {
2165
+ inner: RawIterHash<T>,
2166
+ marker: PhantomData<&'a mut T>,
2167
+ }
2168
+
2169
+ impl<T> Default for IterHashMut<'_, T> {
2170
+ #[cfg_attr(feature = "inline-more", inline)]
2171
+ fn default() -> Self {
2172
+ IterHashMut {
2173
+ inner: Default::default(),
2174
+ marker: PhantomData,
2175
+ }
2176
+ }
2177
+ }
2178
+
2179
+ impl<'a, T> Iterator for IterHashMut<'a, T> {
2180
+ type Item = &'a mut T;
2181
+
2182
+ fn next(&mut self) -> Option<Self::Item> {
2183
+ // Avoid `Option::map` because it bloats LLVM IR.
2184
+ match self.inner.next() {
2185
+ Some(bucket) => Some(unsafe { bucket.as_mut() }),
2186
+ None => None,
2187
+ }
2188
+ }
2189
+
2190
+ fn fold<B, F>(self, init: B, mut f: F) -> B
2191
+ where
2192
+ Self: Sized,
2193
+ F: FnMut(B, Self::Item) -> B,
2194
+ {
2195
+ self.inner
2196
+ .fold(init, |acc, bucket| unsafe { f(acc, bucket.as_mut()) })
2197
+ }
2198
+ }
2199
+
2200
+ impl<T> FusedIterator for IterHashMut<'_, T> {}
2201
+
2202
+ impl<T> fmt::Debug for IterHashMut<'_, T>
2203
+ where
2204
+ T: fmt::Debug,
2205
+ {
2206
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2207
+ f.debug_list()
2208
+ .entries(IterHash {
2209
+ inner: self.inner.clone(),
2210
+ marker: PhantomData,
2211
+ })
2212
+ .finish()
2213
+ }
2214
+ }
2215
+
2216
+ /// An owning iterator over the entries of a `HashTable` in arbitrary order.
2217
+ /// The iterator element type is `T`.
2218
+ ///
2219
+ /// This `struct` is created by the [`into_iter`] method on [`HashTable`]
2220
+ /// (provided by the [`IntoIterator`] trait). See its documentation for more.
2221
+ /// The table cannot be used after calling that method.
2222
+ ///
2223
+ /// [`into_iter`]: struct.HashTable.html#method.into_iter
2224
+ /// [`HashTable`]: struct.HashTable.html
2225
+ /// [`IntoIterator`]: https://doc.rust-lang.org/core/iter/trait.IntoIterator.html
2226
+ pub struct IntoIter<T, A = Global>
2227
+ where
2228
+ A: Allocator,
2229
+ {
2230
+ inner: RawIntoIter<T, A>,
2231
+ }
2232
+
2233
+ impl<T, A: Allocator> Default for IntoIter<T, A> {
2234
+ #[cfg_attr(feature = "inline-more", inline)]
2235
+ fn default() -> Self {
2236
+ IntoIter {
2237
+ inner: Default::default(),
2238
+ }
2239
+ }
2240
+ }
2241
+
2242
+ impl<T, A> Iterator for IntoIter<T, A>
2243
+ where
2244
+ A: Allocator,
2245
+ {
2246
+ type Item = T;
2247
+
2248
+ fn next(&mut self) -> Option<Self::Item> {
2249
+ self.inner.next()
2250
+ }
2251
+
2252
+ fn size_hint(&self) -> (usize, Option<usize>) {
2253
+ self.inner.size_hint()
2254
+ }
2255
+
2256
+ fn fold<B, F>(self, init: B, f: F) -> B
2257
+ where
2258
+ Self: Sized,
2259
+ F: FnMut(B, Self::Item) -> B,
2260
+ {
2261
+ self.inner.fold(init, f)
2262
+ }
2263
+ }
2264
+
2265
+ impl<T, A> ExactSizeIterator for IntoIter<T, A>
2266
+ where
2267
+ A: Allocator,
2268
+ {
2269
+ fn len(&self) -> usize {
2270
+ self.inner.len()
2271
+ }
2272
+ }
2273
+
2274
+ impl<T, A> FusedIterator for IntoIter<T, A> where A: Allocator {}
2275
+
2276
+ impl<T, A> fmt::Debug for IntoIter<T, A>
2277
+ where
2278
+ T: fmt::Debug,
2279
+ A: Allocator,
2280
+ {
2281
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2282
+ f.debug_list()
2283
+ .entries(Iter {
2284
+ inner: self.inner.iter(),
2285
+ marker: PhantomData,
2286
+ })
2287
+ .finish()
2288
+ }
2289
+ }
2290
+
2291
+ /// A draining iterator over the items of a `HashTable`.
2292
+ ///
2293
+ /// This `struct` is created by the [`drain`] method on [`HashTable`].
2294
+ /// See its documentation for more.
2295
+ ///
2296
+ /// [`HashTable`]: struct.HashTable.html
2297
+ /// [`drain`]: struct.HashTable.html#method.drain
2298
+ pub struct Drain<'a, T, A: Allocator = Global> {
2299
+ inner: RawDrain<'a, T, A>,
2300
+ }
2301
+
2302
+ impl<T, A: Allocator> Iterator for Drain<'_, T, A> {
2303
+ type Item = T;
2304
+
2305
+ fn next(&mut self) -> Option<T> {
2306
+ self.inner.next()
2307
+ }
2308
+
2309
+ fn size_hint(&self) -> (usize, Option<usize>) {
2310
+ self.inner.size_hint()
2311
+ }
2312
+
2313
+ fn fold<B, F>(self, init: B, f: F) -> B
2314
+ where
2315
+ Self: Sized,
2316
+ F: FnMut(B, Self::Item) -> B,
2317
+ {
2318
+ self.inner.fold(init, f)
2319
+ }
2320
+ }
2321
+
2322
+ impl<T, A: Allocator> ExactSizeIterator for Drain<'_, T, A> {
2323
+ fn len(&self) -> usize {
2324
+ self.inner.len()
2325
+ }
2326
+ }
2327
+
2328
+ impl<T, A: Allocator> FusedIterator for Drain<'_, T, A> {}
2329
+
2330
+ impl<T: fmt::Debug, A: Allocator> fmt::Debug for Drain<'_, T, A> {
2331
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2332
+ f.debug_list()
2333
+ .entries(Iter {
2334
+ inner: self.inner.iter(),
2335
+ marker: PhantomData,
2336
+ })
2337
+ .finish()
2338
+ }
2339
+ }
2340
+
2341
+ /// A draining iterator over entries of a `HashTable` which don't satisfy the predicate `f`.
2342
+ ///
2343
+ /// This `struct` is created by [`HashTable::extract_if`]. See its
2344
+ /// documentation for more.
2345
+ #[must_use = "Iterators are lazy unless consumed"]
2346
+ pub struct ExtractIf<'a, T, F, A: Allocator = Global> {
2347
+ f: F,
2348
+ inner: RawExtractIf<'a, T, A>,
2349
+ }
2350
+
2351
+ impl<T, F, A: Allocator> Iterator for ExtractIf<'_, T, F, A>
2352
+ where
2353
+ F: FnMut(&mut T) -> bool,
2354
+ {
2355
+ type Item = T;
2356
+
2357
+ #[inline]
2358
+ fn next(&mut self) -> Option<Self::Item> {
2359
+ self.inner.next(|val| (self.f)(val))
2360
+ }
2361
+
2362
+ #[inline]
2363
+ fn size_hint(&self) -> (usize, Option<usize>) {
2364
+ (0, self.inner.iter.size_hint().1)
2365
+ }
2366
+ }
2367
+
2368
+ impl<T, F, A: Allocator> FusedIterator for ExtractIf<'_, T, F, A> where F: FnMut(&mut T) -> bool {}
2369
+
2370
+ #[cfg(test)]
2371
+ mod tests {
2372
+ use super::HashTable;
2373
+
2374
+ #[test]
2375
+ fn test_allocation_info() {
2376
+ assert_eq!(HashTable::<()>::new().allocation_size(), 0);
2377
+ assert_eq!(HashTable::<u32>::new().allocation_size(), 0);
2378
+ assert!(HashTable::<u32>::with_capacity(1).allocation_size() > core::mem::size_of::<u32>());
2379
+ }
2380
+ }