bump-scope 2.2.0

A fast bump allocator that supports allocation scopes / checkpoints. Aka an arena for values of arbitrary types.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.2.0] - 2026-02-26

### Added

- Add `BumpPool::reset_to_start`

### Changed

- Improve documentation of `reset`, `reset_to_start`, `by_value` and crate

## [2.1.0] - 2026-02-19

### Added

- Add `Bump::reset_to_start` to reset the bump allocator without deallocating chunks
- Add `(try_)push_mut(_with)` method to vector types
- Add `(try_)insert_mut` method to vector types

### Changed

- Improve documentation

### Deprecated

- Deprecate `push_with_unchecked`, use `push_unchecked` instead

## [2.0.0] - 2026-02-09

### Added

- Add `claim` api that allows you to enter scopes from a shared reference
- Add `SHRINKS` setting, to toggle shrinking for the allocation api, `DEALLOCATES` no longer affects shrinking
- Add `MINIMUM_CHUNK_SIZE` setting
- Add `(try_)by_value` to turn a `&mut BumpScope` into a `BumpScope`
- Made `scope_guard`, `scoped(_aligned)` available for non-guaranteed-allocated allocators
- Made most of the api of `Bump(Scope)` now also available via traits in the new `traits` module

### Changed

- **Breaking:** Replace generic const parameters with a single `Settings` parameter
- **Breaking:** Change `scoped`, `scoped_aligned` and `aligned` to take a closure with `&mut BumpScope` instead of `BumpScope` (you can get the bump scope by value using `by_value`)
- **Breaking:** Replace allocator settings configuration methods with new `(borrow_(mut_)with_settings` methods
- **Breaking:** Implement `bytemuck` and `zerocopy` allocator extension traits for all `T: BumpAllocatorTypedScope` and name them `BumpAllocatorTypedScopeExt`
- **Breaking:** Rename `reserve_bytes` to `reserve`
- **Breaking:** Move and rename bump allocator traits:
  - `(Mut)BumpAllocator` -> `traits::(Mut)BumpAllocatorCore`
  - `(Mut)BumpAllocatorScope` -> `traits::(Mut)BumpAllocatorCoreScope`
  - `(Mut)BumpAllocatorTypedScopeExt` -> `traits::(Mut)BumpAllocatorTyped`
  - `(Mut)BumpAllocatorScopeExt` -> `traits::(Mut)BumpAllocatorTypedScope`
- **Breaking:** Change `BumpAllocatorCore` trait safety invariants
- **Breaking:** Add `prepare_allocation_rev` and require it for `allocate_prepared_rev`, safety invariants for the prepare allocation api changed
- Change `Default` implementation of `Bump(Scope)`s which are `!GUARANTEED_ALLOCATED` to not allocate
- Remove branch when allocating on a non-guaranteed-allocated `Bump(Scope)`, checking for a layout of `0`
- Depend on `serde_core` instead of `serde`
- Improve documentation

### Removed

- **Breaking:** Remove `into_aligned`, use `with_settings`
- **Breaking:** Remove `as_mut_aligned`, use `borrow_mut_with_settings`
- **Breaking:** Remove `{as, as_mut, into}_guaranteed_allocated`, use `reserve` + `*with_settings`
- **Breaking:** Remove `alloc_layout` (`allocate_layout` provides the same functionality)
- **Breaking:** Remove deprecated api

### Fixed

- **Breaking:** Fix `no_std` builds with "serde" feature by depending on serde without default features
- Fix remaining capacity calculation in `Bump(Scope)::reserve_bytes`

## [1.5.1] - 2025-12-21

### Changed

- Improve documentation

### Fixed

