html-to-markdown 2.28.1 → 2.28.2

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 (185) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +6 -6
  3. data/README.md +5 -1
  4. data/ext/html-to-markdown-rb/native/Cargo.lock +1694 -0
  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/html-to-markdown-rs/Cargo.toml +1 -1
  8. data/rust-vendor/libc/.cargo-checksum.json +1 -1
  9. data/rust-vendor/libc/.cargo_vcs_info.json +1 -1
  10. data/rust-vendor/libc/CHANGELOG.md +19 -0
  11. data/rust-vendor/libc/Cargo.lock +1 -1
  12. data/rust-vendor/libc/Cargo.toml +1 -1
  13. data/rust-vendor/libc/Cargo.toml.orig +1 -1
  14. data/rust-vendor/libc/build.rs +3 -3
  15. data/rust-vendor/libc/src/fuchsia/mod.rs +2 -0
  16. data/rust-vendor/libc/src/hermit.rs +1 -0
  17. data/rust-vendor/libc/src/lib.rs +1 -0
  18. data/rust-vendor/libc/src/new/linux_uapi/linux/mod.rs +1 -0
  19. data/rust-vendor/libc/src/new/linux_uapi/linux/pidfd.rs +59 -0
  20. data/rust-vendor/libc/src/new/mod.rs +3 -0
  21. data/rust-vendor/libc/src/new/netbsd/sys/file.rs +16 -0
  22. data/rust-vendor/libc/src/new/netbsd/sys/mod.rs +2 -0
  23. data/rust-vendor/libc/src/new/netbsd/sys/socket.rs +44 -0
  24. data/rust-vendor/libc/src/new/qurt/mod.rs +2 -0
  25. data/rust-vendor/libc/src/solid/mod.rs +1 -0
  26. data/rust-vendor/libc/src/switch.rs +1 -0
  27. data/rust-vendor/libc/src/teeos/mod.rs +2 -0
  28. data/rust-vendor/libc/src/trusty.rs +1 -0
  29. data/rust-vendor/libc/src/unix/bsd/apple/b64/mod.rs +1 -0
  30. data/rust-vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs +31 -0
  31. data/rust-vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs +92 -0
  32. data/rust-vendor/libc/src/unix/hurd/mod.rs +1 -0
  33. data/rust-vendor/libc/src/unix/linux_like/linux/gnu/mod.rs +1 -0
  34. data/rust-vendor/libc/src/unix/linux_like/linux/mod.rs +22 -46
  35. data/rust-vendor/libc/src/unix/mod.rs +2 -0
  36. data/rust-vendor/libc/src/unix/newlib/espidf/mod.rs +2 -0
  37. data/rust-vendor/libc/src/unix/redox/mod.rs +2 -2
  38. data/rust-vendor/libc/src/vxworks/mod.rs +46 -0
  39. data/rust-vendor/libc/src/wasi/mod.rs +2 -0
  40. data/rust-vendor/libc/src/windows/mod.rs +2 -0
  41. data/rust-vendor/zerocopy/.cargo-checksum.json +1 -1
  42. data/rust-vendor/zerocopy/.cargo_vcs_info.json +1 -1
  43. data/rust-vendor/zerocopy/Cargo.lock +3 -3
  44. data/rust-vendor/zerocopy/Cargo.toml +178 -4
  45. data/rust-vendor/zerocopy/Cargo.toml.orig +5 -5
  46. data/rust-vendor/zerocopy/benches/formats/coco_dynamic_padding.rs +24 -0
  47. data/rust-vendor/zerocopy/benches/formats/coco_dynamic_size.rs +23 -0
  48. data/rust-vendor/zerocopy/benches/formats/coco_static_size.rs +23 -0
  49. data/rust-vendor/zerocopy/benches/read_from_bytes.rs +7 -0
  50. data/rust-vendor/zerocopy/benches/read_from_bytes.x86-64 +15 -0
  51. data/rust-vendor/zerocopy/benches/read_from_bytes.x86-64.mca +65 -0
  52. data/rust-vendor/zerocopy/benches/read_from_prefix.rs +10 -0
  53. data/rust-vendor/zerocopy/benches/read_from_prefix.x86-64 +14 -0
  54. data/rust-vendor/zerocopy/benches/read_from_prefix.x86-64.mca +63 -0
  55. data/rust-vendor/zerocopy/benches/read_from_suffix.rs +10 -0
  56. data/rust-vendor/zerocopy/benches/read_from_suffix.x86-64 +15 -0
  57. data/rust-vendor/zerocopy/benches/read_from_suffix.x86-64.mca +65 -0
  58. data/rust-vendor/zerocopy/benches/ref_from_bytes_dynamic_padding.rs +7 -0
  59. data/rust-vendor/zerocopy/benches/ref_from_bytes_dynamic_padding.x86-64 +22 -0
  60. data/rust-vendor/zerocopy/benches/ref_from_bytes_dynamic_padding.x86-64.mca +77 -0
  61. data/rust-vendor/zerocopy/benches/ref_from_bytes_dynamic_size.rs +7 -0
  62. data/rust-vendor/zerocopy/benches/ref_from_bytes_dynamic_size.x86-64 +20 -0
  63. data/rust-vendor/zerocopy/benches/ref_from_bytes_dynamic_size.x86-64.mca +75 -0
  64. data/rust-vendor/zerocopy/benches/ref_from_bytes_static_size.rs +7 -0
  65. data/rust-vendor/zerocopy/benches/ref_from_bytes_static_size.x86-64 +8 -0
  66. data/rust-vendor/zerocopy/benches/ref_from_bytes_static_size.x86-64.mca +53 -0
  67. data/rust-vendor/zerocopy/benches/ref_from_bytes_with_elems_dynamic_padding.rs +10 -0
  68. data/rust-vendor/zerocopy/benches/ref_from_bytes_with_elems_dynamic_padding.x86-64 +30 -0
  69. data/rust-vendor/zerocopy/benches/ref_from_bytes_with_elems_dynamic_padding.x86-64.mca +95 -0
  70. data/rust-vendor/zerocopy/benches/ref_from_bytes_with_elems_dynamic_size.rs +10 -0
  71. data/rust-vendor/zerocopy/benches/ref_from_bytes_with_elems_dynamic_size.x86-64 +16 -0
  72. data/rust-vendor/zerocopy/benches/ref_from_bytes_with_elems_dynamic_size.x86-64.mca +65 -0
  73. data/rust-vendor/zerocopy/benches/ref_from_prefix_dynamic_padding.rs +10 -0
  74. data/rust-vendor/zerocopy/benches/ref_from_prefix_dynamic_padding.x86-64 +22 -0
  75. data/rust-vendor/zerocopy/benches/ref_from_prefix_dynamic_padding.x86-64.mca +77 -0
  76. data/rust-vendor/zerocopy/benches/ref_from_prefix_dynamic_size.rs +10 -0
  77. data/rust-vendor/zerocopy/benches/ref_from_prefix_dynamic_size.x86-64 +17 -0
  78. data/rust-vendor/zerocopy/benches/ref_from_prefix_dynamic_size.x86-64.mca +67 -0
  79. data/rust-vendor/zerocopy/benches/ref_from_prefix_static_size.rs +10 -0
  80. data/rust-vendor/zerocopy/benches/ref_from_prefix_static_size.x86-64 +8 -0
  81. data/rust-vendor/zerocopy/benches/ref_from_prefix_static_size.x86-64.mca +53 -0
  82. data/rust-vendor/zerocopy/benches/ref_from_prefix_with_elems_dynamic_padding.rs +13 -0
  83. data/rust-vendor/zerocopy/benches/ref_from_prefix_with_elems_dynamic_padding.x86-64 +35 -0
  84. data/rust-vendor/zerocopy/benches/ref_from_prefix_with_elems_dynamic_padding.x86-64.mca +101 -0
  85. data/rust-vendor/zerocopy/benches/ref_from_prefix_with_elems_dynamic_size.rs +13 -0
  86. data/rust-vendor/zerocopy/benches/ref_from_prefix_with_elems_dynamic_size.x86-64 +22 -0
  87. data/rust-vendor/zerocopy/benches/ref_from_prefix_with_elems_dynamic_size.x86-64.mca +77 -0
  88. data/rust-vendor/zerocopy/benches/ref_from_suffix_dynamic_padding.rs +10 -0
  89. data/rust-vendor/zerocopy/benches/ref_from_suffix_dynamic_padding.x86-64 +23 -0
  90. data/rust-vendor/zerocopy/benches/ref_from_suffix_dynamic_padding.x86-64.mca +79 -0
  91. data/rust-vendor/zerocopy/benches/ref_from_suffix_dynamic_size.rs +10 -0
  92. data/rust-vendor/zerocopy/benches/ref_from_suffix_dynamic_size.x86-64 +13 -0
  93. data/rust-vendor/zerocopy/benches/ref_from_suffix_dynamic_size.x86-64.mca +63 -0
  94. data/rust-vendor/zerocopy/benches/ref_from_suffix_static_size.rs +10 -0
  95. data/rust-vendor/zerocopy/benches/ref_from_suffix_static_size.x86-64 +13 -0
  96. data/rust-vendor/zerocopy/benches/ref_from_suffix_static_size.x86-64.mca +61 -0
  97. data/rust-vendor/zerocopy/benches/ref_from_suffix_with_elems_dynamic_padding.rs +13 -0
  98. data/rust-vendor/zerocopy/benches/ref_from_suffix_with_elems_dynamic_padding.x86-64 +34 -0
  99. data/rust-vendor/zerocopy/benches/ref_from_suffix_with_elems_dynamic_padding.x86-64.mca +99 -0
  100. data/rust-vendor/zerocopy/benches/ref_from_suffix_with_elems_dynamic_size.rs +13 -0
  101. data/rust-vendor/zerocopy/benches/ref_from_suffix_with_elems_dynamic_size.x86-64 +23 -0
  102. data/rust-vendor/zerocopy/benches/ref_from_suffix_with_elems_dynamic_size.x86-64.mca +77 -0
  103. data/rust-vendor/zerocopy/benches/transmute.rs +16 -0
  104. data/rust-vendor/zerocopy/benches/transmute.x86-64 +3 -0
  105. data/rust-vendor/zerocopy/benches/transmute.x86-64.mca +43 -0
  106. data/rust-vendor/zerocopy/benches/transmute_ref_dynamic_size.rs +16 -0
  107. data/rust-vendor/zerocopy/benches/transmute_ref_dynamic_size.x86-64 +4 -0
  108. data/rust-vendor/zerocopy/benches/transmute_ref_dynamic_size.x86-64.mca +45 -0
  109. data/rust-vendor/zerocopy/benches/transmute_ref_static_size.rs +15 -0
  110. data/rust-vendor/zerocopy/benches/transmute_ref_static_size.x86-64 +3 -0
  111. data/rust-vendor/zerocopy/benches/transmute_ref_static_size.x86-64.mca +43 -0
  112. data/rust-vendor/zerocopy/benches/try_read_from_bytes.rs +7 -0
  113. data/rust-vendor/zerocopy/benches/try_read_from_bytes.x86-64 +23 -0
  114. data/rust-vendor/zerocopy/benches/try_read_from_bytes.x86-64.mca +79 -0
  115. data/rust-vendor/zerocopy/benches/try_read_from_prefix.rs +10 -0
  116. data/rust-vendor/zerocopy/benches/try_read_from_prefix.x86-64 +16 -0
  117. data/rust-vendor/zerocopy/benches/try_read_from_prefix.x86-64.mca +67 -0
  118. data/rust-vendor/zerocopy/benches/try_read_from_suffix.rs +10 -0
  119. data/rust-vendor/zerocopy/benches/try_read_from_suffix.x86-64 +18 -0
  120. data/rust-vendor/zerocopy/benches/try_read_from_suffix.x86-64.mca +71 -0
  121. data/rust-vendor/zerocopy/benches/try_ref_from_bytes_dynamic_padding.rs +7 -0
  122. data/rust-vendor/zerocopy/benches/try_ref_from_bytes_dynamic_padding.x86-64 +24 -0
  123. data/rust-vendor/zerocopy/benches/try_ref_from_bytes_dynamic_padding.x86-64.mca +81 -0
  124. data/rust-vendor/zerocopy/benches/try_ref_from_bytes_dynamic_size.rs +7 -0
  125. data/rust-vendor/zerocopy/benches/try_ref_from_bytes_dynamic_size.x86-64 +22 -0
  126. data/rust-vendor/zerocopy/benches/try_ref_from_bytes_dynamic_size.x86-64.mca +79 -0
  127. data/rust-vendor/zerocopy/benches/try_ref_from_bytes_static_size.rs +7 -0
  128. data/rust-vendor/zerocopy/benches/try_ref_from_bytes_static_size.x86-64 +13 -0
  129. data/rust-vendor/zerocopy/benches/try_ref_from_bytes_static_size.x86-64.mca +59 -0
  130. data/rust-vendor/zerocopy/benches/try_ref_from_bytes_with_elems_dynamic_padding.rs +10 -0
  131. data/rust-vendor/zerocopy/benches/try_ref_from_bytes_with_elems_dynamic_padding.x86-64 +36 -0
  132. data/rust-vendor/zerocopy/benches/try_ref_from_bytes_with_elems_dynamic_padding.x86-64.mca +105 -0
  133. data/rust-vendor/zerocopy/benches/try_ref_from_bytes_with_elems_dynamic_size.rs +10 -0
  134. data/rust-vendor/zerocopy/benches/try_ref_from_bytes_with_elems_dynamic_size.x86-64 +18 -0
  135. data/rust-vendor/zerocopy/benches/try_ref_from_bytes_with_elems_dynamic_size.x86-64.mca +69 -0
  136. data/rust-vendor/zerocopy/benches/try_ref_from_prefix_dynamic_padding.rs +10 -0
  137. data/rust-vendor/zerocopy/benches/try_ref_from_prefix_dynamic_padding.x86-64 +29 -0
  138. data/rust-vendor/zerocopy/benches/try_ref_from_prefix_dynamic_padding.x86-64.mca +91 -0
  139. data/rust-vendor/zerocopy/benches/try_ref_from_prefix_dynamic_size.rs +10 -0
  140. data/rust-vendor/zerocopy/benches/try_ref_from_prefix_dynamic_size.x86-64 +22 -0
  141. data/rust-vendor/zerocopy/benches/try_ref_from_prefix_dynamic_size.x86-64.mca +77 -0
  142. data/rust-vendor/zerocopy/benches/try_ref_from_prefix_static_size.rs +10 -0
  143. data/rust-vendor/zerocopy/benches/try_ref_from_prefix_static_size.x86-64 +15 -0
  144. data/rust-vendor/zerocopy/benches/try_ref_from_prefix_static_size.x86-64.mca +63 -0
  145. data/rust-vendor/zerocopy/benches/try_ref_from_prefix_with_elems_dynamic_padding.rs +13 -0
  146. data/rust-vendor/zerocopy/benches/try_ref_from_prefix_with_elems_dynamic_padding.x86-64 +35 -0
  147. data/rust-vendor/zerocopy/benches/try_ref_from_prefix_with_elems_dynamic_padding.x86-64.mca +101 -0
  148. data/rust-vendor/zerocopy/benches/try_ref_from_prefix_with_elems_dynamic_size.rs +13 -0
  149. data/rust-vendor/zerocopy/benches/try_ref_from_prefix_with_elems_dynamic_size.x86-64 +26 -0
  150. data/rust-vendor/zerocopy/benches/try_ref_from_prefix_with_elems_dynamic_size.x86-64.mca +83 -0
  151. data/rust-vendor/zerocopy/benches/try_ref_from_suffix_dynamic_padding.rs +10 -0
  152. data/rust-vendor/zerocopy/benches/try_ref_from_suffix_dynamic_padding.x86-64 +26 -0
  153. data/rust-vendor/zerocopy/benches/try_ref_from_suffix_dynamic_padding.x86-64.mca +85 -0
  154. data/rust-vendor/zerocopy/benches/try_ref_from_suffix_dynamic_size.rs +10 -0
  155. data/rust-vendor/zerocopy/benches/try_ref_from_suffix_dynamic_size.x86-64 +18 -0
  156. data/rust-vendor/zerocopy/benches/try_ref_from_suffix_dynamic_size.x86-64.mca +71 -0
  157. data/rust-vendor/zerocopy/benches/try_ref_from_suffix_static_size.rs +10 -0
  158. data/rust-vendor/zerocopy/benches/try_ref_from_suffix_static_size.x86-64 +16 -0
  159. data/rust-vendor/zerocopy/benches/try_ref_from_suffix_static_size.x86-64.mca +67 -0
  160. data/rust-vendor/zerocopy/benches/try_ref_from_suffix_with_elems_dynamic_padding.rs +13 -0
  161. data/rust-vendor/zerocopy/benches/try_ref_from_suffix_with_elems_dynamic_padding.x86-64 +39 -0
  162. data/rust-vendor/zerocopy/benches/try_ref_from_suffix_with_elems_dynamic_padding.x86-64.mca +109 -0
  163. data/rust-vendor/zerocopy/benches/try_ref_from_suffix_with_elems_dynamic_size.rs +13 -0
  164. data/rust-vendor/zerocopy/benches/try_ref_from_suffix_with_elems_dynamic_size.x86-64 +28 -0
  165. data/rust-vendor/zerocopy/benches/try_ref_from_suffix_with_elems_dynamic_size.x86-64.mca +87 -0
  166. data/rust-vendor/zerocopy/benches/try_transmute.rs +16 -0
  167. data/rust-vendor/zerocopy/benches/try_transmute.x86-64 +9 -0
  168. data/rust-vendor/zerocopy/benches/try_transmute.x86-64.mca +55 -0
  169. data/rust-vendor/zerocopy/benches/try_transmute_ref_dynamic_size.rs +18 -0
  170. data/rust-vendor/zerocopy/benches/try_transmute_ref_dynamic_size.x86-64 +6 -0
  171. data/rust-vendor/zerocopy/benches/try_transmute_ref_dynamic_size.x86-64.mca +49 -0
  172. data/rust-vendor/zerocopy/benches/try_transmute_ref_static_size.rs +17 -0
  173. data/rust-vendor/zerocopy/benches/try_transmute_ref_static_size.x86-64 +5 -0
  174. data/rust-vendor/zerocopy/benches/try_transmute_ref_static_size.x86-64.mca +47 -0
  175. data/rust-vendor/zerocopy/rustdoc/style.css +55 -0
  176. data/rust-vendor/zerocopy/src/lib.rs +331 -0
  177. data/rust-vendor/zerocopy/src/macros.rs +48 -1
  178. data/rust-vendor/zerocopy/src/util/macros.rs +199 -0
  179. data/rust-vendor/zerocopy/tests/codegen.rs +111 -0
  180. data/rust-vendor/zerocopy-derive/.cargo-checksum.json +1 -1
  181. data/rust-vendor/zerocopy-derive/.cargo_vcs_info.json +1 -1
  182. data/rust-vendor/zerocopy-derive/Cargo.lock +1 -1
  183. data/rust-vendor/zerocopy-derive/Cargo.toml +1 -1
  184. data/rust-vendor/zerocopy-derive/Cargo.toml.orig +1 -1
  185. metadata +137 -2
