html-to-markdown 2.23.4 → 2.24.1

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 (585) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +7 -7
  3. data/README.md +9 -7
  4. data/ext/html-to-markdown-rb/native/Cargo.lock +21 -21
  5. data/ext/html-to-markdown-rb/native/Cargo.toml +1 -3
  6. data/lib/html_to_markdown/cli_proxy.rb +5 -2
  7. data/lib/html_to_markdown/version.rb +1 -1
  8. data/rust-vendor/cc/.cargo-checksum.json +1 -1
  9. data/rust-vendor/cc/.cargo_vcs_info.json +1 -1
  10. data/rust-vendor/cc/CHANGELOG.md +7 -0
  11. data/rust-vendor/cc/Cargo.lock +1 -1
  12. data/rust-vendor/cc/Cargo.toml +1 -1
  13. data/rust-vendor/cc/Cargo.toml.orig +1 -1
  14. data/rust-vendor/cc/src/target/generated.rs +1 -0
  15. data/rust-vendor/cc/src/target/parser.rs +4 -0
  16. data/rust-vendor/html-to-markdown-rs/README.md +1 -1
  17. data/rust-vendor/html-to-markdown-rs/src/convert_api.rs +90 -15
  18. data/rust-vendor/html-to-markdown-rs/src/converter/block/preformatted.rs +15 -4
  19. data/rust-vendor/html-to-markdown-rs/src/converter/handlers/graphic.rs +5 -3
  20. data/rust-vendor/html-to-markdown-rs/src/converter/media/svg.rs +5 -1
  21. data/rust-vendor/html-to-markdown-rs/src/converter/text/processing.rs +15 -8
  22. data/rust-vendor/html-to-markdown-rs/src/converter/utility/preprocessing.rs +43 -18
  23. data/rust-vendor/html-to-markdown-rs/src/lib.rs +6 -6
  24. data/rust-vendor/html-to-markdown-rs/src/validation.rs +68 -29
  25. data/rust-vendor/html-to-markdown-rs/tests/issue_190_regressions.rs +121 -0
  26. data/rust-vendor/html-to-markdown-rs/tests/skip_images_test.rs +21 -0
  27. data/rust-vendor/proc-macro2/.cargo-checksum.json +1 -1
  28. data/rust-vendor/proc-macro2/.cargo_vcs_info.json +1 -1
  29. data/rust-vendor/proc-macro2/Cargo.lock +14 -89
  30. data/rust-vendor/proc-macro2/Cargo.toml +1 -1
  31. data/rust-vendor/proc-macro2/Cargo.toml.orig +1 -1
  32. data/rust-vendor/proc-macro2/src/fallback.rs +37 -23
  33. data/rust-vendor/proc-macro2/src/lib.rs +1 -1
  34. data/rust-vendor/quote/.cargo-checksum.json +1 -1
  35. data/rust-vendor/quote/.cargo_vcs_info.json +1 -1
  36. data/rust-vendor/quote/.github/workflows/ci.yml +1 -1
  37. data/rust-vendor/quote/Cargo.lock +17 -17
  38. data/rust-vendor/quote/Cargo.toml +1 -1
  39. data/rust-vendor/quote/Cargo.toml.orig +1 -1
  40. data/rust-vendor/quote/src/format.rs +2 -2
  41. data/rust-vendor/quote/src/lib.rs +1 -1
  42. data/rust-vendor/quote/src/runtime.rs +2 -2
  43. data/rust-vendor/quote/tests/test.rs +6 -0
  44. data/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated-dup.stderr +2 -2
  45. data/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated.stderr +2 -2
  46. data/rust-vendor/quote/tests/ui/does-not-have-iter-separated.stderr +2 -2
  47. data/rust-vendor/quote/tests/ui/does-not-have-iter.stderr +2 -2
  48. data/rust-vendor/quote/tests/ui/not-repeatable.stderr +8 -8
  49. data/rust-vendor/siphasher/.cargo-checksum.json +1 -1
  50. data/rust-vendor/siphasher/.cargo_vcs_info.json +1 -1
  51. data/rust-vendor/siphasher/.github/workflows/issues.yml +17 -0
  52. data/rust-vendor/siphasher/COPYING +1 -1
  53. data/rust-vendor/siphasher/Cargo.lock +89 -0
  54. data/rust-vendor/siphasher/Cargo.toml +23 -13
  55. data/rust-vendor/siphasher/Cargo.toml.orig +1 -1
  56. data/rust-vendor/siphasher/src/common.rs +65 -0
  57. data/rust-vendor/siphasher/src/lib.rs +1 -1
  58. data/rust-vendor/siphasher/src/sip.rs +2 -68
  59. data/rust-vendor/siphasher/src/sip128.rs +15 -74
  60. data/rust-vendor/siphasher/src/tests.rs +1 -1
  61. data/rust-vendor/siphasher/src/tests128.rs +1 -1
  62. data/rust-vendor/uuid/.cargo-checksum.json +1 -1
  63. data/rust-vendor/uuid/.cargo_vcs_info.json +1 -1
  64. data/rust-vendor/uuid/Cargo.lock +125 -96
  65. data/rust-vendor/uuid/Cargo.toml +4 -11
  66. data/rust-vendor/uuid/Cargo.toml.orig +5 -14
  67. data/rust-vendor/uuid/README.md +3 -3
  68. data/rust-vendor/uuid/src/builder.rs +2 -1
  69. data/rust-vendor/uuid/src/external/serde_support.rs +209 -142
  70. data/rust-vendor/uuid/src/lib.rs +9 -11
  71. data/rust-vendor/uuid/src/macros.rs +9 -54
  72. data/rust-vendor/uuid/src/non_nil.rs +49 -2
  73. data/rust-vendor/web_atoms/.cargo-checksum.json +1 -1
  74. data/rust-vendor/web_atoms/.cargo_vcs_info.json +1 -1
  75. data/rust-vendor/web_atoms/Cargo.lock +1 -1
  76. data/rust-vendor/web_atoms/Cargo.toml +1 -1
  77. data/rust-vendor/web_atoms/Cargo.toml.orig +1 -1
  78. data/rust-vendor/web_atoms/local_names.txt +3 -0
  79. data/rust-vendor/zerocopy/.cargo-checksum.json +1 -1
  80. data/rust-vendor/zerocopy/.cargo_vcs_info.json +1 -1
  81. data/rust-vendor/zerocopy/Cargo.lock +5 -9
  82. data/rust-vendor/zerocopy/Cargo.toml +10 -18
  83. data/rust-vendor/zerocopy/Cargo.toml.orig +6 -14
  84. data/rust-vendor/zerocopy/Cargo.toml.std +58 -0
  85. data/rust-vendor/zerocopy/agent_docs/ui_tests.md +5 -5
  86. data/rust-vendor/zerocopy/cargo.sh +1 -1
  87. data/rust-vendor/zerocopy/ci/check_fmt.sh +1 -1
  88. data/rust-vendor/zerocopy/ci/check_readme.sh +1 -1
  89. data/rust-vendor/zerocopy/ci/check_stale_stderr.sh +44 -0
  90. data/rust-vendor/zerocopy/githooks/pre-push +2 -0
  91. data/rust-vendor/zerocopy/src/byte_slice.rs +1 -1
  92. data/rust-vendor/zerocopy/src/byteorder.rs +0 -1
  93. data/rust-vendor/zerocopy/src/impls.rs +334 -118
  94. data/rust-vendor/zerocopy/src/layout.rs +9 -0
  95. data/rust-vendor/zerocopy/src/lib.rs +163 -74
  96. data/rust-vendor/zerocopy/src/macros.rs +4 -8
  97. data/rust-vendor/zerocopy/src/pointer/inner.rs +4 -4
  98. data/rust-vendor/zerocopy/src/pointer/invariant.rs +22 -5
  99. data/rust-vendor/zerocopy/src/pointer/mod.rs +155 -18
  100. data/rust-vendor/zerocopy/src/pointer/ptr.rs +133 -182
  101. data/rust-vendor/zerocopy/src/pointer/transmute.rs +99 -106
  102. data/rust-vendor/zerocopy/src/ref.rs +4 -4
  103. data/rust-vendor/zerocopy/src/util/macro_util.rs +73 -127
  104. data/rust-vendor/zerocopy/src/util/macros.rs +61 -150
  105. data/rust-vendor/zerocopy/src/wrappers.rs +249 -3
  106. data/rust-vendor/zerocopy/tests/include.rs +67 -0
  107. data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-from-bytes.rs +1 -3
  108. data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-from-bytes.stderr +6 -6
  109. data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-from-zeros.rs +1 -3
  110. data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-from-zeros.stderr +4 -4
  111. data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-immutable.rs +1 -3
  112. data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-immutable.stderr +6 -6
  113. data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-into-bytes.rs +1 -3
  114. data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-into-bytes.stderr +6 -6
  115. data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-issue-1296.rs +1 -3
  116. data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-issue-1296.stderr +8 -8
  117. data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-known-layout.rs +1 -3
  118. data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-known-layout.stderr +6 -6
  119. data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.rs +1 -3
  120. data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.stderr +6 -6
  121. data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-unaligned.rs +1 -3
  122. data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-unaligned.stderr +4 -4
  123. data/rust-vendor/zerocopy/tests/ui-msrv/include_value_not_from_bytes.rs +3 -5
  124. data/rust-vendor/zerocopy/tests/ui-msrv/include_value_not_from_bytes.stderr +10 -10
  125. data/rust-vendor/zerocopy/tests/ui-msrv/include_value_wrong_size.rs +1 -4
  126. data/rust-vendor/zerocopy/tests/ui-msrv/include_value_wrong_size.stderr +3 -3
  127. data/rust-vendor/zerocopy/tests/ui-msrv/invalid-impls/invalid-impls.rs +0 -1
  128. data/rust-vendor/zerocopy/tests/ui-msrv/invalid-impls/invalid-impls.stderr +35 -35
  129. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-dst-not-frombytes.rs +1 -3
  130. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-dst-not-frombytes.stderr +6 -6
  131. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-const.rs +1 -3
  132. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-const.stderr +10 -10
  133. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-a-reference.rs +0 -2
  134. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-a-reference.stderr +2 -2
  135. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-frombytes.rs +0 -2
  136. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-frombytes.stderr +2 -2
  137. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-intobytes.rs +0 -2
  138. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-intobytes.stderr +2 -2
  139. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-unsized.rs +0 -2
  140. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-unsized.stderr +2 -2
  141. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-dst-not-references.rs +0 -2
  142. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-dst-not-references.stderr +2 -2
  143. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-immutable.rs +0 -2
  144. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-immutable.stderr +2 -2
  145. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-a-reference.rs +0 -2
  146. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-a-reference.stderr +2 -2
  147. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-frombytes.rs +0 -2
  148. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-frombytes.stderr +2 -2
  149. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-intobytes.rs +0 -2
  150. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-intobytes.stderr +2 -2
  151. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-unsized.rs +0 -2
  152. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-unsized.stderr +2 -2
  153. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ptr-to-usize.rs +0 -2
  154. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ptr-to-usize.stderr +4 -4
  155. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-mutable.rs +0 -2
  156. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-mutable.stderr +6 -6
  157. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-a-reference.rs +0 -2
  158. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-a-reference.stderr +6 -6
  159. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-frombytes.rs +1 -3
  160. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-frombytes.stderr +6 -6
  161. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-nocell.rs +1 -3
  162. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-nocell.stderr +6 -6
  163. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-unsized.rs +0 -2
  164. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-unsized.stderr +2 -2
  165. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-dst-not-references.rs +0 -2
  166. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-dst-not-references.stderr +8 -8
  167. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-a-reference.rs +0 -2
  168. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-a-reference.stderr +2 -2
  169. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-intobytes.rs +1 -3
  170. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-intobytes.stderr +12 -12
  171. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-nocell.rs +1 -3
  172. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-nocell.stderr +12 -12
  173. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-unsized.rs +0 -2
  174. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-unsized.stderr +2 -2
  175. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-decrease.rs +1 -3
  176. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-decrease.stderr +2 -2
  177. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-increase-allow-shrink.rs +1 -3
  178. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-increase-allow-shrink.stderr +2 -2
  179. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-increase.rs +1 -3
  180. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-increase.stderr +2 -2
  181. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-src-not-intobytes.rs +1 -3
  182. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-src-not-intobytes.stderr +6 -6
  183. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-dst-not-tryfrombytes.rs +1 -3
  184. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-dst-not-tryfrombytes.stderr +12 -12
  185. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-size-decrease.rs +1 -3
  186. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-size-decrease.stderr +2 -2
  187. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-size-increase.rs +1 -3
  188. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-size-increase.stderr +2 -2
  189. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-src-not-intobytes.rs +1 -3
  190. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-src-not-intobytes.stderr +4 -4
  191. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-alignment-increase.rs +1 -3
  192. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-alignment-increase.stderr +2 -2
  193. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.rs +1 -3
  194. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.stderr +16 -16
  195. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-size-decrease.rs +1 -3
  196. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-size-decrease.stderr +2 -2
  197. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-size-increase.rs +1 -3
  198. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-size-increase.stderr +4 -4
  199. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-src-not-frombytes.rs +0 -2
  200. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-src-not-frombytes.stderr +6 -6
  201. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-src-not-intobytes.rs +0 -2
  202. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-src-not-intobytes.stderr +6 -6
  203. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-alignment-increase.rs +1 -3
  204. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-alignment-increase.stderr +2 -2
  205. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-dst-mutable.rs +0 -2
  206. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-dst-mutable.stderr +4 -4
  207. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.rs +1 -3
  208. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +16 -16
  209. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-size-decrease.rs +1 -3
  210. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-size-decrease.stderr +2 -2
  211. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-size-increase.rs +1 -3
  212. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-size-increase.stderr +2 -2
  213. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.rs +1 -3
  214. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.stderr +8 -8
  215. data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-from-bytes.rs +1 -3
  216. data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-from-bytes.stderr +15 -15
  217. data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-from-zeros.rs +1 -3
  218. data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-from-zeros.stderr +12 -12
  219. data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-immutable.rs +1 -3
  220. data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-immutable.stderr +13 -13
  221. data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-into-bytes.rs +1 -3
  222. data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-into-bytes.stderr +8 -8
  223. data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-issue-1296.rs +1 -3
  224. data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-issue-1296.stderr +16 -16
  225. data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-known-layout.rs +1 -3
  226. data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-known-layout.stderr +8 -8
  227. data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.rs +1 -3
  228. data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.stderr +15 -15
  229. data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-unaligned.rs +1 -3
  230. data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-unaligned.stderr +5 -5
  231. data/rust-vendor/zerocopy/tests/ui-nightly/include_value_not_from_bytes.rs +3 -5
  232. data/rust-vendor/zerocopy/tests/ui-nightly/include_value_not_from_bytes.stderr +21 -21
  233. data/rust-vendor/zerocopy/tests/ui-nightly/include_value_wrong_size.rs +1 -4
  234. data/rust-vendor/zerocopy/tests/ui-nightly/include_value_wrong_size.stderr +8 -8
  235. data/rust-vendor/zerocopy/tests/ui-nightly/invalid-impls/invalid-impls.rs +0 -1
  236. data/rust-vendor/zerocopy/tests/ui-nightly/invalid-impls/invalid-impls.stderr +35 -51
  237. data/rust-vendor/zerocopy/tests/ui-nightly/ptr-is-invariant-over-v.stderr +2 -2
  238. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-dst-not-frombytes.rs +1 -3
  239. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-dst-not-frombytes.stderr +15 -15
  240. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-const.rs +1 -3
  241. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-const.stderr +7 -7
  242. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-a-reference.rs +0 -2
  243. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-a-reference.stderr +2 -2
  244. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-frombytes.rs +0 -2
  245. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-frombytes.stderr +12 -12
  246. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-intobytes.rs +0 -2
  247. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-intobytes.stderr +5 -5
  248. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-unsized.rs +0 -2
  249. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-unsized.stderr +3 -3
  250. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-dst-not-references.rs +0 -2
  251. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-dst-not-references.stderr +3 -3
  252. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-immutable.rs +0 -2
  253. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-immutable.stderr +2 -2
  254. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-a-reference.rs +0 -2
  255. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-a-reference.stderr +3 -3
  256. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-frombytes.rs +0 -2
  257. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-frombytes.stderr +12 -12
  258. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-intobytes.rs +0 -2
  259. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-intobytes.stderr +5 -5
  260. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-unsized.rs +0 -2
  261. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-unsized.stderr +3 -3
  262. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ptr-to-usize.rs +0 -2
  263. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ptr-to-usize.stderr +4 -4
  264. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-mutable.rs +0 -2
  265. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-mutable.stderr +6 -6
  266. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-a-reference.rs +0 -2
  267. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-a-reference.stderr +6 -6
  268. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-frombytes.rs +1 -3
  269. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-frombytes.stderr +16 -16
  270. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-nocell.rs +1 -3
  271. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-nocell.stderr +14 -14
  272. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-unsized.rs +0 -2
  273. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-unsized.stderr +3 -3
  274. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-dst-not-references.rs +0 -2
  275. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-dst-not-references.stderr +9 -9
  276. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-a-reference.rs +0 -2
  277. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-a-reference.stderr +3 -3
  278. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-intobytes.rs +1 -3
  279. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-intobytes.stderr +18 -18
  280. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-nocell.rs +1 -3
  281. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-nocell.stderr +28 -28
  282. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-unsized.rs +0 -2
  283. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-unsized.stderr +3 -3
  284. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-decrease.rs +1 -3
  285. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-decrease.stderr +4 -4
  286. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-increase-allow-shrink.rs +1 -3
  287. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-increase-allow-shrink.stderr +4 -4
  288. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-increase.rs +1 -3
  289. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-increase.stderr +4 -4
  290. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-src-not-intobytes.rs +1 -3
  291. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-src-not-intobytes.stderr +8 -8
  292. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-dst-not-tryfrombytes.rs +1 -3
  293. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-dst-not-tryfrombytes.stderr +43 -43
  294. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-size-decrease.rs +1 -3
  295. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-size-decrease.stderr +2 -2
  296. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-size-increase.rs +1 -3
  297. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-size-increase.stderr +2 -2
  298. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-src-not-intobytes.rs +1 -3
  299. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-src-not-intobytes.stderr +8 -8
  300. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-alignment-increase.rs +1 -3
  301. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-alignment-increase.stderr +4 -4
  302. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs +1 -3
  303. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.stderr +51 -51
  304. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-size-decrease.rs +1 -3
  305. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-size-decrease.stderr +2 -2
  306. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-size-increase.rs +1 -3
  307. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-size-increase.stderr +4 -4
  308. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs +0 -2
  309. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-src-not-frombytes.stderr +29 -29
  310. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs +0 -2
  311. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-src-not-intobytes.stderr +22 -22
  312. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-alignment-increase.rs +1 -3
  313. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-alignment-increase.stderr +4 -4
  314. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-dst-mutable.rs +0 -2
  315. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-dst-mutable.stderr +6 -6
  316. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs +1 -3
  317. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +56 -56
  318. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-size-decrease.rs +1 -3
  319. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-size-decrease.stderr +2 -2
  320. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-size-increase.rs +1 -3
  321. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-size-increase.stderr +4 -4
  322. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.rs +1 -3
  323. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.stderr +21 -21
  324. data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-from-bytes.rs +1 -3
  325. data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-from-bytes.stderr +15 -15
  326. data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-from-zeros.rs +1 -3
  327. data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-from-zeros.stderr +12 -12
  328. data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-immutable.rs +1 -3
  329. data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-immutable.stderr +13 -13
  330. data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-into-bytes.rs +1 -3
  331. data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-into-bytes.stderr +8 -8
  332. data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-issue-1296.rs +1 -3
  333. data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-issue-1296.stderr +16 -16
  334. data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-known-layout.rs +1 -3
  335. data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-known-layout.stderr +8 -8
  336. data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-try-from-bytes.rs +1 -3
  337. data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-try-from-bytes.stderr +15 -15
  338. data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-unaligned.rs +1 -3
  339. data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-unaligned.stderr +5 -5
  340. data/rust-vendor/zerocopy/tests/ui-stable/include_value_not_from_bytes.rs +3 -5
  341. data/rust-vendor/zerocopy/tests/ui-stable/include_value_not_from_bytes.stderr +21 -21
  342. data/rust-vendor/zerocopy/tests/ui-stable/include_value_wrong_size.rs +1 -4
  343. data/rust-vendor/zerocopy/tests/ui-stable/include_value_wrong_size.stderr +8 -8
  344. data/rust-vendor/zerocopy/tests/ui-stable/invalid-impls/invalid-impls.rs +0 -1
  345. data/rust-vendor/zerocopy/tests/ui-stable/invalid-impls/invalid-impls.stderr +37 -37
  346. data/rust-vendor/zerocopy/tests/ui-stable/ptr-is-invariant-over-v.stderr +2 -2
  347. data/rust-vendor/zerocopy/tests/ui-stable/transmute-dst-not-frombytes.rs +1 -3
  348. data/rust-vendor/zerocopy/tests/ui-stable/transmute-dst-not-frombytes.stderr +15 -15
  349. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-const.rs +1 -3
  350. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-const.stderr +6 -6
  351. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-a-reference.rs +0 -2
  352. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-a-reference.stderr +2 -2
  353. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-frombytes.rs +0 -2
  354. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-frombytes.stderr +11 -11
  355. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-intobytes.rs +0 -2
  356. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-intobytes.stderr +4 -4
  357. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-unsized.rs +0 -2
  358. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-unsized.stderr +2 -2
  359. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-dst-not-references.rs +0 -2
  360. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-dst-not-references.stderr +3 -3
  361. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-immutable.rs +0 -2
  362. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-immutable.stderr +2 -2
  363. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-a-reference.rs +0 -2
  364. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-a-reference.stderr +3 -3
  365. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-frombytes.rs +0 -2
  366. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-frombytes.stderr +11 -11
  367. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-intobytes.rs +0 -2
  368. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-intobytes.stderr +4 -4
  369. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-unsized.rs +0 -2
  370. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-unsized.stderr +2 -2
  371. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ptr-to-usize.rs +0 -2
  372. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ptr-to-usize.stderr +9 -5
  373. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-mutable.rs +0 -2
  374. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-mutable.stderr +6 -6
  375. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-a-reference.rs +0 -2
  376. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-a-reference.stderr +6 -6
  377. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-frombytes.rs +1 -3
  378. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-frombytes.stderr +16 -16
  379. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-nocell.rs +1 -3
  380. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-nocell.stderr +14 -14
  381. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-unsized.rs +0 -2
  382. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-unsized.stderr +2 -2
  383. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-dst-not-references.rs +0 -2
  384. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-dst-not-references.stderr +9 -9
  385. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-a-reference.rs +0 -2
  386. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-a-reference.stderr +3 -3
  387. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-intobytes.rs +1 -3
  388. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-intobytes.stderr +18 -18
  389. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-nocell.rs +1 -3
  390. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-nocell.stderr +28 -28
  391. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-unsized.rs +0 -2
  392. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-unsized.stderr +2 -2
  393. data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-decrease.rs +1 -3
  394. data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-decrease.stderr +4 -4
  395. data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-increase-allow-shrink.rs +1 -3
  396. data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-increase-allow-shrink.stderr +4 -4
  397. data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-increase.rs +1 -3
  398. data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-increase.stderr +4 -4
  399. data/rust-vendor/zerocopy/tests/ui-stable/transmute-src-not-intobytes.rs +1 -3
  400. data/rust-vendor/zerocopy/tests/ui-stable/transmute-src-not-intobytes.stderr +8 -8
  401. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-dst-not-tryfrombytes.rs +1 -3
  402. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-dst-not-tryfrombytes.stderr +42 -42
  403. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-size-decrease.rs +1 -3
  404. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-size-decrease.stderr +2 -2
  405. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-size-increase.rs +1 -3
  406. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-size-increase.stderr +2 -2
  407. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-src-not-intobytes.rs +1 -3
  408. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-src-not-intobytes.stderr +7 -7
  409. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-alignment-increase.rs +1 -3
  410. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-alignment-increase.stderr +2 -2
  411. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.rs +1 -3
  412. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.stderr +49 -49
  413. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-size-decrease.rs +1 -3
  414. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-size-decrease.stderr +2 -2
  415. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-size-increase.rs +1 -3
  416. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-size-increase.stderr +4 -4
  417. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-src-not-frombytes.rs +0 -2
  418. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-src-not-frombytes.stderr +26 -26
  419. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-src-not-intobytes.rs +0 -2
  420. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-src-not-intobytes.stderr +19 -19
  421. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-alignment-increase.rs +1 -3
  422. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-alignment-increase.stderr +2 -2
  423. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-dst-mutable.rs +0 -2
  424. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-dst-mutable.stderr +6 -6
  425. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.rs +1 -3
  426. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +54 -54
  427. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-size-decrease.rs +1 -3
  428. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-size-decrease.stderr +2 -2
  429. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-size-increase.rs +1 -3
  430. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-size-increase.stderr +2 -2
  431. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-src-not-immutable-intobytes.rs +1 -3
  432. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-src-not-immutable-intobytes.stderr +19 -19
  433. data/rust-vendor/zerocopy-derive/.cargo-checksum.json +1 -1
  434. data/rust-vendor/zerocopy-derive/.cargo_vcs_info.json +1 -1
  435. data/rust-vendor/zerocopy-derive/Cargo.lock +3 -11
  436. data/rust-vendor/zerocopy-derive/Cargo.toml +13 -11
  437. data/rust-vendor/zerocopy-derive/Cargo.toml.orig +7 -10
  438. data/rust-vendor/zerocopy-derive/src/derive/from_bytes.rs +188 -0
  439. data/rust-vendor/zerocopy-derive/src/derive/into_bytes.rs +158 -0
  440. data/rust-vendor/zerocopy-derive/src/derive/known_layout.rs +348 -0
  441. data/rust-vendor/zerocopy-derive/src/derive/mod.rs +130 -0
  442. data/rust-vendor/zerocopy-derive/src/derive/try_from_bytes.rs +729 -0
  443. data/rust-vendor/zerocopy-derive/src/derive/unaligned.rs +78 -0
  444. data/rust-vendor/zerocopy-derive/src/lib.rs +31 -1893
  445. data/rust-vendor/zerocopy-derive/src/output_tests/expected/eq.expected.rs +17 -0
  446. data/rust-vendor/zerocopy-derive/src/output_tests/expected/from_bytes_enum.expected.rs +64 -0
  447. data/rust-vendor/zerocopy-derive/src/output_tests/expected/from_bytes_struct.expected.rs +64 -0
  448. data/rust-vendor/zerocopy-derive/src/output_tests/expected/from_bytes_union.expected.rs +144 -0
  449. data/rust-vendor/zerocopy-derive/src/output_tests/expected/from_zeros.expected.rs +39 -0
  450. data/rust-vendor/zerocopy-derive/src/output_tests/expected/hash.expected.rs +24 -0
  451. data/rust-vendor/zerocopy-derive/src/output_tests/expected/immutable.expected.rs +17 -0
  452. data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_enum.expected.rs +17 -0
  453. data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_struct_basic.expected.rs +25 -0
  454. data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_struct_empty.expected.rs +17 -0
  455. data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_struct_trailing.expected.rs +25 -0
  456. data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_struct_trailing_generic.expected.rs +21 -0
  457. data/rust-vendor/zerocopy-derive/src/output_tests/expected/known_layout_repr_c_struct.expected.rs +135 -0
  458. data/rust-vendor/zerocopy-derive/src/output_tests/expected/known_layout_struct.expected.rs +34 -0
  459. data/rust-vendor/zerocopy-derive/src/output_tests/expected/split_at_repr_c.expected.rs +22 -0
  460. data/rust-vendor/zerocopy-derive/src/output_tests/expected/split_at_repr_transparent.expected.rs +22 -0
  461. data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes.expected.rs +22 -0
  462. data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes_enum_1.expected.rs +2802 -0
  463. data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes_enum_2.expected.rs +2802 -0
  464. data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes_enum_3.expected.rs +2802 -0
  465. data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes_trivial_is_bit_valid_enum.expected.rs +22 -0
  466. data/rust-vendor/zerocopy-derive/src/output_tests/expected/unaligned.expected.rs +17 -0
  467. data/rust-vendor/zerocopy-derive/src/output_tests/mod.rs +960 -0
  468. data/rust-vendor/zerocopy-derive/src/util.rs +757 -0
  469. data/rust-vendor/zerocopy-derive/tests/deprecated.rs +6 -0
  470. data/rust-vendor/zerocopy-derive/tests/enum_from_zeros.rs +9 -0
  471. data/rust-vendor/zerocopy-derive/tests/enum_known_layout.rs +4 -0
  472. data/rust-vendor/zerocopy-derive/tests/enum_no_cell.rs +4 -0
  473. data/rust-vendor/zerocopy-derive/tests/enum_to_bytes.rs +14 -0
  474. data/rust-vendor/zerocopy-derive/tests/enum_try_from_bytes.rs +37 -15
  475. data/rust-vendor/zerocopy-derive/tests/enum_unaligned.rs +4 -0
  476. data/rust-vendor/zerocopy-derive/tests/eq.rs +1 -0
  477. data/rust-vendor/zerocopy-derive/tests/hash.rs +1 -0
  478. data/rust-vendor/zerocopy-derive/tests/hygiene.rs +3 -1
  479. data/rust-vendor/zerocopy-derive/tests/include.rs +26 -4
  480. data/rust-vendor/zerocopy-derive/tests/issue_2117.rs +1 -0
  481. data/rust-vendor/zerocopy-derive/tests/issue_2835.rs +2 -1
  482. data/rust-vendor/zerocopy-derive/tests/issue_2880.rs +292 -0
  483. data/rust-vendor/zerocopy-derive/tests/issue_2915.rs +78 -0
  484. data/rust-vendor/zerocopy-derive/tests/paths_and_modules.rs +3 -0
  485. data/rust-vendor/zerocopy-derive/tests/priv_in_pub.rs +2 -0
  486. data/rust-vendor/zerocopy-derive/tests/struct_from_bytes.rs +6 -0
  487. data/rust-vendor/zerocopy-derive/tests/struct_from_zeros.rs +6 -0
  488. data/rust-vendor/zerocopy-derive/tests/struct_known_layout.rs +9 -0
  489. data/rust-vendor/zerocopy-derive/tests/struct_no_cell.rs +8 -0
  490. data/rust-vendor/zerocopy-derive/tests/struct_to_bytes.rs +17 -0
  491. data/rust-vendor/zerocopy-derive/tests/struct_try_from_bytes.rs +29 -65
  492. data/rust-vendor/zerocopy-derive/tests/struct_unaligned.rs +7 -0
  493. data/rust-vendor/zerocopy-derive/tests/ui-msrv/derive_transparent.rs +3 -2
  494. data/rust-vendor/zerocopy-derive/tests/ui-msrv/derive_transparent.stderr +32 -32
  495. data/rust-vendor/zerocopy-derive/tests/ui-msrv/enum.rs +48 -1
  496. data/rust-vendor/zerocopy-derive/tests/ui-msrv/enum.stderr +129 -126
  497. data/rust-vendor/zerocopy-derive/tests/ui-msrv/enum_from_bytes_u8_too_few.rs +2 -1
  498. data/rust-vendor/zerocopy-derive/tests/ui-msrv/enum_from_bytes_u8_too_few.stderr +6 -6
  499. data/rust-vendor/zerocopy-derive/tests/ui-msrv/late_compile_pass.rs +9 -2
  500. data/rust-vendor/zerocopy-derive/tests/ui-msrv/late_compile_pass.stderr +37 -37
  501. data/rust-vendor/zerocopy-derive/tests/ui-msrv/mid_compile_pass.rs +6 -2
  502. data/rust-vendor/zerocopy-derive/tests/ui-msrv/mid_compile_pass.stderr +26 -26
  503. data/rust-vendor/zerocopy-derive/tests/ui-msrv/msrv_specific.rs +3 -2
  504. data/rust-vendor/zerocopy-derive/tests/ui-msrv/msrv_specific.stderr +7 -7
  505. data/rust-vendor/zerocopy-derive/tests/ui-msrv/privacy.rs +66 -29
  506. data/rust-vendor/zerocopy-derive/tests/ui-msrv/privacy.stderr +78 -78
  507. data/rust-vendor/zerocopy-derive/tests/ui-msrv/struct.rs +34 -2
  508. data/rust-vendor/zerocopy-derive/tests/ui-msrv/struct.stderr +79 -79
  509. data/rust-vendor/zerocopy-derive/tests/ui-msrv/union.rs +12 -1
  510. data/rust-vendor/zerocopy-derive/tests/ui-msrv/union.stderr +29 -29
  511. data/rust-vendor/zerocopy-derive/tests/ui-msrv/union_into_bytes_cfg/union_into_bytes_cfg.rs +3 -2
  512. data/rust-vendor/zerocopy-derive/tests/ui-nightly/absence_of_deprecated_warning.rs +3 -2
  513. data/rust-vendor/zerocopy-derive/tests/ui-nightly/absence_of_deprecated_warning.stderr +2 -2
  514. data/rust-vendor/zerocopy-derive/tests/ui-nightly/derive_transparent.rs +3 -2
  515. data/rust-vendor/zerocopy-derive/tests/ui-nightly/derive_transparent.stderr +57 -57
  516. data/rust-vendor/zerocopy-derive/tests/ui-nightly/enum.rs +48 -1
  517. data/rust-vendor/zerocopy-derive/tests/ui-nightly/enum.stderr +200 -192
  518. data/rust-vendor/zerocopy-derive/tests/ui-nightly/enum_from_bytes_u8_too_few.rs +2 -1
  519. data/rust-vendor/zerocopy-derive/tests/ui-nightly/enum_from_bytes_u8_too_few.stderr +6 -6
  520. data/rust-vendor/zerocopy-derive/tests/ui-nightly/late_compile_pass.rs +9 -2
  521. data/rust-vendor/zerocopy-derive/tests/ui-nightly/late_compile_pass.stderr +105 -105
  522. data/rust-vendor/zerocopy-derive/tests/ui-nightly/mid_compile_pass.rs +6 -2
  523. data/rust-vendor/zerocopy-derive/tests/ui-nightly/mid_compile_pass.stderr +29 -29
  524. data/rust-vendor/zerocopy-derive/tests/ui-nightly/privacy.rs +66 -29
  525. data/rust-vendor/zerocopy-derive/tests/ui-nightly/privacy.stderr +15 -15
  526. data/rust-vendor/zerocopy-derive/tests/ui-nightly/struct.rs +34 -2
  527. data/rust-vendor/zerocopy-derive/tests/ui-nightly/struct.stderr +130 -129
  528. data/rust-vendor/zerocopy-derive/tests/ui-nightly/union.rs +12 -1
  529. data/rust-vendor/zerocopy-derive/tests/ui-nightly/union.stderr +42 -42
  530. data/rust-vendor/zerocopy-derive/tests/ui-nightly/union_into_bytes_cfg/union_into_bytes_cfg.rs +3 -2
  531. data/rust-vendor/zerocopy-derive/tests/ui-stable/derive_transparent.rs +3 -2
  532. data/rust-vendor/zerocopy-derive/tests/ui-stable/derive_transparent.stderr +57 -57
  533. data/rust-vendor/zerocopy-derive/tests/ui-stable/enum.rs +48 -1
  534. data/rust-vendor/zerocopy-derive/tests/ui-stable/enum.stderr +201 -186
  535. data/rust-vendor/zerocopy-derive/tests/ui-stable/enum_from_bytes_u8_too_few.rs +2 -1
  536. data/rust-vendor/zerocopy-derive/tests/ui-stable/enum_from_bytes_u8_too_few.stderr +6 -6
  537. data/rust-vendor/zerocopy-derive/tests/ui-stable/late_compile_pass.rs +9 -2
  538. data/rust-vendor/zerocopy-derive/tests/ui-stable/late_compile_pass.stderr +105 -105
  539. data/rust-vendor/zerocopy-derive/tests/ui-stable/mid_compile_pass.rs +6 -2
  540. data/rust-vendor/zerocopy-derive/tests/ui-stable/mid_compile_pass.stderr +29 -29
  541. data/rust-vendor/zerocopy-derive/tests/ui-stable/privacy.rs +66 -29
  542. data/rust-vendor/zerocopy-derive/tests/ui-stable/privacy.stderr +15 -15
  543. data/rust-vendor/zerocopy-derive/tests/ui-stable/struct.rs +34 -2
  544. data/rust-vendor/zerocopy-derive/tests/ui-stable/struct.stderr +158 -129
  545. data/rust-vendor/zerocopy-derive/tests/ui-stable/union.rs +12 -1
  546. data/rust-vendor/zerocopy-derive/tests/ui-stable/union.stderr +48 -44
  547. data/rust-vendor/zerocopy-derive/tests/ui-stable/union_into_bytes_cfg/union_into_bytes_cfg.rs +3 -2
  548. data/rust-vendor/zerocopy-derive/tests/union_from_bytes.rs +15 -0
  549. data/rust-vendor/zerocopy-derive/tests/union_from_zeros.rs +14 -0
  550. data/rust-vendor/zerocopy-derive/tests/union_known_layout.rs +5 -0
  551. data/rust-vendor/zerocopy-derive/tests/union_no_cell.rs +5 -0
  552. data/rust-vendor/zerocopy-derive/tests/union_to_bytes.rs +5 -0
  553. data/rust-vendor/zerocopy-derive/tests/union_try_from_bytes.rs +34 -74
  554. data/rust-vendor/zerocopy-derive/tests/union_unaligned.rs +4 -1
  555. data/rust-vendor/zerocopy-derive/tests/unsafe_cell.rs +3 -0
  556. data/rust-vendor/zmij/.cargo-checksum.json +1 -1
  557. data/rust-vendor/zmij/.cargo_vcs_info.json +1 -1
  558. data/rust-vendor/zmij/Cargo.lock +10 -10
  559. data/rust-vendor/zmij/Cargo.toml +1 -1
  560. data/rust-vendor/zmij/Cargo.toml.orig +1 -1
  561. data/rust-vendor/zmij/README.md +1 -1
  562. data/rust-vendor/zmij/src/lib.rs +132 -158
  563. data/rust-vendor/zune-jpeg/.cargo-checksum.json +1 -1
  564. data/rust-vendor/zune-jpeg/.cargo_vcs_info.json +1 -1
  565. data/rust-vendor/zune-jpeg/Cargo.lock +1 -1
  566. data/rust-vendor/zune-jpeg/Cargo.toml +1 -1
  567. data/rust-vendor/zune-jpeg/Cargo.toml.orig +1 -1
  568. data/rust-vendor/zune-jpeg/src/bitstream.rs +1 -1
  569. data/rust-vendor/zune-jpeg/src/components.rs +2 -1
  570. data/rust-vendor/zune-jpeg/src/decoder.rs +3 -23
  571. data/rust-vendor/zune-jpeg/src/headers.rs +19 -1
  572. data/rust-vendor/zune-jpeg/src/lib.rs +1 -0
  573. data/rust-vendor/zune-jpeg/src/mcu.rs +6 -6
  574. data/rust-vendor/zune-jpeg/src/mcu_prog.rs +22 -34
  575. data/rust-vendor/zune-jpeg/src/upsampler/avx2.rs +3 -1
  576. data/rust-vendor/zune-jpeg/src/upsampler/neon.rs +13 -23
  577. data/rust-vendor/zune-jpeg/src/upsampler/portable_simd.rs +4 -1
  578. data/rust-vendor/zune-jpeg/src/upsampler/scalar.rs +4 -1
  579. metadata +41 -8
  580. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-dst-unsized.stderr +0 -183
  581. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-dst-unsized.stderr +0 -183
  582. data/rust-vendor/zerocopy-derive/src/enum.rs +0 -456
  583. data/rust-vendor/zerocopy-derive/src/ext.rs +0 -123
  584. data/rust-vendor/zerocopy-derive/src/output_tests.rs +0 -5608
  585. data/rust-vendor/zerocopy-derive/tests/crate_path.rs +0 -189
