| 1 |
## Unreleased |
| 2 |
|
| 3 |
Released YYYY-MM-DD. |
| 4 |
|
| 5 |
### Added |
| 6 |
|
| 7 |
* TODO (or remove section if none) |
| 8 |
|
| 9 |
### Changed |
| 10 |
|
| 11 |
* TODO (or remove section if none) |
| 12 |
|
| 13 |
### Deprecated |
| 14 |
|
| 15 |
* TODO (or remove section if none) |
| 16 |
|
| 17 |
### Removed |
| 18 |
|
| 19 |
* TODO (or remove section if none) |
| 20 |
|
| 21 |
### Fixed |
| 22 |
|
| 23 |
* TODO (or remove section if none) |
| 24 |
|
| 25 |
### Security |
| 26 |
|
| 27 |
* TODO (or remove section if none) |
| 28 |
|
| 29 |
-------------------------------------------------------------------------------- |
| 30 |
|
| 31 |
## 1.4.2 |
| 32 |
|
| 33 |
Released 2025-08-13. |
| 34 |
|
| 35 |
### Added |
| 36 |
|
| 37 |
* Added formal MSRV policy: "We reserve the right to increment the MSRV on minor |
| 38 |
releases, however we will strive to only do it deliberately and for good |
| 39 |
reasons." The current MSRV is 1.63.0. |
| 40 |
* Added an `Arbitrary` implementation for `core::cmp::Reverse`. |
| 41 |
|
| 42 |
### Changed |
| 43 |
|
| 44 |
* Landed a handful of changes to the code generated by `#[derive(Arbitrary)]` |
| 45 |
that speed up compilation. |
| 46 |
|
| 47 |
### Fixed |
| 48 |
|
| 49 |
* Better documented bias and behavior when running out of entropy, fixed some |
| 50 |
outdated and incorrect docs related to this. |
| 51 |
|
| 52 |
-------------------------------------------------------------------------------- |
| 53 |
|
| 54 |
## 1.4.1 |
| 55 |
|
| 56 |
Released 2024-11-05. |
| 57 |
|
| 58 |
-------------------------------------------------------------------------------- |
| 59 |
|
| 60 |
## 1.4.0 |
| 61 |
|
| 62 |
Released 2024-10-30. |
| 63 |
|
| 64 |
### Added |
| 65 |
|
| 66 |
* Added an `Arbitrary` implementation for `PhantomPinned`. |
| 67 |
* Added the `Unstructured::choose_iter` helper method. |
| 68 |
* Added `#[arbitrary(skip)]` for `enum` variants in the derive macro. |
| 69 |
* Added the `Arbitrary::try_size_hint` trait method. |
| 70 |
|
| 71 |
### Changed |
| 72 |
|
| 73 |
* Implement `Arbitrary` for `PhantomData<A>` even when `A` does not implement |
| 74 |
`Arbitrary` and when `A` is `?Sized`. |
| 75 |
* Make `usize`'s underlying encoding independent of machine word size so that |
| 76 |
corpora are more portable. |
| 77 |
|
| 78 |
### Fixed |
| 79 |
|
| 80 |
* Make `derive(Arbitrary)` work for local definitions of `struct Option`. |
| 81 |
|
| 82 |
-------------------------------------------------------------------------------- |
| 83 |
|
| 84 |
## 1.3.2 |
| 85 |
|
| 86 |
Released 2023-10-30. |
| 87 |
|
| 88 |
### Added |
| 89 |
|
| 90 |
* Added `Arbitrary` implementations for `Arc<[T]>` and |
| 91 |
`Rc<[T]>`. [#160](https://github.com/rust-fuzz/arbitrary/pull/160) |
| 92 |
|
| 93 |
-------------------------------------------------------------------------------- |
| 94 |
|
| 95 |
## 1.3.1 |
| 96 |
|
| 97 |
Released 2023-10-11. |
| 98 |
|
| 99 |
### Fixed |
| 100 |
|
| 101 |
* Fixed an issue with generating collections of collections in |
| 102 |
`arbitrary_take_rest` where `<Vec<Vec<u8>>>::arbitrary_take_rest` would never |
| 103 |
generate `vec![vec![]]` for example. See |
| 104 |
[#159](https://github.com/rust-fuzz/arbitrary/pull/159) for details. |
| 105 |
|
| 106 |
-------------------------------------------------------------------------------- |
| 107 |
|
| 108 |
## 1.3.0 |
| 109 |
|
| 110 |
Released 2023-03-13. |
| 111 |
|
| 112 |
### Added |
| 113 |
|
| 114 |
* Added the ability to manually specify derived trait bounds for |
| 115 |
`Arbitrary`. See [#138](https://github.com/rust-fuzz/arbitrary/pull/138) for |
| 116 |
details. |
| 117 |
|
| 118 |
### Fixed |
| 119 |
|
| 120 |
* Fixed minimal versions correctness for `syn`. |
| 121 |
|
| 122 |
-------------------------------------------------------------------------------- |
| 123 |
|
| 124 |
## 1.2.3 |
| 125 |
|
| 126 |
Released 2023-01-20. |
| 127 |
|
| 128 |
### Fixed |
| 129 |
|
| 130 |
* The `derive(Arbitrary)` will now annotate the generated `impl`s with a `#[automatically_derived]` |
| 131 |
attribute to indicate to e.g. clippy that lints should not fire for the code within the derived |
| 132 |
implementation. |
| 133 |
|
| 134 |
## 1.2.2 |
| 135 |
|
| 136 |
Released 2023-01-03. |
| 137 |
|
| 138 |
### Fixed |
| 139 |
|
| 140 |
* Ensured that `arbitrary` and `derive_arbitrary` versions are synced up so that |
| 141 |
they don't, e.g., emit generated code that depends on newer versions of |
| 142 |
`arbitrary` than the one currently in |
| 143 |
use. [#134](https://github.com/rust-fuzz/arbitrary/issues/134) |
| 144 |
|
| 145 |
## 1.2.1 |
| 146 |
|
| 147 |
### Fixed |
| 148 |
|
| 149 |
* Fixed an issue where `std::thread_local!` macro invocations in derive code |
| 150 |
were not fully prefixed, causing confusing build errors in certain situations. |
| 151 |
|
| 152 |
## 1.2.0 |
| 153 |
|
| 154 |
Released 2022-10-20. |
| 155 |
|
| 156 |
### Added |
| 157 |
|
| 158 |
* Support custom arbitrary implementation for fields on |
| 159 |
derive. [#129](https://github.com/rust-fuzz/arbitrary/pull/129) |
| 160 |
|
| 161 |
-------------------------------------------------------------------------------- |
| 162 |
|
| 163 |
## 1.1.6 |
| 164 |
|
| 165 |
Released 2022-09-20. |
| 166 |
|
| 167 |
### Fixed |
| 168 |
|
| 169 |
* Fixed a potential panic due to an off-by-one error in the `Arbitrary` |
| 170 |
implementation for `std::ops::Bound<T>`. |
| 171 |
|
| 172 |
-------------------------------------------------------------------------------- |
| 173 |
|
| 174 |
## 1.1.5 |
| 175 |
|
| 176 |
Released 2022-09-08. |
| 177 |
|
| 178 |
### Added |
| 179 |
|
| 180 |
* Implemented `Arbitrary` for `std::ops::Bound<T>`. |
| 181 |
|
| 182 |
### Fixed |
| 183 |
|
| 184 |
* Fixed a bug where `Unstructured::int_in_range` could return out-of-range |
| 185 |
integers when generating arbitrary signed integers. |
| 186 |
|
| 187 |
-------------------------------------------------------------------------------- |
| 188 |
|
| 189 |
## 1.1.4 |
| 190 |
|
| 191 |
Released 2022-08-29. |
| 192 |
|
| 193 |
### Added |
| 194 |
|
| 195 |
* Implemented `Arbitrary` for `Rc<str>` and `Arc<str>` |
| 196 |
|
| 197 |
### Changed |
| 198 |
|
| 199 |
* Allow overriding the error type in `arbitrary::Result` |
| 200 |
* The `Unstructured::arbitrary_loop` method will consume fewer bytes of input |
| 201 |
now. |
| 202 |
|
| 203 |
### Fixed |
| 204 |
|
| 205 |
* Fixed a bug where `Unstructured::int_in_range` could return out-of-range |
| 206 |
integers. |
| 207 |
|
| 208 |
-------------------------------------------------------------------------------- |
| 209 |
|
| 210 |
## 1.1.3 |
| 211 |
|
| 212 |
Released 2022-06-23. |
| 213 |
|
| 214 |
### Fixed |
| 215 |
|
| 216 |
* Fixed some potential (but highly unlikely) name-clashes inside |
| 217 |
`derive(Arbitrary)`'s generated |
| 218 |
code. [#111](https://github.com/rust-fuzz/arbitrary/pull/111) |
| 219 |
* Fixed an edge case where `derive(Arbitrary)` for recursive types that detected |
| 220 |
an overflow would not reset the overflow |
| 221 |
detection. [#111](https://github.com/rust-fuzz/arbitrary/pull/111) |
| 222 |
|
| 223 |
-------------------------------------------------------------------------------- |
| 224 |
|
| 225 |
## 1.1.2 |
| 226 |
|
| 227 |
Released 2022-06-16. |
| 228 |
|
| 229 |
### Fixed |
| 230 |
|
| 231 |
* Fixed a warning inside `derive(Arbitrary)`-generated |
| 232 |
code. [#110](https://github.com/rust-fuzz/arbitrary/pull/110) |
| 233 |
|
| 234 |
-------------------------------------------------------------------------------- |
| 235 |
|
| 236 |
## 1.1.1 |
| 237 |
|
| 238 |
Released 2022-06-14. |
| 239 |
|
| 240 |
### Fixed |
| 241 |
|
| 242 |
* Fixed a stack overflow when using `derive(Arbitrary)` with recursive types and |
| 243 |
empty inputs. [#109](https://github.com/rust-fuzz/arbitrary/pull/109) |
| 244 |
|
| 245 |
-------------------------------------------------------------------------------- |
| 246 |
|
| 247 |
## 1.1.0 |
| 248 |
|
| 249 |
Released 2022-02-09. |
| 250 |
|
| 251 |
### Added |
| 252 |
|
| 253 |
* Added the `Unstructured::ratio` method to generate a boolean that is `true` at |
| 254 |
the given rate. |
| 255 |
|
| 256 |
* Added the `Unstructured::arbitrary_loop` method to call a function an |
| 257 |
arbitrary number of times. |
| 258 |
|
| 259 |
-------------------------------------------------------------------------------- |
| 260 |
|
| 261 |
## 1.0.3 |
| 262 |
|
| 263 |
Released 2021-11-20. |
| 264 |
|
| 265 |
### Fixed |
| 266 |
|
| 267 |
* Fixed documentation for `Unstructured::fill_bytes`. We forgot to update this |
| 268 |
way back in [#53](https://github.com/rust-fuzz/arbitrary/pull/53) when the |
| 269 |
behavior changed. |
| 270 |
|
| 271 |
-------------------------------------------------------------------------------- |
| 272 |
|
| 273 |
## 1.0.2 |
| 274 |
|
| 275 |
Released 2021-08-25. |
| 276 |
|
| 277 |
### Added |
| 278 |
|
| 279 |
* `Arbitrary` impls for `HashMap`s and `HashSet`s with custom `Hasher`s |
| 280 |
[#87](https://github.com/rust-fuzz/arbitrary/pull/87) |
| 281 |
|
| 282 |
-------------------------------------------------------------------------------- |
| 283 |
|
| 284 |
## 1.0.1 |
| 285 |
|
| 286 |
Released 2021-05-20. |
| 287 |
|
| 288 |
### Added |
| 289 |
|
| 290 |
* `Arbitrary` impls for `NonZeroX` types [#79](https://github.com/rust-fuzz/arbitrary/pull/79) |
| 291 |
* `Arbitrary` impls for all arrays using const generics [#55](https://github.com/rust-fuzz/arbitrary/pull/55) |
| 292 |
* `Arbitrary` impls for `Ipv4Addr` and `Ipv6Addr` [#84](https://github.com/rust-fuzz/arbitrary/pull/84) |
| 293 |
|
| 294 |
### Fixed |
| 295 |
|
| 296 |
* Use fewer bytes for `Unstructured::int_in_range()` [#80](https://github.com/rust-fuzz/arbitrary/pull/80) |
| 297 |
* Use correct range for `char` generation [#83](https://github.com/rust-fuzz/arbitrary/pull/83) |
| 298 |
|
| 299 |
-------------------------------------------------------------------------------- |
| 300 |
|
| 301 |
## 1.0.0 |
| 302 |
|
| 303 |
Released 2020-02-24. |
| 304 |
|
| 305 |
See 1.0.0-rc1 and 1.0.0-rc2 for changes since 0.4.7, which was the last main |
| 306 |
line release. |
| 307 |
|
| 308 |
-------------------------------------------------------------------------------- |
| 309 |
|
| 310 |
## 1.0.0-rc2 |
| 311 |
|
| 312 |
Released 2021-02-09. |
| 313 |
|
| 314 |
### Added |
| 315 |
|
| 316 |
* The `Arbitrary` trait is now implemented for `&[u8]`. [#67](https://github.com/rust-fuzz/arbitrary/pull/67) |
| 317 |
|
| 318 |
### Changed |
| 319 |
|
| 320 |
* Rename `Unstructured#get_bytes` to `Unstructured#bytes`. [#70](https://github.com/rust-fuzz/arbitrary/pull/70) |
| 321 |
* Passing an empty slice of choices to `Unstructured#choose` returns an error. Previously it would panic. [71](https://github.com/rust-fuzz/arbitrary/pull/71) |
| 322 |
|
| 323 |
-------------------------------------------------------------------------------- |
| 324 |
|
| 325 |
## 1.0.0-rc1 |
| 326 |
|
| 327 |
Released 2020-11-25. |
| 328 |
|
| 329 |
### Added |
| 330 |
|
| 331 |
* The `Arbitrary` trait is now implemented for `&str`. [#63](https://github.com/rust-fuzz/arbitrary/pull/63) |
| 332 |
|
| 333 |
### Changed |
| 334 |
|
| 335 |
* The `Arbitrary` trait now has a lifetime parameter, allowing `Arbitrary` implementations that borrow from the raw input (e.g. the new `&str` implementaton). The `derive(Arbitrary)` macro also supports deriving `Arbitrary` on types with lifetimes now. [#63](https://github.com/rust-fuzz/arbitrary/pull/63) |
| 336 |
|
| 337 |
### Removed |
| 338 |
|
| 339 |
* The `shrink` method on the `Arbitrary` trait has been removed. |
| 340 |
|
| 341 |
We have found that, in practice, using [internal reduction](https://drmaciver.github.io/papers/reduction-via-generation-preview.pdf) via approaches like `cargo fuzz tmin`, where the raw input bytes are reduced rather than the `T: Arbitrary` type constructed from those raw bytes, has the best efficiency-to-maintenance ratio. To the best of our knowledge, no one is relying on or using the `Arbitrary::shrink` method. If you *are* using and relying on the `Arbitrary::shrink` method, please reach out by [dropping a comment here](https://github.com/rust-fuzz/arbitrary/issues/62) and explaining how you're using it and what your use case is. We'll figure out what the best solution is, including potentially adding shrinking functionality back to the `arbitrary` crate. |
| 342 |
|
| 343 |
-------------------------------------------------------------------------------- |
| 344 |
|
| 345 |
## 0.4.7 |
| 346 |
|
| 347 |
Released 2020-10-14. |
| 348 |
|
| 349 |
### Added |
| 350 |
|
| 351 |
* Added an optimization to avoid unnecessarily consuming bytes from the |
| 352 |
underlying data when there is only one possible choice in |
| 353 |
`Unstructured::{int_in_range, choose, etc..}`. |
| 354 |
|
| 355 |
* Added license files to the derive crate. |
| 356 |
|
| 357 |
### Changed |
| 358 |
|
| 359 |
* The `Arbitrary` implementation for `std::time::Duration` should now be faster |
| 360 |
and produce durations with a more-uniform distribution of nanoseconds. |
| 361 |
|
| 362 |
-------------------------------------------------------------------------------- |
| 363 |
|
| 364 |
## 0.4.6 |
| 365 |
|
| 366 |
Released 2020-08-22. |
| 367 |
|
| 368 |
### Added |
| 369 |
|
| 370 |
* Added the `Unstructured::peek_bytes` method. |
| 371 |
|
| 372 |
### Changed |
| 373 |
|
| 374 |
* Test case reduction via `cargo fuzz tmin` should be much more effective at |
| 375 |
reducing the sizes of collections now. (See |
| 376 |
[#53](https://github.com/rust-fuzz/arbitrary/pull/53) and the commit messages |
| 377 |
for details.) |
| 378 |
|
| 379 |
* Fuzzing with mutation-based fuzzers (like libFuzzer) should be more efficient |
| 380 |
now. (See [#53](https://github.com/rust-fuzz/arbitrary/pull/53) and the commit |
| 381 |
messages for details) |
| 382 |
|
| 383 |
-------------------------------------------------------------------------------- |
| 384 |
|
| 385 |
## 0.4.5 |
| 386 |
|
| 387 |
Released 2020-06-18. |
| 388 |
|
| 389 |
### Added |
| 390 |
|
| 391 |
* Implement `Arbitrary` for zero length arrays. |
| 392 |
* Implement `Arbitrary` for `Range` and `RangeInclusive`. |
| 393 |
|
| 394 |
-------------------------------------------------------------------------------- |
| 395 |
|
| 396 |
## 0.4.4 |
| 397 |
|
| 398 |
Released 2020-04-29. |
| 399 |
|
| 400 |
### Fixed |
| 401 |
|
| 402 |
* Fixed the custom derive for enums when used via its full path (like |
| 403 |
`#[derive(arbitrary::Arbitrary)]` rather than like `#[derive(Arbitrary)]`). |
| 404 |
|
| 405 |
|
| 406 |
## 0.4.3 |
| 407 |
|
| 408 |
Released 2020-04-28. |
| 409 |
|
| 410 |
### Fixed |
| 411 |
|
| 412 |
* Fixed the custom derive when used via its full path (like |
| 413 |
`#[derive(arbitrary::Arbitrary)]` rather than like `#[derive(Arbitrary)]`). |
| 414 |
|
| 415 |
-------------------------------------------------------------------------------- |
| 416 |
|
| 417 |
## 0.4.2 |
| 418 |
|
| 419 |
Released 2020-04-17. |
| 420 |
|
| 421 |
### Changed |
| 422 |
|
| 423 |
* We forgot to release a new version of the `derive_arbitrary` crate last |
| 424 |
release. This release fixes that and so the `synstructure` dependency is |
| 425 |
finally actually removed in the cargo releases. |
| 426 |
|
| 427 |
-------------------------------------------------------------------------------- |
| 428 |
|
| 429 |
## 0.4.1 |
| 430 |
|
| 431 |
Released 2020-03-18. |
| 432 |
|
| 433 |
### Removed |
| 434 |
|
| 435 |
* Removed an internal dependency on the `synstructure` crate when the `derive` |
| 436 |
feature is enabled. This should not have any visible downstream effects other |
| 437 |
than faster build times! |
| 438 |
|
| 439 |
-------------------------------------------------------------------------------- |
| 440 |
|
| 441 |
## 0.4.0 |
| 442 |
|
| 443 |
Released 2020-01-22. |
| 444 |
|
| 445 |
This is technically a breaking change, but we expect that nearly everyone should |
| 446 |
be able to upgrade without any compilation errors. The only exception is if you |
| 447 |
were implementing the `Arbitrary::size_hint` method by hand. If so, see the |
| 448 |
"changed" section below and the [API docs for |
| 449 |
`Arbitrary::shrink`](https://docs.rs/arbitrary/0.4.0/arbitrary/trait.Arbitrary.html#method.size_hint) |
| 450 |
for details. |
| 451 |
|
| 452 |
### Added |
| 453 |
|
| 454 |
* Added [the `arbitary::size_hint::recursion_guard` helper |
| 455 |
function][recursion_guard] for guarding against infinite recursion in |
| 456 |
`size_hint` implementations for recursive types. |
| 457 |
|
| 458 |
### Changed |
| 459 |
|
| 460 |
* The `Arbitrary::size_hint` signature now takes a `depth: usize` |
| 461 |
parameter. This should be passed along unmodified to any nested calls of other |
| 462 |
`size_hint` methods. If you're implementing `size_hint` for a recursive type |
| 463 |
(like a linked list or tree) or a generic type with type parameters, you |
| 464 |
should use [the new `arbitrary::size_hint::recursion_guard` helper |
| 465 |
function][recursion_guard]. |
| 466 |
|
| 467 |
### Fixed |
| 468 |
|
| 469 |
* Fixed infinite recursion in generated `size_hint` implementations |
| 470 |
from `#[derive(Arbitrary)]` for recursive types. |
| 471 |
|
| 472 |
[recursion_guard]: https://docs.rs/arbitrary/0.4.0/arbitrary/size_hint/fn.recursion_guard.html |
| 473 |
|
| 474 |
-------------------------------------------------------------------------------- |
| 475 |
|
| 476 |
## 0.3.2 |
| 477 |
|
| 478 |
Released 2020-01-16. |
| 479 |
|
| 480 |
### Changed |
| 481 |
|
| 482 |
* Updated the custom derive's dependencies. |
| 483 |
|
| 484 |
-------------------------------------------------------------------------------- |
| 485 |
|
| 486 |
## 0.3.2 |
| 487 |
|
| 488 |
Released 2020-01-15. |
| 489 |
|
| 490 |
### Fixed |
| 491 |
|
| 492 |
* Fixed an over-eager assertion condition in `Unstructured::int_in_range` that |
| 493 |
would incorrectly trigger when given valid ranges of length one. |
| 494 |
|
| 495 |
-------------------------------------------------------------------------------- |
| 496 |
|
| 497 |
## 0.3.1 |
| 498 |
|
| 499 |
Released 2020-01-14. |
| 500 |
|
| 501 |
### Fixed |
| 502 |
|
| 503 |
* Fixed some links and version numbers in README. |
| 504 |
|
| 505 |
-------------------------------------------------------------------------------- |
| 506 |
|
| 507 |
## 0.3.0 |
| 508 |
|
| 509 |
Released 2020-01-14. |
| 510 |
|
| 511 |
### Added |
| 512 |
|
| 513 |
* Added the `"derive"` cargo feature, to enable `#[derive(Arbitrary)]` for |
| 514 |
custom types. Enabling this feature re-exports functionality from the |
| 515 |
`derive_arbitrary` crate. |
| 516 |
* The custom derive for `Arbitrary` implements the shrink method for you now. |
| 517 |
* All implementations of `Arbitrary` for `std` types implement shrinking now. |
| 518 |
* Added the `Arbitrary::arbitrary_take_rest` method allows an `Arbitrary` |
| 519 |
implementation to consume all of the rest of the remaining raw input. It has a |
| 520 |
default implementation that forwards to `Arbitrary::arbitrary` and the custom |
| 521 |
derive creates a smart implementation for your custom types. |
| 522 |
* Added the `Arbitrary::size_hint` method for hinting how many raw bytes an |
| 523 |
implementation needs to construct itself. This has a default implementation, |
| 524 |
but the custom derive creates a smart implementation for your custom types. |
| 525 |
* Added the `Unstructured::choose` method to choose one thing among a set of |
| 526 |
choices. |
| 527 |
* Added the `Unstructured::arbitrary_len` method to get an arbitrary length for |
| 528 |
a collection of some arbitrary type. |
| 529 |
* Added the `Unstructured::arbitrary_iter` method to create an iterator of |
| 530 |
arbitrary instance of some type. |
| 531 |
|
| 532 |
### Changed |
| 533 |
|
| 534 |
* The `Arbitrary` trait was simplified a bit. |
| 535 |
* `Unstructured` is a concrete type now, not a trait. |
| 536 |
* Switched to Rust 2018 edition. |
| 537 |
|
| 538 |
### Removed |
| 539 |
|
| 540 |
* `RingBuffer` and `FiniteBuffer` are removed. Use `Unstructured` instead. |
| 541 |
|
| 542 |
### Fixed |
| 543 |
|
| 544 |
* Better `Arbitrary` implementation for `char`. |
| 545 |
* Better `Arbitrary` implementation for `String`. |
| 546 |
|
| 547 |
-------------------------------------------------------------------------------- |
| 548 |
|
| 549 |
## 0.2.0 |
| 550 |
|
| 551 |
-------------------------------------------------------------------------------- |
| 552 |
|
| 553 |
## 0.1.0 |