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* (Included in `arbitrary_derive`  1.2.1) Fixed bug in Derive macro around `no_std` path uses [#131](https://github.com/rust-fuzz/arbitrary/pull/131)
24
25### Security
26
27* TODO (or remove section if none)
28
29--------------------------------------------------------------------------------
30
31## 1.2.3
32
33Released 2023-01-20.
34
35### Fixed
36
37* The `derive(Arbitrary)` will now annotate the generated `impl`s with a `#[automatically_derived]`
38  attribute to indicate to e.g. clippy that lints should not fire for the code within the derived
39  implementation.
40
41## 1.2.2
42
43Released 2023-01-03.
44
45### Fixed
46
47* Ensured that `arbitrary` and `derive_arbitrary` versions are synced up so that
48  they don't, e.g., emit generated code that depends on newer versions of
49  `arbitrary` than the one currently in
50  use. [#134](https://github.com/rust-fuzz/arbitrary/issues/134)
51
52## 1.2.1
53
54### Fixed
55
56* Fixed an issue where `std::thread_local!` macro invocations in derive code
57  were not fully prefixed, causing confusing build errors in certain situations.
58
59## 1.2.0
60
61Released 2022-10-20.
62
63### Added
64
65* Support custom arbitrary implementation for fields on
66  derive. [#129](https://github.com/rust-fuzz/arbitrary/pull/129)
67
68--------------------------------------------------------------------------------
69
70## 1.1.6
71
72Released 2022-09-08.
73
74### Fixed
75
76* Fixed a potential panic due to an off-by-one error in the `Arbitrary`
77  implementation for `std::ops::Bound<T>`.
78
79--------------------------------------------------------------------------------
80
81## 1.1.5
82
83Released 2022-09-20.
84
85### Added
86
87* Implemented `Arbitrary` for `std::ops::Bound<T>`.
88
89### Fixed
90
91* Fixed a bug where `Unstructured::int_in_range` could return out-of-range
92  integers when generating arbitrary signed integers.
93
94--------------------------------------------------------------------------------
95
96## 1.1.4
97
98Released 2022-08-29.
99
100### Added
101
102* Implemented `Arbitrary` for `Rc<str>` and `Arc<str>`
103
104### Changed
105
106* Allow overriding the error type in `arbitrary::Result`
107* The `Unstructured::arbitrary_loop` method will consume fewer bytes of input
108  now.
109
110### Fixed
111
112* Fixed a bug where `Unstructured::int_in_range` could return out-of-range
113  integers.
114
115--------------------------------------------------------------------------------
116
117## 1.1.3
118
119Released 2022-06-23.
120
121### Fixed
122
123* Fixed some potential (but highly unlikely) name-clashes inside
124  `derive(Arbitrary)`'s generated
125  code. [#111](https://github.com/rust-fuzz/arbitrary/pull/111)
126* Fixed an edge case where `derive(Arbitrary)` for recursive types that detected
127  an overflow would not reset the overflow
128  detection. [#111](https://github.com/rust-fuzz/arbitrary/pull/111)
129
130--------------------------------------------------------------------------------
131
132## 1.1.2
133
134Released 2022-06-16.
135
136### Fixed
137
138* Fixed a warning inside `derive(Arbitrary)`-generated
139  code. [#110](https://github.com/rust-fuzz/arbitrary/pull/110)
140
141--------------------------------------------------------------------------------
142
143## 1.1.1
144
145Released 2022-06-14.
146
147### Fixed
148
149* Fixed a stack overflow when using `derive(Arbitrary)` with recursive types and
150  empty inputs. [#109](https://github.com/rust-fuzz/arbitrary/pull/109)
151
152--------------------------------------------------------------------------------
153
154## 1.1.0
155
156Released 2022-02-09.
157
158### Added
159
160* Added the `Unstructured::ratio` method to generate a boolean that is `true` at
161  the given rate.
162
163* Added the `Unstructured::arbitrary_loop` method to call a function an
164  arbitrary number of times.
165
166--------------------------------------------------------------------------------
167
168## 1.0.3
169
170Released 2021-11-20.
171
172### Fixed
173
174* Fixed documentation for `Unstructured::fill_bytes`. We forgot to update this
175  way back in [#53](https://github.com/rust-fuzz/arbitrary/pull/53) when the
176  behavior changed.
177
178--------------------------------------------------------------------------------
179
180## 1.0.2
181
182Released 2021-08-25.
183
184### Added
185
186* `Arbitrary` impls for `HashMap`s and `HashSet`s with custom `Hasher`s
187  [#87](https://github.com/rust-fuzz/arbitrary/pull/87)
188
189--------------------------------------------------------------------------------
190
191## 1.0.1
192
193Released 2021-05-20.
194
195### Added
196
197* `Arbitrary` impls for `NonZeroX` types [#79](https://github.com/rust-fuzz/arbitrary/pull/79)
198* `Arbitrary` impls for all arrays using const generics [#55](https://github.com/rust-fuzz/arbitrary/pull/55)
199* `Arbitrary` impls for `Ipv4Addr` and `Ipv6Addr` [#84](https://github.com/rust-fuzz/arbitrary/pull/84)
200
201### Fixed
202
203* Use fewer bytes for `Unstructured::int_in_range()` [#80](https://github.com/rust-fuzz/arbitrary/pull/80)
204* Use correct range for `char` generation [#83](https://github.com/rust-fuzz/arbitrary/pull/83)
205
206--------------------------------------------------------------------------------
207
208## 1.0.0
209
210Released 2020-02-24.
211
212See 1.0.0-rc1 and 1.0.0-rc2 for changes since 0.4.7, which was the last main
213line release.
214
215--------------------------------------------------------------------------------
216
217## 1.0.0-rc2
218
219Released 2021-02-09.
220
221### Added
222
223* The `Arbitrary` trait is now implemented for `&[u8]`. [#67](https://github.com/rust-fuzz/arbitrary/pull/67)
224
225### Changed
226
227* Rename `Unstructured#get_bytes` to `Unstructured#bytes`. [#70](https://github.com/rust-fuzz/arbitrary/pull/70)
228* 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)
229
230--------------------------------------------------------------------------------
231
232## 1.0.0-rc1
233
234Released 2020-11-25.
235
236### Added
237
238* The `Arbitrary` trait is now implemented for `&str`. [#63](https://github.com/rust-fuzz/arbitrary/pull/63)
239
240### Changed
241
242* 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)
243
244### Removed
245
246* The `shrink` method on the `Arbitrary` trait has been removed.
247
248  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.
249
250--------------------------------------------------------------------------------
251
252## 0.4.7
253
254Released 2020-10-14.
255
256### Added
257
258* Added an optimization to avoid unnecessarily consuming bytes from the
259  underlying data when there is only one possible choice in
260  `Unstructured::{int_in_range, choose, etc..}`.
261
262* Added license files to the derive crate.
263
264### Changed
265
266* The `Arbitrary` implementation for `std::time::Duration` should now be faster
267  and produce durations with a more-uniform distribution of nanoseconds.
268
269--------------------------------------------------------------------------------
270
271## 0.4.6
272
273Released 2020-08-22.
274
275### Added
276
277* Added the `Unstructured::peek_bytes` method.
278
279### Changed
280
281* Test case reduction via `cargo fuzz tmin` should be much more effective at
282  reducing the sizes of collections now. (See
283  [#53](https://github.com/rust-fuzz/arbitrary/pull/53) and the commit messages
284  for details.)
285
286* Fuzzing with mutation-based fuzzers (like libFuzzer) should be more efficient
287  now. (See [#53](https://github.com/rust-fuzz/arbitrary/pull/53) and the commit
288  messages for details)
289
290--------------------------------------------------------------------------------
291
292## 0.4.5
293
294Released 2020-06-18.
295
296### Added
297
298* Implement `Arbitrary` for zero length arrays.
299* Implement `Arbitrary` for `Range` and `RangeInclusive`.
300
301--------------------------------------------------------------------------------
302
303## 0.4.4
304
305Released 2020-04-29.
306
307### Fixed
308
309* Fixed the custom derive for enums when used via its full path (like
310  `#[derive(arbitrary::Arbitrary)]` rather than like `#[derive(Arbitrary)]`).
311
312
313## 0.4.3
314
315Released 2020-04-28.
316
317### Fixed
318
319* Fixed the custom derive when used via its full path (like
320  `#[derive(arbitrary::Arbitrary)]` rather than like `#[derive(Arbitrary)]`).
321
322--------------------------------------------------------------------------------
323
324## 0.4.2
325
326Released 2020-04-17.
327
328### Changed
329
330* We forgot to release a new version of the `derive_arbitrary` crate last
331  release. This release fixes that and so the `synstructure` dependency is
332  finally actually removed in the cargo releases.
333
334--------------------------------------------------------------------------------
335
336## 0.4.1
337
338Released 2020-03-18.
339
340### Removed
341
342* Removed an internal dependency on the `synstructure` crate when the `derive`
343  feature is enabled. This should not have any visible downstream effects other
344  than faster build times!
345
346--------------------------------------------------------------------------------
347
348## 0.4.0
349
350Released 2020-01-22.
351
352This is technically a breaking change, but we expect that nearly everyone should
353be able to upgrade without any compilation errors. The only exception is if you
354were implementing the `Arbitrary::size_hint` method by hand. If so, see the
355"changed" section below and the [API docs for
356`Arbitrary::shrink`](https://docs.rs/arbitrary/0.4.0/arbitrary/trait.Arbitrary.html#method.size_hint)
357for details.
358
359### Added
360
361* Added [the `arbitary::size_hint::recursion_guard` helper
362  function][recursion_guard] for guarding against infinite recursion in
363  `size_hint` implementations for recursive types.
364
365### Changed
366
367* The `Arbitrary::size_hint` signature now takes a `depth: usize`
368  parameter. This should be passed along unmodified to any nested calls of other
369  `size_hint` methods. If you're implementing `size_hint` for a recursive type
370  (like a linked list or tree) or a generic type with type parameters, you
371  should use [the new `arbitrary::size_hint::recursion_guard` helper
372  function][recursion_guard].
373
374### Fixed
375
376* Fixed infinite recursion in generated `size_hint` implementations
377  from `#[derive(Arbitrary)]` for recursive types.
378
379[recursion_guard]: https://docs.rs/arbitrary/0.4.0/arbitrary/size_hint/fn.recursion_guard.html
380
381--------------------------------------------------------------------------------
382
383## 0.3.2
384
385Released 2020-01-16.
386
387### Changed
388
389* Updated the custom derive's dependencies.
390
391--------------------------------------------------------------------------------
392
393## 0.3.2
394
395Released 2020-01-15.
396
397### Fixed
398
399* Fixed an over-eager assertion condition in `Unstructured::int_in_range` that
400  would incorrectly trigger when given valid ranges of length one.
401
402--------------------------------------------------------------------------------
403
404## 0.3.1
405
406Released 2020-01-14.
407
408### Fixed
409
410* Fixed some links and version numbers in README.
411
412--------------------------------------------------------------------------------
413
414## 0.3.0
415
416Released 2020-01-14.
417
418### Added
419
420* Added the `"derive"` cargo feature, to enable `#[derive(Arbitrary)]` for
421  custom types. Enabling this feature re-exports functionality from the
422  `derive_arbitrary` crate.
423* The custom derive for `Arbitrary` implements the shrink method for you now.
424* All implementations of `Arbitrary` for `std` types implement shrinking now.
425* Added the `Arbitrary::arbitrary_take_rest` method allows an `Arbitrary`
426  implementation to consume all of the rest of the remaining raw input. It has a
427  default implementation that forwards to `Arbitrary::arbitrary` and the custom
428  derive creates a smart implementation for your custom types.
429* Added the `Arbitrary::size_hint` method for hinting how many raw bytes an
430  implementation needs to construct itself. This has a default implementation,
431  but the custom derive creates a smart implementation for your custom types.
432* Added the `Unstructured::choose` method to choose one thing among a set of
433  choices.
434* Added the `Unstructured::arbitrary_len` method to get an arbitrary length for
435  a collection of some arbitrary type.
436* Added the `Unstructured::arbitrary_iter` method to create an iterator of
437  arbitrary instance of some type.
438
439### Changed
440
441* The `Arbitrary` trait was simplified a bit.
442* `Unstructured` is a concrete type now, not a trait.
443* Switched to Rust 2018 edition.
444
445### Removed
446
447* `RingBuffer` and `FiniteBuffer` are removed. Use `Unstructured` instead.
448
449### Fixed
450
451* Better `Arbitrary` implementation for `char`.
452* Better `Arbitrary` implementation for `String`.
453
454--------------------------------------------------------------------------------
455
456## 0.2.0
457
458--------------------------------------------------------------------------------
459
460## 0.1.0
461