@@ -29,10 +29,11 @@ use core::{
29
29
 
30
30
  use crate::{
31
31
  pointer::{
32
- invariant::{self, BecauseExclusive, BecauseImmutable, Invariants},
33
- BecauseInvariantsEq, InvariantsEq, SizeEq, TryTransmuteFromPtr,
32
+ cast::CastSized,
33
+ invariant::{Aligned, Initialized, Valid},
34
+ BecauseInvariantsEq,
34
35
  },
35
- FromBytes, FromZeros, Immutable, IntoBytes, KnownLayout, Ptr, TryFromBytes, ValidityError,
36
+ FromBytes, Immutable, IntoBytes, KnownLayout, Ptr, ReadOnly, TryFromBytes, ValidityError,
36
37
  };
37
38
 
38
39
  /// Projects the type of the field at `Index` in `Self` without regard for field
@@ -530,6 +531,18 @@ macro_rules! assert_size_eq {
530
531
  }};
531
532
  }
532
533
 
534
+ /// Unwraps an infallible `Result`.
535
+ #[doc(hidden)]
536
+ #[macro_export]
537
+ macro_rules! into_inner {
538
+ ($e:expr) => {
539
+ match $e {
540
+ $crate::util::macro_util::core_reexport::result::Result::Ok(e) => e,
541
+ $crate::util::macro_util::core_reexport::result::Result::Err(i) => match i {},
542
+ }
543
+ };
544
+ }
545
+
533
546
  /// Translates an identifier or tuple index into a numeric identifier.