- Fix infinite loop when allocating a new chunk if the current chunk is not the largest by @Grimeh in [#127]

## [1.5.0] - 2025-12-12

### Added

- Add support for `allocator-api2` version `0.4` with a new "allocator-api2-04" feature

## [1.4.2] - 2025-12-08

### Fixed

- Fix compilation failure with `"nightly-allocator-api"` feature due to new `&mut A` where `A: Allocator` blanket impl

## [1.4.1] - 2025-11-22

### Changed

- Improve documentation
- Refactor some internals

## [1.4.0] - 2025-10-05

### Added

- Add `init_move` to `BumpBox<[MaybeUninit<T>]>` to initialize slices with an `OwnedSlice`
- Add `split_off_first` and `split_off_last` to `BumpBox<[T]>`

### Changed

- Improve documentation

## [1.3.1] - 2025-09-14

### Changed

- Improve documentation

## [1.3.0] - 2025-09-08

### Added

- Add `DEALLOCATES` const parameter to toggle deallocation and shrinking
- Better compile error message for macros when "panic-on-alloc" is disabled

### Changed

- Rename `as_aligned_mut` to `as_mut_aligned`, deprecating the old naming

### Fixed

- Implement `NoDrop` for `BumpScope` regardless of `GUARANTEED_ALLOCATED`

## [1.2.1] - 2025-08-20

### Changed

- Improve `BumpAllocatorTypedScopeExt` methods documentation

### Fixed

- Don't shrink `BumpVec` / `BumpString` with a `WithoutShrink` allocator (fixed `BumpAllocator::shrink_slice` to do nothing)

## [1.2.0] - 2025-08-14

### Added

- Add `pool()` method to `BumpPoolGuard` to get its `BumpPool`

### Fixed

- Fix rust-analyzer not showing hints for `BumpPool`

### Deprecated

- Deprecate `pool` field of `BumpPoolGuard`. Changing it can lead to undefined behavior! Use the new `pool()` method instead.


## [1.1.0] - 2025-08-14

### Added

- Document invariant that `shrink`ing a `BumpAllocator` will never error unless the alignment increases
- Add changelog to the crate documentation
- Add `Bump(Scope)::alloc_clone` to clone dynamically sized values into the bump allocator, requires the new "nightly-clone-to-uninit" feature

## [1.0.0] - 2025-08-13

### Added

- **Breaking:** `BumpAllocator` trait family has been reworked:
  - what was `BumpAllocator` is now `BumpAllocatorTypedScopeExt`, same with other traits that have an `*Ext` variant 
  - trait methods become public api
  - `BumpAllocator` becomes a sealed trait
  - `&dyn BumpAllocator` can be used for collections
- Add `Chunk::allocator()` which returns the base allocator
- Make `BumpScope(Guard)(Root)::allocator()` return an `&'a A` allocator instead of `&A`
- Make `BumpScopeGuardRoot::stats()` return `Stats<'a, ...>` instead of `Stats<'_, ...>`
- Relax base allocator trait bounds on `Bump(Scope)` struct and methods
- `alloc_try_with(_mut)` now works for non-GUARANTEED_ALLOCATED `Bump(Scope)`s

### Changed

- **Breaking:** Raise minimum supported rust version to 1.85.1
- **Breaking:** Remove `without_shrink` and `without_dealloc` methods
- **Breaking:** Rename `guaranteed_allocated` to `into_guaranteed_allocated`
- **Breaking:** Rename `guaranteed_allocated_ref` to `as_guaranteed_allocated`
- **Breaking:** Rename `guaranteed_allocated_mut` to `as_mut_guaranteed_allocated`
- **Breaking:** Rename `not_guaranteed_allocated` to `into_not_guaranteed_allocated`
- **Breaking:** Rename `not_guaranteed_allocated_ref` to `as_not_guaranteed_allocated`
- **Breaking:** `guaranteed_allocated` conversion methods now take a closure parameter so you can initialize unallocated `Bump`s with a custom size or capacity
- Improve `Fixed*` collection documentation.
- Improve crate documentation.
- Switch to rust edition 2024

### Fixed

- Fix small amount of wasted space when allocating `Mut*` collections on a downwards bumping allocator
- Fix potential UB when calling `allocator()` on an unallocated `Bump(Scope)`, now `allocator()` returns `Option<&A>` for `!GUARANTEED_ALLOCATED` `Bump(Scope)`s
- Fix allocating a layout of size zero on an unallocated `Bump` resulting in an assertion / potential UB
- Fix resetting an unallocated `Bump` resulting in an assertion / potential UB
- Fix deallocation of an outside object inside an `aligned` / `scoped` / `scoped_aligned` resulting in a misaligned bump position

## [0.17.4] - 2025-07-12

### Added

- Remove `#[cfg(feature = "alloc")]` bound on `BumpBox::into_box`.

### Fixed

- Make `allocator-api2-*` features compile without `alloc` feature.

## [0.17.3] - 2025-07-01

### Added

- Implement `Index(Mut)` for string types ([#78]).
- Implement `Index(Mut)` for `BumpBox<T>` where `T: Index(Mut)` ([#79]).

### Changed

- Improve documentation.

### Fixed

- Fix bad chunk size calculation with base allocators of a high alignment or on platforms with a pointer size of 16, potentially leading to UB.

## [0.17.2] - 2025-06-16

### Changed

- Improve documentation regarding allocator api, hashbrown, benchmarks and `BumpAllocator(Scope)`.

## [0.17.1] - 2025-06-07

### Added

- Add "nightly-dropck-eyepatch" feature to allow box and vectors to store types that don't outlive it. ([#70])

### Changed

- Improve performance of `extend_from_slice_clone`. ([#69])
- Improve documentation.

## [0.17.0] - 2025-05-25

_This release clears out all the blockers that were standing in the way of a 1.0 release. Unless something unexpected comes up 1.0 will be released in the next month. If you've got thoughts, concerns, or suggestions let me know. Feedback is always welcome._

_If you are upgrading: please see [`UPGRADING.md#0.17.0`](UPGRADING.md#0.17.0)._

### Added

- Add `FixedBumpVec::{new, from_capacity_in}`.
- Add `{BumpVec, MutBumpVec, MutBumpVecRev}::from_owned_slice_in`.
- Add `{MutBumpVec, MutBumpVecRev}::from_iter_exact_in`.
- Add `as_non_null` to boxed str and string types.
- Add `AnyStats`, `AnyChunk` and associated types as type erased versions of their non-`Any*` variants.
- Add `Bump(Scope)::alloc_slice_move` to allocate `impl OwnedSlice`s (arrays, `Vec<T>`, `Box<[T]>` and so on).
- Add `BumpBox::as_raw` which returns a pointer to its contents.
- Add `Bump(Scope)::dealloc` to deallocate `BumpBox`es.
- Add "bytemuck" feature that adds extension traits just like "zerocopy-08" does.
- Add "nightly" feature that enables all other "nightly-*" features

### Changed

- **Breaking:** `bump-scope` no longer uses the types and traits from `allocator-api2` but defines its own `Allocator`, `AllocError` and `Global`. (#48)
  - The "allocator-api2-02" feature will make bump allocators implement the `Allocator` trait from `allocator-api2` version `0.2`.
  - The "allocator-api2-03" feature will make bump allocators implement the `Allocator` trait from `allocator-api2` version `0.3`.
  - The "nightly-allocator-api" feature will make bump allocators implement the nightly `Allocator` trait from `core`.
  - Each allocator api feature comes with a compatibility wrapper type in `bump_scope::alloc::compat` to make their `Allocator` implementor implement this crate's `Allocator` and vice versa
- **Breaking:** The `zerocopy` feature has been renamed to `zerocopy-08`. All methods that this feature added are no longer inherent methods but are provided via extension traits from `bump_scope::zerocopy_08`.
- **Breaking:** Change `bump_format!` implementation to not call `$bump.as_scope()` but use `$bump` as is. This is what `mut_bump_format!` and the `bump_vec` macros are already doing.
- **Breaking:** The `stats` method of `BumpAllocator`, strings and vectors return `AnyStats` now instead of `Stats`.
- **Breaking:** Add `A` and `UP` generic parameters to `Stats`, `Chunk` and associated types.
- **Breaking:** `Stats` is no longer re-exported at the crate level, you can import it from `bump_scope::stats::Stats`.

### Deprecated

- Deprecate `FixedBumpVec::EMPTY`, use `FixedBumpVec::new()` instead.
- Deprecate `FixedBumpString::EMPTY`, use `FixedBumpString::new()` instead.
- Deprecate `alloc_fixed_vec`, use `FixedBumpVec::with_capacity_in` instead.
- Deprecate `alloc_fixed_string`, use `FixedBumpString::with_capacity_in` instead.
- Deprecate `alloc_fixed_string`, use `FixedBumpString::with_capacity_in` instead.
- Deprecate `from_array_in`, use `from_owned_slice_in` instead.
- Deprecate renamed `as_non_null_ptr` to `as_non_null`.
- Deprecate `as_non_null_slice`, too niche of an api.
- Deprecate `BumpBox::into_unsized`, use `unsize_bump_box!` instead.
  
### Removed

- **Breaking:** Remove deprecated methods `(try_)extend_from_array`
- **Breaking:** Remove `BumpBox::deallocate_in`, use `Bump(Scope)::dealloc` instead.

### Fixed

- Fix build failing with `serde` feature and without `alloc` feature.
- Fix `Stats` and `Chunk` not reporting accurate sizes and pointers if the base allocator is not zero sized.

## [0.16.5] - 2025-05-09

### Added

- Add `pop_if` method to vector types.
- Implement `Default` for vector and string types.
- Implement `FromIterator` for vector types.

## [0.16.4] - 2025-04-10

### Added

- With the new `"nightly-fn-traits"` feature, `BumpBox<T>` implements the `Fn*` traits if `T` does (just like `Box`). This makes `BumpBox<T: FnOnce + ?Sized>` callable.

## [0.16.3] - 2025-02-21

### Added

- Add `capacity` field to the `Debug` representation of `Stats` and `Bump(Scope(Guard(Root)))`.

## [0.16.2] - 2025-02-21

### Changed

- Simpler and shorter `Debug` output for `Bump(Scope(Guard(Root)))` and `Chunk(NextIter, PrevIter)`.
- Remove `rust-patterns` from `package.categories`, added `no-std::no-alloc`.
- Improve documentation.

## [0.16.1] - 2025-01-22

### Added

- Add `(try_)replace_range` and `as_(mut_)ptr` to strings.

### Changed

- Improve docs somewhat.

### Fixed

- Fix double-dropping elements when calling `into_flattened`

## [0.16.0] - 2025-01-10

### Added

- Add `unsize_bump_box` to unsize `BumpBox`es on stable.

### Changed

- **Breaking:** Replace `OwnedSlice`'s `owned_slice_ptr` method with `owned_slice_ref` which returns a reference instead of a pointer.
- Improve docs for `split_off`.

### Fixed

- Fix `Write` impl for `FixedBumpVec<u8>` not actually writing.

## [0.15.2] - 2025-01-06

### Added

- Implement `Default` for `Stats`, `ChunkPrevIter`, `ChunkNextIter`, `WithoutShrink` and `WithoutDealloc`.

### Fixed

- Fix `append` implementation of `MutBumpVecRev` to now account for `take_owned_slice` panicking.
 
### Changed

- Improve documentation with more examples.

## [0.15.1] - 2025-01-04

### Added

- Implement `TakeOwnedSlice` for `vec::IntoIter` and `vec::Drain`.

### Changed

- Improve speed and time complexity of `split_off`.
- Improve crate docs, docs for owned slice and `split_off`.

## [0.15.0] - 2025-01-02

### Added

- Add new `OwnedSlice` implementations (used for `append`).
- Add `BumpBox<[T; N]>::into_unsized` returning `BumpBox<[T]>`.

### Changed

- **Breaking:** Rename `unchecked_push` to `push_unchecked`.
- **Breaking:** Rename `unchecked_push_with` to `push_with_unchecked`.
- **Breaking:** Redesign `OwnedSlice` trait (used by `append`). 
- **Breaking:** `append` now accepts `alloc::vec::Vec` instead of `allocator_api2::vec::Vec`.
- **Breaking:** Redesign `split_off`. It no longer allocates, but splits in place. It now takes a range parameter instead of a position. Now available for `Fixed*` and `BumpBox<str>`.
- **Breaking:** Add safety condition of splittable memory blocks to `BumpAllocator`.

### Deprecated

- Deprecate `extend_from_array` in favor of `append`.

## [0.14.0] - 2024-12-12

### Added

- **Breaking:** Fix `scoped_aligned`'s closure to take a `BumpScope` with `NEW_MIN_ALIGN` instead of `MIN_ALIGN`.
- **Breaking:** `aligned`'s closure now takes a `BumpScope` with lifetime `'a` instead of `'_`.

### Changed

- Improve documentation.

## [0.13.1] - 2024-11-30

### Changed

- Improve documentation of `Bump` and `BumpScope` and in some other places.

## [0.13.0] - 2024-11-29

### Added

- Implement `core::error::Error` for error types when rust version allows.

### Changed

- **Breaking:** Renamed `stats` method on strings and vectors to `allocator_stats`.

### Removed

- **Breaking:** Remove `"nightly-const-refs-to-static"` feature. `Bump::unallocated` is now automatically const for any rust version since 1.83.
- **Breaking:** Remove `Bump(Scope)`'s `without_dealloc` and `without_shrink`. Use `WithoutDealloc(&bump)` and `WithoutShrink(&bump)` instead.
- **Breaking:** feature gate panicking functions of `(Mut)BumpAllocator` with `"panic-on-alloc"` (those functions are doc hidden for now)

### Fixed

- Fix potential UB in `write_vectored` in pathologic case of `usize` overflow when `bufs` contains a large amount of duplicate `IoSlice`s.

## [0.12.3] - 2024-11-23

### Fixed

- Interior nuls being ignored for `alloc_cstr_fmt_mut` and `MutBumpString::into_cstr` (unsound).

## [0.12.2] - 2024-11-22

### Fixed

- `CStr` now stops at the first nul. Before, interior nuls were ignored (unsound).

## [0.12.1] - 2024-11-21

### Added

- Implement `NoDrop` for `CStr`, `OsStr` and `Path`.
- Add `alloc_cstr`, `alloc_cstr_from_str`, `alloc_cstr_fmt` and `alloc_cstr_fmt_mut`.
- Add `(try_)into_cstr` to `(Mut)BumpString`.

## [0.12.0] - 2024-11-17

### Changed

- Redesigned `OwnedSlice` trait.

## [0.11.1] - 2024-11-17

### Fixed

- Fix double dropping the elements of `MutBumpVec` when growing.

## [0.11.0] - 2024-11-16

### Added

- **Breaking:** Add `"panic-on-alloc"` feature which enables the panicking alloc functions (on by default); if you had `default-features = false` before you might need to enable this feature now.
- **Breaking:** `append` methods now take `impl OwnedSlice<T>` instead
- Add more general `PartialEq` for vectors and strings.
- Add `not_guaranteed_allocated(_ref)` methods on `Bump(Scope)` to turn `GUARANTEED_ALLOCATED` false.
- Add `Bump::(try_)guaranteed_allocated_ref`.

### Changed

- **Breaking:** Vectors and strings now take a single `A` generic parameter instead of the `'b, 'a, A, const MIN_ALIGN: usize, const UP: bool, const GUARANTEED_ALLOCATED: bool` of before.
- **Breaking:** `vec`-like macros now take the bump allocator as is instead of by `$bump.as_scope()`. You will need to change `bump_vec![in bump` to `bump_vec![in &bump` and `bump_vec![in bump` to `bump_vec![in &mut bump` unless those `bump` are already references.
- **Breaking:** `bump` methods on vectors and strings have been renamed to `allocator`, the old `allocator` method which returned the base allocator is gone.
- **Breaking:** `Stats<'a, UP>` is now `Stats<'a, GUARANTEED_ALLOCATED>`
- **Breaking:** Rename `into_guaranteed_allocated` to `guaranteed_allocated`, `as_guaranteed_allocated` to `guaranteed_allocated_ref` and `as_guaranteed_allocated_mut` to `guaranteed_allocated_mut`.
- **Breaking:** Rename `MutBumpVecRev`'s `as_nonnull_ptr` to `as_non_null_ptr` and `as_nonnull_slice` to `as_non_null_slice`.
- **Breaking:** `Chunk`, `ChunkNextIter` and `ChunkPrevIter` have moved to the `stats` module.

### Removed

- **Breaking:** Remove `WithLifetime`.
- **Breaking:** Remove `GuaranteedAllocatedStats` in favor of `Stats<'a, true>`
- **Breaking:** Remove deprecated functions `BumpBox<[u8]>::into_boxed_str(_unchecked)`. Use `BumpBox<str>::from_utf8(_unchecked)` instead.

### Fixed

- `BumpVec::split_off` now retains the capacity of `self` like the docs say.

## [0.10.11] - 2024-11-11

### Added

- Add `map_in_place` to `(Mut)BumpVec`.
- Allow `map_in_place` to ZSTs regardless of alignment.

### Fixed

- Fix divide by zero panic when calling `map_in_place` with a ZST.
- Fix cases where constructing a `FixedBumpVec` of ZSTs resulted in a non-`usize::MAX` capacity.
- Fix potential UB when using `*fill*` or `map_in_place` with a ZST of alignment > 1.

## [0.10.10] - 2024-11-10

### Added

- Add default generic parameters to `BumpPoolGuard`
- Add `(try_)map` to `BumpVec`.
- Add `map_in_place` to `FixedBumpVec` and `BumpBox<[T]>`.

### Fixed

- Fix leaking ZSTs when `(try_)alloc_slice_fill_with` panics.
- Don't allocate when the iterator of `(try_)alloc_iter_exact` panics.

## [0.10.9] - 2024-11-05

### Added

- Add `(try_)get_with_size` and `(try_)get_with_capacity` to `BumpPool`.
- `BumpPoolGuard`'s `pool` field is now `pub`.

## [0.10.8] - 2024-10-30

### Added

- `FromUtf8Error` now implements `Clone`, `PartialEq`, `Eq`, `Display` and `Error`.

## [0.10.7] - 2024-10-30

### Added

- Add minimum capacity when growing vectors and strings (just like `Vec`).
- Add `(try_)from_utf8_lossy_in` for strings.
- Add `(try_)from_utf16(_lossy)_in` for strings.

## [0.10.6] - 2024-10-26

### Added

- Add default generic allocator parameter for `bump_vec::Splice`.

### Fixed

- Fix potential UB when using `BumpVec::splice`.

## [0.10.5] - 2024-10-19

### Added

- Add `splice` to `BumpVec`.
- Add `reserve_exact` to vectors and strings.
- Add `spare_capacity_mut` and `from_iter(_exact)_in` to vectors.

## [0.10.4] - 2024-10-18

### Added

- Increase performance of `(Mut)BumpString::from_str_in`.

## [0.10.3] - 2024-10-15

### Added

- Make `owned_str` module `pub`.

## [0.10.2] - 2024-10-15

### Added

- Add missing string methods to `BumpBox<str>`: `len`, `is_empty`, `set_len`, `retain`, `clear`, `as(_mut)_ptr`, `remove`, `as_mut_bytes`, `from_utf8(_unchecked)`.
- Add string methods `pop`, `truncate`, `retain`, `drain`.
- Make more `len` and `is_empty` methods `const`.
- Add `split_off` to suitable vector and string types.
- Add `reserve` methods to `FixedBumpString`.
- Implement `Default` for `FixedBumpString`.
- Implement `Add<&str>` for `BumpString`.
- Implement `Extend<char>` and `Extend<&char>` for suitable string types.
- Implement `Clone` for `BumpVec` and `BumpString`

### Deprecated

- Deprecate `BumpBox`'s `into_boxed_str(_unchecked)` in favor of `from_utf8(_unchecked)`.

## [0.10.1] - 2024-10-14

### Added

- `MutBumpVecRev::{ append, into_flattened, unchecked_push(_with), as_non_null_{ptr, slice} }`.

### Fixed

- Fix `MutBumpVecRev::extend_from_within_clone` doing nothing for ZSTs.
- Fix potential UB in `MutBumpVecRev::extend_from_slice_clone` when clone panics.

## [0.10.0] - 2024-10-07

### Changed

- **Breaking:** Upgrade `zerocopy` dependency to version `0.8.2`.
- **Breaking:** Remove deprecated methods `FixedBumpVec::{ layout, as_(mut_)boxed_slice }`.

## [0.9.2] - 2024-09-28

### Added

- Remove a duplicate call to `shrink_to_fit` in `alloc_iter` and `alloc_fmt`.

### Deprecated

- Deprecate `FixedBumpVec`'s `layout` and `as(_mut)_boxed_slice`.

## [0.9.1] - 2024-09-23

### Added

- Remove a branch when doing fallible sized allocations like `try_alloc_*` ([#34]).

## [0.9.0] - 2024-09-18

### Added

- Add `from_parts` and `into_parts` to `BumpVec` and `BumpString`.
- Add `FixedBumpString::into_string` which returns a `BumpString`.

### Changed

- **Breaking:** `BumpVec` and `BumpString` now deallocate on drop, and shrink when calling `into_(boxed_)slice`.
- **Breaking:** `BumpVec::into_iter` now returns `bump_vec::IntoIter` which deallocates on drop.
- **Breaking:** `IntoIter`, `Drain` and `ExtractIf` have been moved to the `owned_slice` module.

## [0.8.2] - 2024-09-15

### Added

- `NoDrop` blanket impl for `[T]` is more general, replacing `Copy` bound with `NoDrop`

## [0.8.1] - 2024-09-15

### Added

- Implement `NoDrop` for `BumpBox`, `FixedBumpVec`, `FixedBumpString` and `BumpScope`.

## [0.8.0] - 2024-09-03

### Added

- Add `(try_)alloc_try_with_mut` as an optimized version of `(try_)alloc_try_with`.
- `reset_to` now takes a `&self` instead of `&mut self`.

### Changed

- **Breaking:** `(try_)alloc_try_with` now requires a guaranteed allocated `Bump(Scope)`.

### Fixed

- Fix panic message on formatting failure to mention formatting failure, instead of a "capacity overflow".
- Fix `(try_)alloc_try_with` UB when allocating inside the provided closure, memory leak when using an unallocated bump allocator.
- Fix potential UB when using `alloc_iter_mut*` or `MutBump*` collections.
  

## [0.7.0] - 2024-08-31

### Added

- **Breaking:** Allow returning values from closure arguments of `scoped`, `aligned` and `scoped_aligned`.

## [0.6.0] - 2024-08-25

### Changed

- **Breaking:** `(Fixed)BumpString::as_mut_vec` now returns `&mut` as it should instead of `&`.
- **Breaking:** Remove `GUARANTEED_ALLOCATED` parameter from `BumpPool(Guard)`.

### Removed

- **Breaking:** Remove deprecated `(try_)alloc_slice_zeroed` in favor of `(try_)alloc_zeroed_slice`.

## [0.5.9] - 2024-08-25

### Added

- Removed a branch when bumping downwards (#25).

### Fixed

- Fix UB when using a base allocator with an alignment greater than `2 * size_of::<usize>()` ([#32]).

## [0.5.8] - 2024-08-22

### Fixed

- Fix `Mut*` collections' `into(_boxed)_slice` as well as `alloc_iter_mut(_rev)` and `alloc_fmt_mut` to not take up more than the necessary space.

## [0.5.7] - 2024-08-18

### Added

- Add `from_utf8_unchecked` for all string types.
- Add `BumpString::into_fixed_string`.
- Add `BumpBox<[T]>::partition`.

## [0.5.6] - 2024-08-17

### Fixed

- Fix `alloc_iter` and `alloc_fmt` to not take up more than the necessary space.

## [0.5.5] - 2024-07-26

### Fixed

- Fix Rust Analyzer breaking for other structs with a default `Global` allocator parameter.

## [0.5.4] - 2024-07-26

### Fixed

- Fix Rust Analyzer breaking for `Bump`.

## [0.5.3] - 2024-06-28

### Added

- Add `extend_zeroed` for vectors and strings.
- Add `resize_zeroed` for vectors.

## [0.5.2] - 2024-06-09

### Deprecated

- Deprecate `alloc_slice_zeroed` in favor of `alloc_zeroed_slice`.

## [0.5.1] - 2024-06-08

### Added

- `zerocopy` feature that adds `alloc_zeroed`, `alloc_slice_zeroed` and `BumpBox::init_zeroed`.

## [0.5.0] - 2024-05-21

### Added

- Any allocator that implements `Default` can now be used as a base allocator (before it was just `Global`).
- Add `bump` method to `BumpVec` and `BumpString` which returns the bump allocator.
- Add `checkpoint` and `reset_to` to non-`GUARANTEED_ALLOCATED` bump allocators, adds a safety condition to `reset_to`

### Changed

- **Breaking:** `BumpPool::new` is now no longer const, you can the same const constructor with `BumpPool::new_in(Global)`.
- **Breaking:** You can no longer be generic over `GUARANTEED_ALLOCATED` in some ways due to the `BaseAllocator` bound.

## [0.4.0] - 2024-05-19

### Added

- `impl From<GuaranteedAllocatedStats> for Stats`
- `BumpBox::<[MaybeUninit<T>]>::init_fill_iter`
- `BumpBox::deallocate_in`

### Changed

- **Breaking:** renamed `Stats::to_stats` to `to_guaranteed_stats`

### Removed

- **Breaking:** removed deprecated `BumpBox::into_fixed_vec` and `into_fixed_string`.

## [0.3.1] - 2024-05-01

### Added

- Optimization to not align the bump pointer when the size happens to be a multiple of `MIN_ALIGN` ([#12])

### Fixed

- Fix crash in debug mode when using `alloc_iter_mut(_rev)` or calling `into_(boxed_)slice` on a `MutBumpVec(Rev)` ([#16]).

## [0.3.0] - 2024-04-22

### Added

- Add `guaranteed_allocated_stats` which returns `GuaranteedAllocatedStats`.
- Make `BumpPool::new` `const`.

### Changed

- **Breaking:** renamed `Stats` to `GuaranteedAllocatedStats`
- **Breaking:** renamed `MaybeUnallocatedStats` to `Stats`
- **Breaking:** `stats` now always returns `Stats` and is always available
- **Breaking:** renamed `into_init` and `as_init(_mut)` to `into_guaranteed_allocated` and `as_guaranteed_allocated(_mut)`

## [0.2.1] - 2024-04-21

### Fixed

- Fixed docs and changelog.

## [0.2.0] - 2024-04-21

### Added

- `Bump::uninit` to create a `Bump` without allocation (and `const` with feature `nightly-const-refs-to-static`) ([#7]https://github.com/bluurryy/bump-scope/issues/7)

### Changed

- **Breaking:** adds the `INIT` const param to signify whether the bump has an allocated chunk
- **Breaking:** `BumpVec::into_iter` returns `IntoIter<'a, T>` instead of `IntoIter<'b, T>` ([#8]https://github.com/bluurryy/bump-scope/issues/8)

## [0.1.8] - 2024-04-11

### Added

- Add `serde::Serialize` implementations for `BumpBox`, strings and vectors.
- Add `serde::DeserializeSeed` implementations for strings and vectors.

## [0.1.7] - 2024-04-07

### Added

- Add `BumpPool` along with `BumpPoolGuard`.
- Implement `Send` and `Sync` for `BumpBox`, `FixedBumpVec` and `FixedBumpString`.

## [0.1.6] - 2024-04-07

### Fixed

- Fixed ZST allocation with respect to `drop`, `clone` and `default` calls.
- Fixed `alloc_with` and `alloc_slice_fill_with` not calling `f` for ZSTs.

## [0.1.5] - 2024-04-05

### Added

- Add `BumpVec::into_fixed_vec`.
- Add `FixedBumpVec::into_vec`.
- Add fallible `FixedBumpVec` api.
- Add `FixedBumpString`.
- Add `from_init` and `from_uninit` methods for `FixedBumpVec` and `FixedBumpString`.

### Deprecated

- Deprecate `BumpBox::into_fixed_vec` and `BumpBox::into_fixed_string`.

## [0.1.4] - 2024-04-02

### Added

- Add `BumpString::shrink_to_fit`.

## [0.1.3] - 2024-04-02

### Fixed

- Fix `aligned` and `scoped_aligned` not aligning.

## [0.1.2] - 2024-03-29

### Added

- Add `BumpVec::shrink_to_fit`.

### Fixed

- Fix unsoundness when allocating large slices.

## [0.1.1] - 2024-03-28

### Fixed

- Fix `BumpVec` and `BumpString` growing.

## [0.1.0] - 2024-03-28

### Changed

- **Breaking:** `BumpVec` and `BumpString` now take an `&Bump(Scope)`, `MutBumpVec` and `MutBumpString` take a `&mut Bump(Scope)`. ([#3])

## [0.0.1] - 2024-03-27

### Added

- `alloc_iter` and `alloc_fmt` don't require the `alloc` feature anymore.

### Fixed

- Allocating on a downwards `Bump` with a layout of `[u8; 0]` no longer panics.

## [0.0.0] - 2024-03-26

[#127]: https://github.com/bluurryy/bump-scope/pull/127
[#79]: https://github.com/bluurryy/bump-scope/pull/79
[#78]: https://github.com/bluurryy/bump-scope/pull/78
[#70]: https://github.com/bluurryy/bump-scope/pull/70
[#69]: https://github.com/bluurryy/bump-scope/pull/69
[#48]: https://github.com/bluurryy/bump-scope/pull/48
[#34]: https://github.com/bluurryy/bump-scope/pull/34
[#32]: https://github.com/bluurryy/bump-scope/issues/32
[#25]: https://github.com/bluurryy/bump-scope/issues/25
[#16]: https://github.com/bluurryy/bump-scope/issues/16
[#12]: https://github.com/bluurryy/bump-scope/issues/12
[#3]: https://github.com/bluurryy/bump-scope/issues/3

<!-- next-url -->
[Unreleased]: https://github.com/bluurryy/bump-scope/compare/v2.2.0...HEAD
[2.2.0]: https://github.com/bluurryy/bump-scope/releases/tag/v2.2.0
[2.1.0]: https://github.com/bluurryy/bump-scope/releases/tag/v2.1.0
[2.0.0]: https://github.com/bluurryy/bump-scope/releases/tag/v2.0.0
[1.5.1]: https://github.com/bluurryy/bump-scope/releases/tag/v1.5.1
[1.5.0]: https://github.com/bluurryy/bump-scope/releases/tag/v1.5.0
[1.4.2]: https://github.com/bluurryy/bump-scope/releases/tag/v1.4.2
[1.4.1]: https://github.com/bluurryy/bump-scope/releases/tag/v1.4.1
[1.4.0]: https://github.com/bluurryy/bump-scope/releases/tag/v1.4.0
[1.3.1]: https://github.com/bluurryy/bump-scope/releases/tag/v1.3.1
[1.3.0]: https://github.com/bluurryy/bump-scope/releases/tag/v1.3.0
[1.2.1]: https://github.com/bluurryy/bump-scope/releases/tag/v1.2.1
[1.2.0]: https://github.com/bluurryy/bump-scope/releases/tag/v1.2.0
[1.1.0]: https://github.com/bluurryy/bump-scope/releases/tag/v1.1.0
[1.0.0]: https://github.com/bluurryy/bump-scope/releases/tag/v1.0.0
[0.17.4]: https://github.com/bluurryy/bump-scope/releases/tag/v0.17.4
[0.17.3]: https://github.com/bluurryy/bump-scope/releases/tag/v0.17.3
[0.17.2]: https://github.com/bluurryy/bump-scope/releases/tag/v0.17.2
[0.17.1]: https://github.com/bluurryy/bump-scope/releases/tag/v0.17.1
[0.17.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.17.0
[0.16.5]: https://github.com/bluurryy/bump-scope/releases/tag/v0.16.5
[0.16.4]: https://github.com/bluurryy/bump-scope/releases/tag/v0.16.4
[0.16.3]: https://github.com/bluurryy/bump-scope/releases/tag/v0.16.3
[0.16.2]: https://github.com/bluurryy/bump-scope/releases/tag/v0.16.2
[0.16.1]: https://github.com/bluurryy/bump-scope/releases/tag/v0.16.1
[0.16.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.16.0
[0.15.2]: https://github.com/bluurryy/bump-scope/releases/tag/v0.15.2
[0.15.1]: https://github.com/bluurryy/bump-scope/releases/tag/v0.15.1
[0.15.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.15.0
[0.14.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.14.0
[0.13.1]: https://github.com/bluurryy/bump-scope/releases/tag/v0.13.1
[0.13.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.13.0
[0.12.3]: https://github.com/bluurryy/bump-scope/releases/tag/v0.12.3
[0.12.2]: https://github.com/bluurryy/bump-scope/releases/tag/v0.12.2
[0.12.1]: https://github.com/bluurryy/bump-scope/releases/tag/v0.12.1
[0.12.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.12.0
[0.11.1]: https://github.com/bluurryy/bump-scope/releases/tag/v0.11.1
[0.11.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.11.0
[0.10.11]: https://github.com/bluurryy/bump-scope/releases/tag/v0.10.11
[0.10.10]: https://github.com/bluurryy/bump-scope/releases/tag/v0.10.10
[0.10.9]: https://github.com/bluurryy/bump-scope/releases/tag/v0.10.9
[0.10.8]: https://github.com/bluurryy/bump-scope/releases/tag/v0.10.8
[0.10.7]: https://github.com/bluurryy/bump-scope/releases/tag/v0.10.7
[0.10.6]: https://github.com/bluurryy/bump-scope/releases/tag/v0.10.6
[0.10.5]: https://github.com/bluurryy/bump-scope/releases/tag/v0.10.5
[0.10.4]: https://github.com/bluurryy/bump-scope/releases/tag/v0.10.4
[0.10.3]: https://github.com/bluurryy/bump-scope/releases/tag/v0.10.3
[0.10.2]: https://github.com/bluurryy/bump-scope/releases/tag/v0.10.2
[0.10.1]: https://github.com/bluurryy/bump-scope/releases/tag/v0.10.1
[0.10.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.10.0
[0.9.2]: https://github.com/bluurryy/bump-scope/releases/tag/v0.9.2
[0.9.1]: https://github.com/bluurryy/bump-scope/releases/tag/v0.9.1
[0.9.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.9.0
[0.8.2]: https://github.com/bluurryy/bump-scope/releases/tag/v0.8.2
[0.8.1]: https://github.com/bluurryy/bump-scope/releases/tag/v0.8.1
[0.8.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.8.0
[0.7.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.7.0
[0.6.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.6.0
[0.5.9]: https://github.com/bluurryy/bump-scope/releases/tag/v0.5.9
[0.5.8]: https://github.com/bluurryy/bump-scope/releases/tag/v0.5.8
[0.5.7]: https://github.com/bluurryy/bump-scope/releases/tag/v0.5.7
[0.5.6]: https://github.com/bluurryy/bump-scope/releases/tag/v0.5.6
[0.5.5]: https://github.com/bluurryy/bump-scope/releases/tag/v0.5.5
[0.5.4]: https://github.com/bluurryy/bump-scope/releases/tag/v0.5.4
[0.5.3]: https://github.com/bluurryy/bump-scope/releases/tag/v0.5.3
[0.5.2]: https://github.com/bluurryy/bump-scope/releases/tag/v0.5.2
[0.5.1]: https://github.com/bluurryy/bump-scope/releases/tag/v0.5.1
[0.5.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.5.0
[0.4.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.4.0
[0.3.1]: https://github.com/bluurryy/bump-scope/releases/tag/v0.3.1
[0.3.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.3.0
[0.2.1]: https://github.com/bluurryy/bump-scope/releases/tag/v0.2.1
[0.2.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.2.0
[0.1.8]: https://github.com/bluurryy/bump-scope/releases/tag/v0.1.8
[0.1.7]: https://github.com/bluurryy/bump-scope/releases/tag/v0.1.7
[0.1.6]: https://github.com/bluurryy/bump-scope/releases/tag/v0.1.6
[0.1.5]: https://github.com/bluurryy/bump-scope/releases/tag/v0.1.5
[0.1.4]: https://github.com/bluurryy/bump-scope/releases/tag/v0.1.4
[0.1.3]: https://github.com/bluurryy/bump-scope/releases/tag/v0.1.3
[0.1.2]: https://github.com/bluurryy/bump-scope/releases/tag/v0.1.2
[0.1.1]: https://github.com/bluurryy/bump-scope/releases/tag/v0.1.1
[0.1.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.1.0
[0.0.1]: https://github.com/bluurryy/bump-scope/releases/tag/v0.0.1
[0.0.0]: https://github.com/bluurryy/bump-scope/releases/tag/v0.0.0