1## Unreleased 2 3Released 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.1.0 32 33Released 2022-02-09. 34 35### Added 36 37* Added the `Unstructured::ratio` method to generate a boolean that is `true` at 38 the given rate. 39 40* Added the `Unstructured::arbitrary_loop` method to call a function an 41 arbitrary number of times. 42 43-------------------------------------------------------------------------------- 44 45## 1.0.3 46 47Released 2021-11-20. 48 49### Fixed 50 51* Fixed documentation for `Unstructured::fill_bytes`. We forgot to update this 52 way back in [#53](https://github.com/rust-fuzz/arbitrary/pull/53) when the 53 behavior changed. 54 55-------------------------------------------------------------------------------- 56 57## 1.0.2 58 59Released 2021-08-25. 60 61### Added 62 63* `Arbitrary` impls for `HashMap`s and `HashSet`s with custom `Hasher`s 64 [#87](https://github.com/rust-fuzz/arbitrary/pull/87) 65 66-------------------------------------------------------------------------------- 67 68## 1.0.1 69 70Released 2021-05-20. 71 72### Added 73 74* `Arbitrary` impls for `NonZeroX` types [#79](https://github.com/rust-fuzz/arbitrary/pull/79) 75* `Arbitrary` impls for all arrays using const generics [#55](https://github.com/rust-fuzz/arbitrary/pull/55) 76* `Arbitrary` impls for `Ipv4Addr` and `Ipv6Addr` [#84](https://github.com/rust-fuzz/arbitrary/pull/84) 77 78### Fixed 79 80* Use fewer bytes for `Unstructured::int_in_range()` [#80](https://github.com/rust-fuzz/arbitrary/pull/80) 81* Use correct range for `char` generation [#83](https://github.com/rust-fuzz/arbitrary/pull/83) 82 83-------------------------------------------------------------------------------- 84 85## 1.0.0 86 87Released 2020-02-24. 88 89See 1.0.0-rc1 and 1.0.0-rc2 for changes since 0.4.7, which was the last main 90line release. 91 92-------------------------------------------------------------------------------- 93 94## 1.0.0-rc2 95 96Released 2021-02-09. 97 98### Added 99 100* The `Arbitrary` trait is now implemented for `&[u8]`. [#67](https://github.com/rust-fuzz/arbitrary/pull/67) 101 102### Changed 103 104* Rename `Unstructured#get_bytes` to `Unstructured#bytes`. [#70](https://github.com/rust-fuzz/arbitrary/pull/70) 105* 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) 106 107-------------------------------------------------------------------------------- 108 109## 1.0.0-rc1 110 111Released 2020-11-25. 112 113### Added 114 115* The `Arbitrary` trait is now implemented for `&str`. [#63](https://github.com/rust-fuzz/arbitrary/pull/63) 116 117### Changed 118 119* 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) 120 121### Removed 122 123* The `shrink` method on the `Arbitrary` trait has been removed. 124 125 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. 126 127-------------------------------------------------------------------------------- 128 129## 0.4.7 130 131Released 2020-10-14. 132 133### Added 134 135* Added an optimization to avoid unnecessarily consuming bytes from the 136 underlying data when there is only one possible choice in 137 `Unstructured::{int_in_range, choose, etc..}`. 138 139* Added license files to the derive crate. 140 141### Changed 142 143* The `Arbitrary` implementation for `std::time::Duration` should now be faster 144 and produce durations with a more-uniform distribution of nanoseconds. 145 146-------------------------------------------------------------------------------- 147 148## 0.4.6 149 150Released 2020-08-22. 151 152### Added 153 154* Added the `Unstructured::peek_bytes` method. 155 156### Changed 157 158* Test case reduction via `cargo fuzz tmin` should be much more effective at 159 reducing the sizes of collections now. (See 160 [#53](https://github.com/rust-fuzz/arbitrary/pull/53) and the commit messages 161 for details.) 162 163* Fuzzing with mutation-based fuzzers (like libFuzzer) should be more efficient 164 now. (See [#53](https://github.com/rust-fuzz/arbitrary/pull/53) and the commit 165 messages for details) 166 167-------------------------------------------------------------------------------- 168 169## 0.4.5 170 171Released 2020-06-18. 172 173### Added 174 175* Implement `Arbitrary` for zero length arrays. 176* Implement `Arbitrary` for `Range` and `RangeInclusive`. 177 178-------------------------------------------------------------------------------- 179 180## 0.4.4 181 182Released 2020-04-29. 183 184### Fixed 185 186* Fixed the custom derive for enums when used via its full path (like 187 `#[derive(arbitrary::Arbitrary)]` rather than like `#[derive(Arbitrary)]`). 188 189 190## 0.4.3 191 192Released 2020-04-28. 193 194### Fixed 195 196* Fixed the custom derive when used via its full path (like 197 `#[derive(arbitrary::Arbitrary)]` rather than like `#[derive(Arbitrary)]`). 198 199-------------------------------------------------------------------------------- 200 201## 0.4.2 202 203Released 2020-04-17. 204 205### Changed 206 207* We forgot to release a new version of the `derive_arbitrary` crate last 208 release. This release fixes that and so the `synstructure` dependency is 209 finally actually removed in the cargo releases. 210 211-------------------------------------------------------------------------------- 212 213## 0.4.1 214 215Released 2020-03-18. 216 217### Removed 218 219* Removed an internal dependency on the `synstructure` crate when the `derive` 220 feature is enabled. This should not have any visible downstream effects other 221 than faster build times! 222 223-------------------------------------------------------------------------------- 224 225## 0.4.0 226 227Released 2020-01-22. 228 229This is technically a breaking change, but we expect that nearly everyone should 230be able to upgrade without any compilation errors. The only exception is if you 231were implementing the `Arbitrary::size_hint` method by hand. If so, see the 232"changed" section below and the [API docs for 233`Arbitrary::shrink`](https://docs.rs/arbitrary/0.4.0/arbitrary/trait.Arbitrary.html#method.size_hint) 234for details. 235 236### Added 237 238* Added [the `arbitary::size_hint::recursion_guard` helper 239 function][recursion_guard] for guarding against infinite recursion in 240 `size_hint` implementations for recursive types. 241 242### Changed 243 244* The `Arbitrary::size_hint` signature now takes a `depth: usize` 245 parameter. This should be passed along unmodified to any nested calls of other 246 `size_hint` methods. If you're implementing `size_hint` for a recursive type 247 (like a linked list or tree) or a generic type with type parameters, you 248 should use [the new `arbitrary::size_hint::recursion_guard` helper 249 function][recursion_guard]. 250 251### Fixed 252 253* Fixed infinite recursion in generated `size_hint` implementations 254 from `#[derive(Arbitrary)]` for recursive types. 255 256[recursion_guard]: https://docs.rs/arbitrary/0.4.0/arbitrary/size_hint/fn.recursion_guard.html 257 258-------------------------------------------------------------------------------- 259 260## 0.3.2 261 262Released 2020-01-16. 263 264### Changed 265 266* Updated the custom derive's dependencies. 267 268-------------------------------------------------------------------------------- 269 270## 0.3.2 271 272Released 2020-01-15. 273 274### Fixed 275 276* Fixed an over-eager assertion condition in `Unstructured::int_in_range` that 277 would incorrectly trigger when given valid ranges of length one. 278 279-------------------------------------------------------------------------------- 280 281## 0.3.1 282 283Released 2020-01-14. 284 285### Fixed 286 287* Fixed some links and version numbers in README. 288 289-------------------------------------------------------------------------------- 290 291## 0.3.0 292 293Released 2020-01-14. 294 295### Added 296 297* Added the `"derive"` cargo feature, to enable `#[derive(Arbitrary)]` for 298 custom types. Enabling this feature re-exports functionality from the 299 `derive_arbitrary` crate. 300* The custom derive for `Arbitrary` implements the shrink method for you now. 301* All implementations of `Arbitrary` for `std` types implement shrinking now. 302* Added the `Arbitrary::arbitrary_take_rest` method allows an `Arbitrary` 303 implementation to consume all of the rest of the remaining raw input. It has a 304 default implementation that forwards to `Arbitrary::arbitrary` and the custom 305 derive creates a smart implementation for your custom types. 306* Added the `Arbitrary::size_hint` method for hinting how many raw bytes an 307 implementation needs to construct itself. This has a default implementation, 308 but the custom derive creates a smart implementation for your custom types. 309* Added the `Unstructured::choose` method to choose one thing among a set of 310 choices. 311* Added the `Unstructured::arbitrary_len` method to get an arbitrary length for 312 a collection of some arbitrary type. 313* Added the `Unstructured::arbitrary_iter` method to create an iterator of 314 arbitrary instance of some type. 315 316### Changed 317 318* The `Arbitrary` trait was simplified a bit. 319* `Unstructured` is a concrete type now, not a trait. 320* Switched to Rust 2018 edition. 321 322### Removed 323 324* `RingBuffer` and `FiniteBuffer` are removed. Use `Unstructured` instead. 325 326### Fixed 327 328* Better `Arbitrary` implementation for `char`. 329* Better `Arbitrary` implementation for `String`. 330 331-------------------------------------------------------------------------------- 332 333## 0.2.0 334 335-------------------------------------------------------------------------------- 336 337## 0.1.0 338