534
547
  #[doc(hidden)] // `#[macro_export]` bypasses this module's `#[doc(hidden)]`.
535
548
  #[macro_export]
@@ -587,65 +600,6 @@ pub const fn hash_name(name: &str) -> i128 {
587
600
  i128::from_ne_bytes(hash.to_ne_bytes())
588
601
  }
589
602
 
590
- /// Is a given source a valid instance of `Dst`?
591
- ///
592
- /// If so, returns `src` casted to a `Ptr<Dst, _>`. Otherwise returns `None`.
593
- ///
594
- /// # Safety
595
- ///
596
- /// Unsafe code may assume that, if `try_cast_or_pme(src)` returns `Ok`,
597
- /// `*src` is a bit-valid instance of `Dst`, and that the size of `Src` is
598
- /// greater than or equal to the size of `Dst`.
599
- ///
600
- /// Unsafe code may assume that, if `try_cast_or_pme(src)` returns `Err`, the
601
- /// encapsulated `Ptr` value is the original `src`. `try_cast_or_pme` cannot
602
- /// guarantee that the referent has not been modified, as it calls user-defined
603
- /// code (`TryFromBytes::is_bit_valid`).
604
- ///
605
- /// # Panics
606
- ///
607
- /// `try_cast_or_pme` may either produce a post-monomorphization error or a
608
- /// panic if `Dst` not the same size as `Src`. Otherwise, `try_cast_or_pme`
609
- /// panics under the same circumstances as [`is_bit_valid`].
610
- ///
611
- /// [`is_bit_valid`]: TryFromBytes::is_bit_valid
612
- #[doc(hidden)]
613
- #[inline]
614
- fn try_cast_or_pme<Src, Dst, I, R, S>(
615
- src: Ptr<'_, Src, I>,
616
- ) -> Result<
617
- Ptr<'_, Dst, (I::Aliasing, invariant::Unaligned, invariant::Valid)>,
618
- ValidityError<Ptr<'_, Src, I>, Dst>,
619
- >
620
- where
621
- // FIXME(#2226): There should be a `Src: FromBytes` bound here, but doing so
622
- // requires deeper surgery.
623
- Src: invariant::Read<I::Aliasing, R>,
624
- Dst: TryFromBytes
625
- + invariant::Read<I::Aliasing, R>
626
- + TryTransmuteFromPtr<Dst, I::Aliasing, invariant::Initialized, invariant::Valid, S>,
627
- I: Invariants<Validity = invariant::Initialized>,
628
- I::Aliasing: invariant::Reference,
629
- {
630
- static_assert!(Src, Dst => mem::size_of::<Dst>() == mem::size_of::<Src>());
631
-
632
- let c_ptr = src.cast::<_, crate::pointer::cast::CastSized, _>();
633
-
634
- match c_ptr.try_into_valid() {
635
- Ok(ptr) => Ok(ptr),
636
- Err(err) => {
637
- // Re-cast `Ptr<Dst>` to `Ptr<Src>`.
638
- let ptr = err.into_src();
639
- let ptr = ptr.cast::<_, crate::pointer::cast::CastSized, _>();
640
- // SAFETY: `ptr` is `src`, and has the same alignment invariant.
641
- let ptr = unsafe { ptr.assume_alignment::<I::Alignment>() };
642
- // SAFETY: `ptr` is `src` and has the same validity invariant.
643
- let ptr = unsafe { ptr.assume_validity::<I::Validity>() };
644
- Err(ValidityError::new(ptr.unify_invariants()))
645
- }
646
- }
647
- }
648
-
649
603
  /// Attempts to transmute `Src` into `Dst`.