@@ -13,7 +13,7 @@
13
13
  edition = "2021"
14
14
  rust-version = "1.56.0"
15
15
  name = "zerocopy"
16
- version = "0.8.40"
16
+ version = "0.8.42"
17
17
  authors = [
18
18
  "Joshua Liebow-Feeser <joshlf@google.com>",
19
19
  "Jack Wrenn <jswrenn@amazon.com>",
@@ -63,6 +63,8 @@ rustdoc-args = [
63
63
  "--cfg",
64
64
  "doc_cfg",
65
65
  "--generate-link-to-definition",
66
+ "--extend-css",
67
+ "rustdoc/style.css",
66
68
  ]
67
69
 
68
70
  [package.metadata.playground]
@@ -86,6 +88,10 @@ std = ["alloc"]
86
88
  name = "zerocopy"
87
89
  path = "src/lib.rs"
88
90
 
91
+ [[test]]
92
+ name = "codegen"
93
+ path = "tests/codegen.rs"
94
+
89
95
  [[test]]
90
96
  name = "include"
91
97
  path = "tests/include.rs"
@@ -94,8 +100,176 @@ path = "tests/include.rs"
94
100
  name = "ui"
95
101
  path = "tests/ui.rs"
96
102
 
103
+ [[bench]]
104
+ name = "read_from_bytes"
105
+ path = "benches/read_from_bytes.rs"
106
+
107
+ [[bench]]
108
+ name = "read_from_prefix"
109
+ path = "benches/read_from_prefix.rs"
110
+
111
+ [[bench]]
112
+ name = "read_from_suffix"
113
+ path = "benches/read_from_suffix.rs"
114
+
115
+ [[bench]]
116
+ name = "ref_from_bytes_dynamic_padding"
117
+ path = "benches/ref_from_bytes_dynamic_padding.rs"
118
+
119
+ [[bench]]
120
+ name = "ref_from_bytes_dynamic_size"
121
+ path = "benches/ref_from_bytes_dynamic_size.rs"
122
+
123
+ [[bench]]
124
+ name = "ref_from_bytes_static_size"
125
+ path = "benches/ref_from_bytes_static_size.rs"
126
+
127
+ [[bench]]
128
+ name = "ref_from_bytes_with_elems_dynamic_padding"
129
+ path = "benches/ref_from_bytes_with_elems_dynamic_padding.rs"
130
+
131
+ [[bench]]
132
+ name = "ref_from_bytes_with_elems_dynamic_size"
133
+ path = "benches/ref_from_bytes_with_elems_dynamic_size.rs"
134
+
135
+ [[bench]]
136
+ name = "ref_from_prefix_dynamic_padding"
137
+ path = "benches/ref_from_prefix_dynamic_padding.rs"
138
+
139
+ [[bench]]
140
+ name = "ref_from_prefix_dynamic_size"
141
+ path = "benches/ref_from_prefix_dynamic_size.rs"
142
+
143
+ [[bench]]
144
+ name = "ref_from_prefix_static_size"
145
+ path = "benches/ref_from_prefix_static_size.rs"
146
+
147
+ [[bench]]
148
+ name = "ref_from_prefix_with_elems_dynamic_padding"
149
+ path = "benches/ref_from_prefix_with_elems_dynamic_padding.rs"
150
+
151
+ [[bench]]
152
+ name = "ref_from_prefix_with_elems_dynamic_size"
153
+ path = "benches/ref_from_prefix_with_elems_dynamic_size.rs"
154
+
155
+ [[bench]]
156
+ name = "ref_from_suffix_dynamic_padding"
157
+ path = "benches/ref_from_suffix_dynamic_padding.rs"
158
+
159
+ [[bench]]
160
+ name = "ref_from_suffix_dynamic_size"
161
+ path = "benches/ref_from_suffix_dynamic_size.rs"
162
+
163
+ [[bench]]
164
+ name = "ref_from_suffix_static_size"
165
+ path = "benches/ref_from_suffix_static_size.rs"
166
+
167
+ [[bench]]
168
+ name = "ref_from_suffix_with_elems_dynamic_padding"
169
+ path = "benches/ref_from_suffix_with_elems_dynamic_padding.rs"
170
+
171
+ [[bench]]
172
+ name = "ref_from_suffix_with_elems_dynamic_size"
173
+ path = "benches/ref_from_suffix_with_elems_dynamic_size.rs"
174
+
175
+ [[bench]]
176
+ name = "transmute"
177
+ path = "benches/transmute.rs"
178
+
179
+ [[bench]]
180
+ name = "transmute_ref_dynamic_size"
181
+ path = "benches/transmute_ref_dynamic_size.rs"
182
+
183
+ [[bench]]
184
+ name = "transmute_ref_static_size"
185
+ path = "benches/transmute_ref_static_size.rs"
186
+
187
+ [[bench]]
188
+ name = "try_read_from_bytes"
189
+ path = "benches/try_read_from_bytes.rs"
190
+
191
+ [[bench]]
192
+ name = "try_read_from_prefix"
193
+ path = "benches/try_read_from_prefix.rs"
194
+
195
+ [[bench]]
196
+ name = "try_read_from_suffix"
197
+ path = "benches/try_read_from_suffix.rs"
198
+
199
+ [[bench]]
200
+ name = "try_ref_from_bytes_dynamic_padding"
201
+ path = "benches/try_ref_from_bytes_dynamic_padding.rs"
202
+
203
+ [[bench]]
204
+ name = "try_ref_from_bytes_dynamic_size"
205
+ path = "benches/try_ref_from_bytes_dynamic_size.rs"
206
+
207
+ [[bench]]
208
+ name = "try_ref_from_bytes_static_size"
209
+ path = "benches/try_ref_from_bytes_static_size.rs"
210
+
211
+ [[bench]]
212
+ name = "try_ref_from_bytes_with_elems_dynamic_padding"
213
+ path = "benches/try_ref_from_bytes_with_elems_dynamic_padding.rs"
214
+
215
+ [[bench]]
216
+ name = "try_ref_from_bytes_with_elems_dynamic_size"
217
+ path = "benches/try_ref_from_bytes_with_elems_dynamic_size.rs"
218
+
219
+ [[bench]]
220
+ name = "try_ref_from_prefix_dynamic_padding"
221
+ path = "benches/try_ref_from_prefix_dynamic_padding.rs"
222
+
223
+ [[bench]]
224
+ name = "try_ref_from_prefix_dynamic_size"
225
+ path = "benches/try_ref_from_prefix_dynamic_size.rs"
226
+
227
+ [[bench]]
228
+ name = "try_ref_from_prefix_static_size"
229
+ path = "benches/try_ref_from_prefix_static_size.rs"
230
+
231
+ [[bench]]
232
+ name = "try_ref_from_prefix_with_elems_dynamic_padding"
233
+ path = "benches/try_ref_from_prefix_with_elems_dynamic_padding.rs"
234
+
235
+ [[bench]]
236
+ name = "try_ref_from_prefix_with_elems_dynamic_size"
237
+ path = "benches/try_ref_from_prefix_with_elems_dynamic_size.rs"
238
+
239
+ [[bench]]
240
+ name = "try_ref_from_suffix_dynamic_padding"
241
+ path = "benches/try_ref_from_suffix_dynamic_padding.rs"
242
+
243
+ [[bench]]
244
+ name = "try_ref_from_suffix_dynamic_size"
245
+ path = "benches/try_ref_from_suffix_dynamic_size.rs"
246
+
247
+ [[bench]]
248
+ name = "try_ref_from_suffix_static_size"
249
+ path = "benches/try_ref_from_suffix_static_size.rs"
250
+
251
+ [[bench]]
252
+ name = "try_ref_from_suffix_with_elems_dynamic_padding"
253
+ path = "benches/try_ref_from_suffix_with_elems_dynamic_padding.rs"
254
+
255
+ [[bench]]
256
+ name = "try_ref_from_suffix_with_elems_dynamic_size"
257
+ path = "benches/try_ref_from_suffix_with_elems_dynamic_size.rs"
258
+
259
+ [[bench]]
260
+ name = "try_transmute"
261
+ path = "benches/try_transmute.rs"
262
+
263
+ [[bench]]
264
+ name = "try_transmute_ref_dynamic_size"
265
+ path = "benches/try_transmute_ref_dynamic_size.rs"
266
+
267
+ [[bench]]
268
+ name = "try_transmute_ref_static_size"
269
+ path = "benches/try_transmute_ref_static_size.rs"
270
+
97
271
  [dependencies.zerocopy-derive]
98
- version = "=0.8.40"
272
+ version = "=0.8.42"
99
273
  optional = true
100
274
 
101
275
  [dev-dependencies.elain]
@@ -116,7 +290,7 @@ version = "1.0"
116
290
  version = "1.1"
117
291
 
118
292
  [dev-dependencies.zerocopy-derive]
119
- version = "=0.8.40"
293
+ version = "=0.8.42"
120
294
 
121
295
  [target."cfg(any())".dependencies.zerocopy-derive]
122
- version = "=0.8.40"
296
+ version = "=0.8.42"
@@ -15,7 +15,7 @@
15
15
  [package]
16
16
  edition = "2021"
17
17
  name = "zerocopy"
18
- version = "0.8.40"
18
+ version = "0.8.42"
19
19
  authors = [
20
20
  "Joshua Liebow-Feeser <joshlf@google.com>",
21
21
  "Jack Wrenn <jswrenn@amazon.com>",
@@ -89,7 +89,7 @@ pinned-nightly = "nightly-2026-01-25"
89
89
 
90
90
  [package.metadata.docs.rs]
91
91
  all-features = true
92
- rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition"]
92
+ rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition", "--extend-css", "rustdoc/style.css"]
93
93
 
94
94
  [package.metadata.playground]
95
95
  features = ["__internal_use_only_features_that_work_on_stable"]
@@ -112,13 +112,13 @@ __internal_use_only_features_that_work_on_stable = [
112
112
  ]
113
113
 
114
114
  [dependencies]
115
- zerocopy-derive = { version = "=0.8.40", path = "zerocopy-derive", optional = true }
115
+ zerocopy-derive = { version = "=0.8.42", path = "zerocopy-derive", optional = true }
116
116
 
117
117
  # The "associated proc macro pattern" ensures that the versions of zerocopy and
118
118
  # zerocopy-derive remain equal, even if the 'derive' feature isn't used.
119
119
  # See: https://github.com/matklad/macro-dep-test
120
120
  [target.'cfg(any())'.dependencies]
121
- zerocopy-derive = { version = "=0.8.40", path = "zerocopy-derive" }
121
+ zerocopy-derive = { version = "=0.8.42", path = "zerocopy-derive" }
122
122
 
123
123
  [dev-dependencies]
124
124
  # FIXME(#381) Remove this dependency once we have our own layout gadgets.
@@ -129,4 +129,4 @@ rustversion = "1.0"
129
129
  static_assertions = "1.1"
130
130
  testutil = { path = "testutil" }
131
131
  # In tests, unlike in production, zerocopy-derive is not optional
132
- zerocopy-derive = { version = "=0.8.40", path = "zerocopy-derive" }
132
+ zerocopy-derive = { version = "=0.8.42", path = "zerocopy-derive" }
@@ -0,0 +1,24 @@
1
+ use zerocopy_derive::*;
2
+
3
+ // The only valid value of this type are the bytes `0xC0C0`.
4
+ #[derive(TryFromBytes, KnownLayout, Immutable)]
5
+ #[repr(u16)]
6
+ pub enum C0C0 {
7
+ _XC0C0 = 0xC0C0,
8
+ }
9
+
10
+ #[derive(FromBytes, KnownLayout, Immutable)]
11
+ #[repr(C, align(4))]
12
+ pub struct Packet<Magic> {
13
+ magic_number: Magic,
14
+ milk: u8,
15
+ mug_size: u8,
16
+ temperature: [u8; 5],
17
+ marshmallows: [[u8; 3]],
18
+ }
19
+
20
+ /// A packet begining with the magic number `0xC0C0`.
21
+ pub type CocoPacket = Packet<C0C0>;
22
+
23
+ /// A packet beginning with any two initialized bytes.
24
+ pub type LocoPacket = Packet<[u8; 2]>;
@@ -0,0 +1,23 @@
1
+ use zerocopy_derive::*;
2
+
3
+ // The only valid value of this type are the bytes `0xC0C0`.
4
+ #[derive(TryFromBytes, KnownLayout, Immutable)]
5
+ #[repr(u16)]
6
+ pub enum C0C0 {
7
+ _XC0C0 = 0xC0C0,
8
+ }
9
+
10
+ #[derive(FromBytes, KnownLayout, Immutable)]
11
+ #[repr(C, align(2))]
12
+ pub struct Packet<Magic> {
13
+ magic_number: Magic,
14
+ mug_size: u8,
15
+ temperature: u8,
16
+ marshmallows: [[u8; 2]],
17
+ }
18
+
19
+ /// A packet begining with the magic number `0xC0C0`.
20
+ pub type CocoPacket = Packet<C0C0>;
21
+
22
+ /// A packet beginning with any two initialized bytes.
23
+ pub type LocoPacket = Packet<[u8; 2]>;
@@ -0,0 +1,23 @@
1
+ use zerocopy_derive::*;
2
+
3
+ // The only valid value of this type are the bytes `0xC0C0`.
4
+ #[derive(TryFromBytes, KnownLayout, Immutable)]
5
+ #[repr(u16)]
6
+ pub enum C0C0 {
7
+ _XC0C0 = 0xC0C0,
8
+ }
9
+
10
+ #[derive(FromBytes, KnownLayout, Immutable)]
11
+ #[repr(C, align(2))]
12
+ pub struct Packet<Magic> {
13
+ magic_number: Magic,
14
+ mug_size: u8,
15
+ temperature: u8,
16
+ marshmallows: [u8; 2],
17
+ }
18
+
19
+ /// A packet begining with the magic number `0xC0C0`.
20
+ pub type CocoPacket = Packet<C0C0>;
21
+
22
+ /// A packet beginning with any two initialized bytes.
23
+ pub type LocoPacket = Packet<[u8; 2]>;
@@ -0,0 +1,7 @@
1
+ #[path = "formats/coco_static_size.rs"]
2
+ mod format;
3
+
4
+ #[unsafe(no_mangle)]
5
+ fn bench_read_from_bytes_static_size(source: &[u8]) -> Option<format::LocoPacket> {
6
+ zerocopy::FromBytes::read_from_bytes(source).ok()
7
+ }
@@ -0,0 +1,15 @@
1
+ bench_read_from_bytes_static_size:
2
+ mov rcx, rsi
3
+ cmp rsi, 6
4
+ jne .LBB5_2
5
+ mov eax, dword ptr [rdi]
6
+ movzx ecx, word ptr [rdi + 4]
7
+ shl rcx, 32
8
+ or rcx, rax
9
+ .LBB5_2:
10
+ shl rcx, 16
11
+ inc rcx
12
+ xor eax, eax
13
+ cmp rsi, 6
14
+ cmove rax, rcx
15
+ ret
@@ -0,0 +1,65 @@
1
+ Iterations: 100
2
+ Instructions: 1300
3
+ Total Cycles: 377
4
+ Total uOps: 1400
5
+
6
+ Dispatch Width: 4
7
+ uOps Per Cycle: 3.71
8
+ IPC: 3.45
9
+ Block RThroughput: 3.5
10
+
11
+
12
+ Instruction Info:
13
+ [1]: #uOps
14
+ [2]: Latency
15
+ [3]: RThroughput
16
+ [4]: MayLoad
17
+ [5]: MayStore
18
+ [6]: HasSideEffects (U)
19
+
20
+ [1] [2] [3] [4] [5] [6] Instructions:
21
+ 1 1 0.33 mov rcx, rsi
22
+ 1 1 0.33 cmp rsi, 6
23
+ 1 1 1.00 jne .LBB5_2
24
+ 1 5 0.50 * mov eax, dword ptr [rdi]
25
+ 1 5 0.50 * movzx ecx, word ptr [rdi + 4]
26
+ 1 1 0.50 shl rcx, 32
27
+ 1 1 0.33 or rcx, rax
28
+ 1 1 0.50 shl rcx, 16
29
+ 1 1 0.33 inc rcx
30
+ 1 0 0.25 xor eax, eax
31
+ 1 1 0.33 cmp rsi, 6
32
+ 2 2 0.67 cmove rax, rcx
33
+ 1 1 1.00 U ret
34
+
35
+
36
+ Resources:
37
+ [0] - SBDivider
38
+ [1] - SBFPDivider
39
+ [2] - SBPort0
40
+ [3] - SBPort1
41
+ [4] - SBPort4
42
+ [5] - SBPort5
43
+ [6.0] - SBPort23
44
+ [6.1] - SBPort23
45
+
46
+
47
+ Resource pressure per iteration:
48
+ [0] [1] [2] [3] [4] [5] [6.0] [6.1]
49
+ - - 3.66 3.67 - 3.67 1.00 1.00
50
+
51
+ Resource pressure by instruction:
52
+ [0] [1] [2] [3] [4] [5] [6.0] [6.1] Instructions:
53
+ - - 0.63 0.36 - 0.01 - - mov rcx, rsi
54
+ - - 0.05 0.05 - 0.90 - - cmp rsi, 6
55
+ - - - - - 1.00 - - jne .LBB5_2
56
+ - - - - - - - 1.00 mov eax, dword ptr [rdi]
57
+ - - - - - - 1.00 - movzx ecx, word ptr [rdi + 4]
58
+ - - 0.97 - - 0.03 - - shl rcx, 32
59
+ - - 0.02 0.35 - 0.63 - - or rcx, rax
60
+ - - 0.98 - - 0.02 - - shl rcx, 16
61
+ - - - 0.98 - 0.02 - - inc rcx
62
+ - - - - - - - - xor eax, eax
63
+ - - 0.03 0.93 - 0.04 - - cmp rsi, 6
64
+ - - 0.98 1.00 - 0.02 - - cmove rax, rcx
65
+ - - - - - 1.00 - - ret
@@ -0,0 +1,10 @@
1
+ #[path = "formats/coco_static_size.rs"]
2
+ mod format;
3
+
4
+ #[unsafe(no_mangle)]
5
+ fn bench_read_from_prefix_static_size(source: &[u8]) -> Option<format::LocoPacket> {
6
+ match zerocopy::FromBytes::read_from_prefix(source) {
7
+ Ok((packet, _rest)) => Some(packet),
8
+ _ => None,
9
+ }
10
+ }
@@ -0,0 +1,14 @@
1
+ bench_read_from_prefix_static_size:
2
+ cmp rsi, 5
3
+ jbe .LBB5_2
4
+ mov eax, dword ptr [rdi]
5
+ movzx edi, word ptr [rdi + 4]
6
+ shl rdi, 32
7
+ or rdi, rax
8
+ .LBB5_2:
9
+ shl rdi, 16
10
+ inc rdi
11
+ xor eax, eax
12
+ cmp rsi, 6
13
+ cmovae rax, rdi
14
+ ret
@@ -0,0 +1,63 @@
1
+ Iterations: 100
2
+ Instructions: 1200
3
+ Total Cycles: 905
4
+ Total uOps: 1300
5
+
6
+ Dispatch Width: 4
7
+ uOps Per Cycle: 1.44
8
+ IPC: 1.33
9
+ Block RThroughput: 3.3
10
+
11
+
12
+ Instruction Info:
13
+ [1]: #uOps
14
+ [2]: Latency
15
+ [3]: RThroughput
16
+ [4]: MayLoad
17
+ [5]: MayStore
18
+ [6]: HasSideEffects (U)
19
+
20
+ [1] [2] [3] [4] [5] [6] Instructions:
21
+ 1 1 0.33 cmp rsi, 5
22
+ 1 1 1.00 jbe .LBB5_2
23
+ 1 5 0.50 * mov eax, dword ptr [rdi]
24
+ 1 5 0.50 * movzx edi, word ptr [rdi + 4]
25
+ 1 1 0.50 shl rdi, 32
26
+ 1 1 0.33 or rdi, rax
27
+ 1 1 0.50 shl rdi, 16
28
+ 1 1 0.33 inc rdi
29
+ 1 0 0.25 xor eax, eax
30
+ 1 1 0.33 cmp rsi, 6
31
+ 2 2 0.67 cmovae rax, rdi
32
+ 1 1 1.00 U ret
33
+
34
+
35
+ Resources:
36
+ [0] - SBDivider
37
+ [1] - SBFPDivider
38
+ [2] - SBPort0
39
+ [3] - SBPort1
40
+ [4] - SBPort4
41
+ [5] - SBPort5
42
+ [6.0] - SBPort23
43
+ [6.1] - SBPort23
44
+
45
+
46
+ Resource pressure per iteration:
47
+ [0] [1] [2] [3] [4] [5] [6.0] [6.1]
48
+ - - 3.32 3.32 - 3.36 1.00 1.00
49
+
50
+ Resource pressure by instruction:
51
+ [0] [1] [2] [3] [4] [5] [6.0] [6.1] Instructions:
52
+ - - 0.05 0.94 - 0.01 - - cmp rsi, 5
53
+ - - - - - 1.00 - - jbe .LBB5_2
54
+ - - - - - - - 1.00 mov eax, dword ptr [rdi]
55
+ - - - - - - 1.00 - movzx edi, word ptr [rdi + 4]
56
+ - - 0.71 - - 0.29 - - shl rdi, 32
57
+ - - - 0.64 - 0.36 - - or rdi, rax
58
+ - - 1.00 - - - - - shl rdi, 16
59
+ - - 0.31 0.40 - 0.29 - - inc rdi
60
+ - - - - - - - - xor eax, eax
61
+ - - 0.34 0.35 - 0.31 - - cmp rsi, 6
62
+ - - 0.91 0.99 - 0.10 - - cmovae rax, rdi
63
+ - - - - - 1.00 - - ret
@@ -0,0 +1,10 @@
1
+ #[path = "formats/coco_static_size.rs"]
2
+ mod format;
3
+
4
+ #[unsafe(no_mangle)]
5
+ fn bench_read_from_suffix_static_size(source: &[u8]) -> Option<format::LocoPacket> {
6
+ match zerocopy::FromBytes::read_from_suffix(source) {
7
+ Ok((_rest, packet)) => Some(packet),
8
+ _ => None,
9
+ }
10
+ }
@@ -0,0 +1,15 @@
1
+ bench_read_from_suffix_static_size:
2
+ mov rcx, rsi
3
+ cmp rsi, 6
4
+ jb .LBB5_2
5
+ mov eax, dword ptr [rdi + rsi - 6]
6
+ movzx ecx, word ptr [rdi + rsi - 2]
7
+ shl rcx, 32
8
+ or rcx, rax
9
+ .LBB5_2:
10
+ shl rcx, 16
11
+ inc rcx
12
+ xor eax, eax
13
+ cmp rsi, 6
14
+ cmovae rax, rcx
15
+ ret
@@ -0,0 +1,65 @@
1
+ Iterations: 100
2
+ Instructions: 1300
3
+ Total Cycles: 377
4
+ Total uOps: 1400
5
+
6
+ Dispatch Width: 4
7
+ uOps Per Cycle: 3.71
8
+ IPC: 3.45
9
+ Block RThroughput: 3.5
10
+
11
+
12
+ Instruction Info:
13
+ [1]: #uOps
14
+ [2]: Latency
15
+ [3]: RThroughput
16
+ [4]: MayLoad
17
+ [5]: MayStore
18
+ [6]: HasSideEffects (U)
19
+
20
+ [1] [2] [3] [4] [5] [6] Instructions:
21
+ 1 1 0.33 mov rcx, rsi
22
+ 1 1 0.33 cmp rsi, 6
23
+ 1 1 1.00 jb .LBB5_2
24
+ 1 5 0.50 * mov eax, dword ptr [rdi + rsi - 6]
25
+ 1 5 0.50 * movzx ecx, word ptr [rdi + rsi - 2]
26
+ 1 1 0.50 shl rcx, 32
27
+ 1 1 0.33 or rcx, rax
28
+ 1 1 0.50 shl rcx, 16
29
+ 1 1 0.33 inc rcx
30
+ 1 0 0.25 xor eax, eax
31
+ 1 1 0.33 cmp rsi, 6
32
+ 2 2 0.67 cmovae rax, rcx
33
+ 1 1 1.00 U ret
34
+
35
+
36
+ Resources:
37
+ [0] - SBDivider
38
+ [1] - SBFPDivider
39
+ [2] - SBPort0
40
+ [3] - SBPort1
41
+ [4] - SBPort4
42
+ [5] - SBPort5
43
+ [6.0] - SBPort23
44
+ [6.1] - SBPort23
45
+
46
+
47
+ Resource pressure per iteration:
48
+ [0] [1] [2] [3] [4] [5] [6.0] [6.1]
49
+ - - 3.66 3.67 - 3.67 1.00 1.00
50
+
51
+ Resource pressure by instruction:
52
+ [0] [1] [2] [3] [4] [5] [6.0] [6.1] Instructions:
53
+ - - 0.63 0.36 - 0.01 - - mov rcx, rsi
54
+ - - 0.05 0.05 - 0.90 - - cmp rsi, 6
55
+ - - - - - 1.00 - - jb .LBB5_2
56
+ - - - - - - - 1.00 mov eax, dword ptr [rdi + rsi - 6]
57
+ - - - - - - 1.00 - movzx ecx, word ptr [rdi + rsi - 2]
58
+ - - 0.97 - - 0.03 - - shl rcx, 32
59
+ - - 0.02 0.35 - 0.63 - - or rcx, rax
60
+ - - 0.98 - - 0.02 - - shl rcx, 16
61
+ - - - 0.98 - 0.02 - - inc rcx
62
+ - - - - - - - - xor eax, eax
63
+ - - 0.03 0.93 - 0.04 - - cmp rsi, 6
64
+ - - 0.98 1.00 - 0.02 - - cmovae rax, rcx
65
+ - - - - - 1.00 - - ret
@@ -0,0 +1,7 @@
1
+ #[path = "formats/coco_dynamic_padding.rs"]
2
+ mod format;
3
+
4
+ #[unsafe(no_mangle)]
5
+ fn bench_ref_from_bytes_dynamic_padding(source: &[u8]) -> Option<&format::LocoPacket> {
6
+ zerocopy::FromBytes::ref_from_bytes(source).ok()
7
+ }
@@ -0,0 +1,22 @@
1
+ bench_ref_from_bytes_dynamic_padding:
2
+ test dil, 3
3
+ jne .LBB5_3
4
+ movabs rax, 9223372036854775804
5
+ and rax, rsi
6
+ cmp rax, 9
7
+ jb .LBB5_3
8
+ add rax, -9
9
+ movabs rcx, -6148914691236517205
10
+ mul rcx
11
+ shr rdx
12
+ lea rax, [rdx + 2*rdx]
13
+ or rax, 3
14
+ add rax, 9
15
+ cmp rsi, rax
16
+ je .LBB5_4
17
+ .LBB5_3:
18
+ xor edi, edi
19
+ mov rdx, rsi
20
+ .LBB5_4:
21
+ mov rax, rdi
22
+ ret