650
604
  ///
651
605
  /// A helper for `try_transmute!`.
@@ -666,32 +620,28 @@ where
666
620
  static_assert!(Src, Dst => mem::size_of::<Dst>() == mem::size_of::<Src>());
667
621
 
668
622
  let mu_src = mem::MaybeUninit::new(src);
669
- // SAFETY: By invariant on `&`, the following are satisfied:
670
- // - `&mu_src` is valid for reads
671
- // - `&mu_src` is properly aligned
672
- // - `&mu_src`'s referent is bit-valid
673
- let mu_src_copy = unsafe { core::ptr::read(&mu_src) };
674
- // SAFETY: `MaybeUninit` has no validity constraints.
675
- let mut mu_dst: mem::MaybeUninit<Dst> =
676
- unsafe { crate::util::transmute_unchecked(mu_src_copy) };
623
+ // SAFETY: `MaybeUninit` has no validity requirements.
624
+ let mu_dst: mem::MaybeUninit<ReadOnly<Dst>> =
625
+ unsafe { crate::util::transmute_unchecked(mu_src) };
677
626
 
678
- let ptr = Ptr::from_mut(&mut mu_dst);
627
+ let ptr = Ptr::from_ref(&mu_dst);
679
628
 
680
629
  // SAFETY: Since `Src: IntoBytes`, and since `size_of::<Src>() ==
681
630
  // size_of::<Dst>()` by the preceding assertion, all of `mu_dst`'s bytes are
682
- // initialized.
683
- let ptr = unsafe { ptr.assume_validity::<invariant::Initialized>() };
684
-
685
- let ptr: Ptr<'_, Dst, _> = ptr.cast::<_, crate::pointer::cast::CastSized, _>();
686
-
687
- if Dst::is_bit_valid(ptr.forget_aligned()) {
631
+ // initialized. `MaybeUninit` has no validity requirements, so even if
632
+ // `ptr` is used to mutate its referent (which it actually can't be - it's
633
+ // a shared `ReadOnly` pointer), that won't violate its referent's validity.
634
+ let ptr = unsafe { ptr.assume_validity::<Initialized>() };
635
+ if Dst::is_bit_valid(ptr.cast::<_, CastSized, _>()) {
688
636
  // SAFETY: Since `Dst::is_bit_valid`, we know that `ptr`'s referent is
689
637
  // bit-valid for `Dst`. `ptr` points to `mu_dst`, and no intervening
690
638
  // operations have mutated it, so it is a bit-valid `Dst`.
691
- Ok(unsafe { mu_dst.assume_init() })
639
+ Ok(ReadOnly::into_inner(unsafe { mu_dst.assume_init() }))
692
640
  } else {
693
- // SAFETY: `mu_src` was constructed from `src` and never modified, so it
694
- // is still bit-valid.
641
+ // SAFETY: `MaybeUninit` has no validity requirements.
642
+ let mu_src: mem::MaybeUninit<Src> = unsafe { crate::util::transmute_unchecked(mu_dst) };
643
+ // SAFETY: `mu_dst`/`mu_src` was constructed from `src` and never
644
+ // modified, so it is still bit-valid.
695
645
  Err(ValidityError::new(unsafe { mu_src.assume_init() }))
696
646
  }
697
647
  }
@@ -715,23 +665,28 @@ where
715
665
  Dst: TryFromBytes + Immutable,
716
666
  {
717
667
  let ptr = Ptr::from_ref(src);
718
- let ptr = ptr.bikeshed_recall_initialized_immutable();
719
- match try_cast_or_pme::<Src, Dst, _, BecauseImmutable, _>(ptr) {
668
+ let ptr = ptr.recall_validity::<Initialized, _>();
669
+ let ptr = ptr.cast::<_, CastSized, _>();
670
+ match ptr.try_into_valid() {
720
671
  Ok(ptr) => {
721
672
  static_assert!(Src, Dst => mem::align_of::<Dst>() <= mem::align_of::<Src>());
722
673
  // SAFETY: We have checked that `Dst` does not have a stricter
723
674
  // alignment requirement than `Src`.
724
- let ptr = unsafe { ptr.assume_alignment::<invariant::Aligned>() };
675
+ let ptr = unsafe { ptr.assume_alignment::<Aligned>() };
725
676
  Ok(ptr.as_ref())
726
677
  }
727
678
  Err(err) => Err(err.map_src(|ptr| {
679
+ let ptr = ptr.cast::<_, CastSized, _>();
680
+ // SAFETY: `ptr` has the same address as `src: &Src`, which is
681
+ // aligned by invariant on `&Src`.
682
+ let ptr = unsafe { ptr.assume_alignment::<Aligned>() };
728
683
  // SAFETY: Because `Src: Immutable` and we create a `Ptr` via
729
684
  // `Ptr::from_ref`, the resulting `Ptr` is a shared-and-`Immutable`
730
685
  // `Ptr`, which does not permit mutation of its referent. Therefore,
731
686
  // no mutation could have happened during the call to
732
- // `try_cast_or_pme` (any such mutation would be unsound).
687
+ // `try_into_valid` (any such mutation would be unsound).
733
688
  //
734
- // `try_cast_or_pme` promises to return its original argument, and
689
+ // `try_into_valid` promises to return its original argument, and
735
690
  // so we know that we are getting back the same `ptr` that we
736
691
  // originally passed, and that `ptr` was a bit-valid `Src`.
737
692
  let ptr = unsafe { ptr.assume_valid() };
@@ -759,17 +714,24 @@ where
759
714
  Dst: TryFromBytes + IntoBytes,
760
715
  {
761
716
  let ptr = Ptr::from_mut(src);
762
- let ptr = ptr.bikeshed_recall_initialized_from_bytes();
763
- match try_cast_or_pme::<Src, Dst, _, BecauseExclusive, _>(ptr) {
717
+ let ptr = ptr.recall_validity::<Initialized, (_, (_, _))>();
718
+ let ptr = ptr.cast::<_, CastSized, _>();
719
+ match ptr.try_into_valid() {
764
720
  Ok(ptr) => {
765
721
  static_assert!(Src, Dst => mem::align_of::<Dst>() <= mem::align_of::<Src>());
766
722
  // SAFETY: We have checked that `Dst` does not have a stricter
767
723
  // alignment requirement than `Src`.
768
- let ptr = unsafe { ptr.assume_alignment::<invariant::Aligned>() };
724
+ let ptr = unsafe { ptr.assume_alignment::<Aligned>() };
769
725
  Ok(ptr.as_mut())
770
726
  }
771
727
  Err(err) => {
772
- Err(err.map_src(|ptr| ptr.recall_validity::<_, (_, BecauseInvariantsEq)>().as_mut()))
728
+ Err(err.map_src(|ptr| {
729
+ let ptr = ptr.cast::<_, CastSized, _>();
730
+ // SAFETY: `ptr` has the same address as `src: &mut Src`, which
731
+ // is aligned by invariant on `&mut Src`.
732
+ let ptr = unsafe { ptr.assume_alignment::<Aligned>() };
733
+ ptr.recall_validity::<_, (_, BecauseInvariantsEq)>().as_mut()
734
+ }))
773
735
  }
774
736
  }
775
737
  }
@@ -884,29 +846,21 @@ where
884
846
 
885
847
  #[inline(always)]
886
848
  fn transmute_ref(self) -> &'a Dst {
849
+ let ptr = Ptr::from_ref(self.0)
850
+ .recall_validity::<Initialized, _>()
851
+ .transmute_with::<Dst, Initialized, crate::layout::CastFrom<Dst>, (crate::pointer::BecauseMutationCompatible, _)>()
852
+ .recall_validity::<Valid, _>();
853
+
887
854
  static_assert!(Src: ?Sized + KnownLayout, Dst: ?Sized + KnownLayout => {
888
855
  Src::LAYOUT.align.get() >= Dst::LAYOUT.align.get()
889
856
  }, "cannot transmute reference when destination type has higher alignment than source type");
890
857
 
891
- // SAFETY: We only use `S` as `S<Src>` and `D` as `D<Dst>`.
892
- #[allow(clippy::multiple_unsafe_ops_per_block)]
893
- unsafe {
894
- unsafe_with_size_eq!(<S<Src>, D<Dst>> {
895
- let ptr = Ptr::from_ref(self.0)
896
- .transmute::<S<Src>, invariant::Valid, BecauseImmutable>()
897
- .recall_validity::<invariant::Initialized, _>()
898
- .transmute::<D<Dst>, invariant::Initialized, (crate::pointer::BecauseMutationCompatible, _)>()
899
- .recall_validity::<invariant::Valid, _>();
900
-
901
- #[allow(unused_unsafe)]
902
- // SAFETY: The preceding `static_assert!` ensures that
903
- // `T::LAYOUT.align >= U::LAYOUT.align`. Since `self.0` is
904
- // validly-aligned for `T`, it is also validly-aligned for `U`.
905
- let ptr = unsafe { ptr.assume_alignment() };
906
-
907
- &ptr.as_ref().0
908
- })
909
- }
858
+ // SAFETY: The preceding `static_assert!` ensures that
859
+ // `Src::LAYOUT.align >= Dst::LAYOUT.align`. Since `self` is
860
+ // validly-aligned for `Src`, it is also validly-aligned for `Dst`.
861
+ let ptr = unsafe { ptr.assume_alignment() };
862
+
863
+ ptr.as_ref()
910
864
  }
911
865
  }
912
866
 
@@ -925,29 +879,21 @@ where
925
879
 
926
880
  #[inline(always)]
927
881
  fn transmute_mut(self) -> &'a mut Dst {
882
+ let ptr = Ptr::from_mut(self.0)
883
+ .recall_validity::<Initialized, (_, (_, _))>()
884
+ .transmute_with::<Dst, Initialized, crate::layout::CastFrom<Dst>, _>()
885
+ .recall_validity::<Valid, (_, (_, _))>();
886
+
928
887
  static_assert!(Src: ?Sized + KnownLayout, Dst: ?Sized + KnownLayout => {
929
888
  Src::LAYOUT.align.get() >= Dst::LAYOUT.align.get()
930
889
  }, "cannot transmute reference when destination type has higher alignment than source type");
931
890
 
932
- // SAFETY: We only use `S` as `S<Src>` and `D` as `D<Dst>`.
933
- #[allow(clippy::multiple_unsafe_ops_per_block)]
934
- unsafe {
935
- unsafe_with_size_eq!(<S<Src>, D<Dst>> {
936
- let ptr = Ptr::from_mut(self.0)
937
- .transmute::<S<Src>, invariant::Valid, _>()
938
- .recall_validity::<invariant::Initialized, (_, (_, _))>()
939
- .transmute::<D<Dst>, invariant::Initialized, _>()
940
- .recall_validity::<invariant::Valid, (_, (_, _))>();
941
-
942
- #[allow(unused_unsafe)]
943
- // SAFETY: The preceding `static_assert!` ensures that
944
- // `T::LAYOUT.align >= U::LAYOUT.align`. Since `self.0` is
945
- // validly-aligned for `T`, it is also validly-aligned for `U`.
946
- let ptr = unsafe { ptr.assume_alignment() };
947
-
948
- &mut ptr.as_mut().0
949
- })
950
- }
891
+ // SAFETY: The preceding `static_assert!` ensures that
892
+ // `Src::LAYOUT.align >= Dst::LAYOUT.align`. Since `self` is
893
+ // validly-aligned for `Src`, it is also validly-aligned for `Dst`.
894
+ let ptr = unsafe { ptr.assume_alignment() };
895
+
896
+ ptr.as_mut()
951
897
  }
952
898
  }
953
899
 
@@ -135,7 +135,7 @@ macro_rules! unsafe_impl {
135
135
  fn only_derive_is_allowed_to_implement_this_trait() {}
136
136
 
137
137
  #[inline]
138
- fn is_bit_valid<AA: crate::pointer::invariant::Reference>($candidate: Maybe<'_, Self, AA>) -> bool {
138
+ fn is_bit_valid($candidate: Maybe<'_, Self>) -> bool {
139
139
  $is_bit_valid
140
140
  }
141
141
  };
@@ -143,7 +143,7 @@ macro_rules! unsafe_impl {
143
143
  #[allow(clippy::missing_inline_in_public_items)]
144
144
  #[cfg_attr(all(coverage_nightly, __ZEROCOPY_INTERNAL_USE_ONLY_NIGHTLY_FEATURES_IN_TESTS), coverage(off))]
145
145
  fn only_derive_is_allowed_to_implement_this_trait() {}
146
- #[inline(always)] fn is_bit_valid<AA: crate::pointer::invariant::Reference>(_: Maybe<'_, Self, AA>) -> bool { true }
146
+ #[inline(always)] fn is_bit_valid(_candidate: Maybe<'_, Self>) -> bool { true }
147
147
  };
148
148
  (@method $trait:ident) => {
149
149
  #[allow(clippy::missing_inline_in_public_items, dead_code)]
@@ -164,7 +164,7 @@ macro_rules! impl_for_transmute_from {
164
164
  (
165
165
  $(#[$attr:meta])*
166
166
  $($tyvar:ident $(: $(? $optbound:ident $(+)?)* $($bound:ident $(+)?)* )?)?
167
- => $trait:ident for $ty:ty [$($unsafe_cell:ident)? <$repr:ty>]
167
+ => $trait:ident for $ty:ty [$repr:ty]
168
168
  ) => {
169
169
  const _: () = {
170
170
  $(#[$attr])*
@@ -203,7 +203,7 @@ macro_rules! impl_for_transmute_from {
203
203
  impl_for_transmute_from!(
204
204
  @is_bit_valid
205
205
  $(<$tyvar $(: $(? $optbound +)* $($bound +)*)?>)?
206
- $trait for $ty [$($unsafe_cell)? <$repr>]
206
+ $trait for $ty [$repr]
207
207
  );
208
208
  }
209
209
  };
@@ -215,35 +215,20 @@ macro_rules! impl_for_transmute_from {
215
215
  (
216
216
  @is_bit_valid
217
217
  $(<$tyvar:ident $(: $(? $optbound:ident $(+)?)* $($bound:ident $(+)?)* )?>)?
218
- TryFromBytes for $ty:ty [UnsafeCell<$repr:ty>]
218
+ TryFromBytes for $ty:ty [$repr:ty]
219
219
  ) => {
220
220
  #[inline]
221
- fn is_bit_valid<A: crate::pointer::invariant::Reference>(candidate: Maybe<'_, Self, A>) -> bool {
222
- let c: Maybe<'_, Self, crate::pointer::invariant::Exclusive> = candidate.into_exclusive_or_pme();
223
- let c: Maybe<'_, $repr, _> = c.transmute::<_, _, (_, (_, (BecauseExclusive, BecauseExclusive)))>();
221
+ fn is_bit_valid(candidate: $crate::Maybe<'_, Self>) -> bool {
224
222
  // SAFETY: This macro ensures that `$repr` and `Self` have the same
225
223
  // size and bit validity. Thus, a bit-valid instance of `$repr` is
226
224
  // also a bit-valid instance of `Self`.
227
- <$repr as TryFromBytes>::is_bit_valid(c)
225
+ <$repr as TryFromBytes>::is_bit_valid(candidate.transmute::<_, _, BecauseImmutable>())
228
226
  }
229
227
  };
230
228
  (
231
229
  @is_bit_valid
232
230
  $(<$tyvar:ident $(: $(? $optbound:ident $(+)?)* $($bound:ident $(+)?)* )?>)?
233
- TryFromBytes for $ty:ty [<$repr:ty>]
234
- ) => {
235
- #[inline]
236
- fn is_bit_valid<A: crate::pointer::invariant::Reference>(candidate: $crate::Maybe<'_, Self, A>) -> bool {
237
- // SAFETY: This macro ensures that `$repr` and `Self` have the same
238
- // size and bit validity. Thus, a bit-valid instance of `$repr` is
239
- // also a bit-valid instance of `Self`.
240
- <$repr as TryFromBytes>::is_bit_valid(candidate.transmute())
241
- }
242
- };
243
- (
244
- @is_bit_valid
245
- $(<$tyvar:ident $(: $(? $optbound:ident $(+)?)* $($bound:ident $(+)?)* )?>)?
246
- $trait:ident for $ty:ty [$($unsafe_cell:ident)? <$repr:ty>]
231
+ $trait:ident for $ty:ty [$repr:ty]
247
232
  ) => {
248
233
  // Trait other than `TryFromBytes`; no `is_bit_valid` impl.
249
234
  };
@@ -732,28 +717,69 @@ macro_rules! define_cast {
732
717
  /// # Safety
733
718
  ///
734
719
  /// `T` and `$wrapper<T>` must have the same bit validity, and must have the
735
- /// same size in the sense of `SizeEq`.
720
+ /// same size in the sense of `CastExact` (specifically, both a
721
+ /// `T`-to-`$wrapper<T>` cast and a `$wrapper<T>`-to-`T` cast must be
722
+ /// size-preserving).
736
723
  macro_rules! unsafe_impl_for_transparent_wrapper {
737
724
  ($vis:vis T $(: ?$optbound:ident)? => $wrapper:ident<T>) => {{
738
725
  crate::util::macros::__unsafe();
739
726
 
740
- use crate::pointer::{TransmuteFrom, SizeEq, invariant::Valid};
727
+ use crate::pointer::{TransmuteFrom, cast::{CastExact, TransitiveProject}, SizeEq, invariant::Valid};
728
+ use crate::wrappers::ReadOnly;
741
729
 
742
730
  // SAFETY: The caller promises that `T` and `$wrapper<T>` have the same
743
731
  // bit validity.
744
732
  unsafe impl<T $(: ?$optbound)?> TransmuteFrom<T, Valid, Valid> for $wrapper<T> {}
745
733
  // SAFETY: See previous safety comment.
746
734
  unsafe impl<T $(: ?$optbound)?> TransmuteFrom<$wrapper<T>, Valid, Valid> for T {}
747
- define_cast!(unsafe { $vis CastA<T $(: ?$optbound)? > = T => $wrapper<T> });
748
- // SAFETY: The caller promises that `T` and `$wrapper<T>` satisfy
749
- // `SizeEq`.
750
- unsafe impl<T $(: ?$optbound)?> SizeEq<T> for $wrapper<T> {
751
- type CastFrom = CastA;
735
+ // SAFETY: The caller promises that a `T` to `$wrapper<T>` cast is
736
+ // size-preserving.
737
+ define_cast!(unsafe { $vis CastToWrapper<T $(: ?$optbound)? > = T => $wrapper<T> });
738
+ // SAFETY: The caller promises that a `T` to `$wrapper<T>` cast is
739
+ // size-preserving.
740
+ unsafe impl<T $(: ?$optbound)?> CastExact<T, $wrapper<T>> for CastToWrapper {}
741
+ // SAFETY: The caller promises that a `$wrapper<T>` to `T` cast is
742
+ // size-preserving.
743
+ define_cast!(unsafe { $vis CastFromWrapper<T $(: ?$optbound)? > = $wrapper<T> => T });
744
+ // SAFETY: The caller promises that a `$wrapper<T>` to `T` cast is
745
+ // size-preserving.
746
+ unsafe impl<T $(: ?$optbound)?> CastExact<$wrapper<T>, T> for CastFromWrapper {}
747
+
748
+ impl<T $(: ?$optbound)?> SizeEq<T> for $wrapper<T> {
749
+ type CastFrom = CastToWrapper;
752
750
  }
753
- define_cast!(unsafe { $vis CastB<T $(: ?$optbound)? > = $wrapper<T> => T });
754
- // SAFETY: See previous safety comment.
755
- unsafe impl<T $(: ?$optbound)?> SizeEq<$wrapper<T>> for T {
756
- type CastFrom = CastB;
751
+ impl<T $(: ?$optbound)?> SizeEq<$wrapper<T>> for T {
752
+ type CastFrom = CastFromWrapper;
753
+ }
754
+
755
+ impl<T $(: ?$optbound)?> SizeEq<ReadOnly<T>> for $wrapper<T> {
756
+ type CastFrom = TransitiveProject<
757
+ T,
758
+ <T as SizeEq<ReadOnly<T>>>::CastFrom,
759
+ CastToWrapper,
760
+ >;
761
+ }
762
+ impl<T $(: ?$optbound)?> SizeEq<$wrapper<T>> for ReadOnly<T> {
763
+ type CastFrom = TransitiveProject<
764
+ T,
765
+ CastFromWrapper,
766
+ <ReadOnly<T> as SizeEq<T>>::CastFrom,
767
+ >;
768
+ }
769
+
770
+ impl<T $(: ?$optbound)?> SizeEq<ReadOnly<T>> for ReadOnly<$wrapper<T>> {
771
+ type CastFrom = TransitiveProject<
772
+ $wrapper<T>,
773
+ <$wrapper<T> as SizeEq<ReadOnly<T>>>::CastFrom,
774
+ <ReadOnly<$wrapper<T>> as SizeEq<$wrapper<T>>>::CastFrom,
775
+ >;
776
+ }
777
+ impl<T $(: ?$optbound)?> SizeEq<ReadOnly<$wrapper<T>>> for ReadOnly<T> {
778
+ type CastFrom = TransitiveProject<
779
+ $wrapper<T>,
780
+ <$wrapper<T> as SizeEq<ReadOnly<$wrapper<T>>>>::CastFrom,
781
+ <ReadOnly<T> as SizeEq<$wrapper<T>>>::CastFrom,
782
+ >;
757
783
  }
758
784
  }};
759
785
  }
@@ -763,9 +789,7 @@ macro_rules! impl_transitive_transmute_from {
763
789
  const _: () = {
764
790
  use crate::pointer::{TransmuteFrom, SizeEq, invariant::Valid};
765
791
 
766
- // SAFETY: Since `$u: SizeEq<$t>` and `$v: SizeEq<U>`, this impl is
767
- // transitively sound.
768
- unsafe impl<$($tyvar $(: ?$optbound)?)?> SizeEq<$t> for $v
792
+ impl<$($tyvar $(: ?$optbound)?)?> SizeEq<$t> for $v
769
793
  where
770
794
  $u: SizeEq<$t>,
771
795
  $v: SizeEq<$u>,
@@ -790,119 +814,6 @@ macro_rules! impl_transitive_transmute_from {
790
814
  };
791
815
  }
792
816
 
793
- #[rustfmt::skip]
794
- macro_rules! impl_size_eq {
795
- ($t:ty, $u:ty) => {
796
- const _: () = {
797
- use $crate::{pointer::{cast::CastUnsized, SizeEq}};
798
-
799
- // SAFETY: See inline.
800
- unsafe impl SizeEq<$t> for $u {
801
- type CastFrom = CastUnsized;
802
- }
803
- // SAFETY: See previous safety comment.
804
- unsafe impl SizeEq<$u> for $t {
805
- type CastFrom = CastUnsized;
806
- }
807
- };
808
- };
809
- }
810
-
811
- /// Invokes `$blk` in a context in which `$src<$t>` and `$dst<$u>` implement
812
- /// `SizeEq`.
813
- ///
814
- /// This macro emits code which implements `SizeEq`, and ensures that the impl
815
- /// is sound via PME.
816
- ///
817
- /// # Safety
818
- ///
819
- /// Inside of `$blk`, the caller must only use `$src` and `$dst` as `$src<$t>`
820
- /// and `$dst<$u>`. The caller must not use `$src` or `$dst` to wrap any other
821
- /// types.
822
- macro_rules! unsafe_with_size_eq {
823
- (<$src:ident<$t:ident>, $dst:ident<$u:ident>> $blk:expr) => {{
824
- crate::util::macros::__unsafe();
825
-
826
- use crate::{KnownLayout, pointer::cast::TransitiveProject};
827
-
828
- #[repr(transparent)]
829
- struct $src<T: ?Sized>(T);
830
-
831
- #[repr(transparent)]
832
- struct $dst<U: ?Sized>(U);
833
-
834
- // SAFETY: Since `$src<T>` is a `#[repr(transparent)]` wrapper around
835
- // `T`, it has the same bit validity and size as `T`.
836
- unsafe_impl_for_transparent_wrapper!(T: ?Sized => $src<T>);
837
-
838
- // SAFETY: Since `$dst<T>` is a `#[repr(transparent)]` wrapper around
839
- // `T`, it has the same bit validity and size as `T`.
840
- unsafe_impl_for_transparent_wrapper!(T: ?Sized => $dst<T>);
841
-
842
- // SAFETY: `$src<T>` is a `#[repr(transparent)]` wrapper around `T` with
843
- // no added semantics.
844
- unsafe impl<T: ?Sized> InvariantsEq<$src<T>> for T {}
845
-
846
- // SAFETY: `$dst<T>` is a `#[repr(transparent)]` wrapper around `T` with
847
- // no added semantics.
848
- unsafe impl<T: ?Sized> InvariantsEq<$dst<T>> for T {}
849
-
850
- define_cast!(unsafe { SrcCast<T: ?Sized> = $src<T> => T });
851
- define_cast!(unsafe { DstCast<U: ?Sized> = U => $dst<U> });
852
-
853
- // SAFETY: See inline for the soundness of this impl when
854
- // `CastFrom::project` is actually instantiated (otherwise, PMEs may not
855
- // be triggered).
856
- //
857
- // We manually instantiate `CastFrom::project` below to ensure that this
858
- // PME can be triggered, and the caller promises not to use `$src` and
859
- // `$dst` with any wrapped types other than `$t` and `$u` respectively.
860
- unsafe impl<T: ?Sized, U: ?Sized> SizeEq<$src<T>> for $dst<U>
861
- where
862
- T: KnownLayout<PointerMetadata = usize>,
863
- U: KnownLayout<PointerMetadata = usize>,
864
- {
865
- type CastFrom = TransitiveProject<U, TransitiveProject<
866
- T,
867
- SrcCast,
868
- crate::layout::CastFrom<U>,
869
- >, DstCast>;
870
- }
871
-
872
- // See safety comment on the preceding `unsafe impl` block for an
873
- // explanation of why we need this block.
874
- if 1 == 0 {
875
- use crate::pointer::cast::Project as _;
876
-
877
- let ptr = <$t as KnownLayout>::raw_dangling();
878
- // SAFETY: This call is never executed.
879
- #[allow(unused_unsafe, clippy::missing_transmute_annotations)]
880
- let ptr = unsafe { core::mem::transmute(ptr) };
881
- let _ = <$dst<$u> as SizeEq<$src<$t>>>::CastFrom::project(ptr);
882
- }
883
-
884
- impl_for_transmute_from!(T: ?Sized + TryFromBytes => TryFromBytes for $src<T>[<T>]);
885
- impl_for_transmute_from!(T: ?Sized + FromBytes => FromBytes for $src<T>[<T>]);
886
- impl_for_transmute_from!(T: ?Sized + FromZeros => FromZeros for $src<T>[<T>]);
887
- impl_for_transmute_from!(T: ?Sized + IntoBytes => IntoBytes for $src<T>[<T>]);
888
-
889
- impl_for_transmute_from!(U: ?Sized + TryFromBytes => TryFromBytes for $dst<U>[<U>]);
890
- impl_for_transmute_from!(U: ?Sized + FromBytes => FromBytes for $dst<U>[<U>]);
891
- impl_for_transmute_from!(U: ?Sized + FromZeros => FromZeros for $dst<U>[<U>]);
892
- impl_for_transmute_from!(U: ?Sized + IntoBytes => IntoBytes for $dst<U>[<U>]);
893
-
894
- // SAFETY: `$src<T>` is a `#[repr(transparent)]` wrapper around `T`, and
895
- // so permits interior mutation exactly when `T` does.
896
- unsafe_impl!(T: ?Sized + Immutable => Immutable for $src<T>);
897
-
898
- // SAFETY: `$dst<T>` is a `#[repr(transparent)]` wrapper around `T`, and
899
- // so permits interior mutation exactly when `T` does.
900
- unsafe_impl!(T: ?Sized + Immutable => Immutable for $dst<T>);
901
-
902
- $blk
903
- }};
904
- }
905
-
906
817
  /// A no-op `unsafe fn` for use in macro expansions.
907
818
  ///
908
819
  /// Calling this function in a macro expansion ensures that the macro's caller