summaryrefslogtreecommitdiffstats
path: root/vendor/bumpalo
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:19 +0000
commita0b8f38ab54ac451646aa00cd5e91b6c76f22a84 (patch)
treefc451898ccaf445814e26b46664d78702178101d /vendor/bumpalo
parentAdding debian version 1.71.1+dfsg1-2. (diff)
downloadrustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.tar.xz
rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/bumpalo')
-rw-r--r--vendor/bumpalo/.cargo-checksum.json2
-rw-r--r--vendor/bumpalo/CHANGELOG.md31
-rw-r--r--vendor/bumpalo/Cargo.toml8
-rw-r--r--vendor/bumpalo/README.md12
-rwxr-xr-xvendor/bumpalo/src/lib.rs23
5 files changed, 63 insertions, 13 deletions
diff --git a/vendor/bumpalo/.cargo-checksum.json b/vendor/bumpalo/.cargo-checksum.json
index 64cfc40a9..7dc1ed8e3 100644
--- a/vendor/bumpalo/.cargo-checksum.json
+++ b/vendor/bumpalo/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"CHANGELOG.md":"a4add8d9ec2f992a216d354c9272a67831cb52e436abee7dcace2ecf0b5748df","Cargo.toml":"37d412794bd2a4a0e438ffbab3e76bd4a8e63a969e74072fb286035b669749bb","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"65f94e99ddaf4f5d1782a6dae23f35d4293a9a01444a13135a6887017d353cee","README.md":"db3b9ea7989b8d6e1c334c1af4ab3670867cd4327603afebdee4d8415abcfba6","src/alloc.rs":"3a9645d9e8db1f2a8549ee928cafa5263a828f25c88ce4d2b07996ecc14bfa81","src/boxed.rs":"5fc935f8e1a7bc1b8f6a39b2bcc4355a2be4743f2308fe3ffd557455a3a27cb2","src/collections/collect_in.rs":"0588a4ff3967a4323abb4218bbd615af4b123639ab4fae9130c6590c258b3d15","src/collections/mod.rs":"d58dc46eb4f9fcdde574f09bc5b8646f53e42d49c169561d98e0c23e5b36848a","src/collections/raw_vec.rs":"8829cc9a693fde38aa93e47a7bbbc2dac247620d07f60519f2e6cb44f5494bc5","src/collections/str/lossy.rs":"c5d62b16e01071e2a574ae41ef6693ad12f1e6c786c5d38f7a13ebd6cb23c088","src/collections/str/mod.rs":"d82a8bd417fbf52a589d89a16ea2a0ac4f6ac920c3976ab1f5b6ac0c8493c4f2","src/collections/string.rs":"388d39b999788baf5c14ccc3f5cb57da728060ea3295ddfc28f0f2e1ca5858ec","src/collections/vec.rs":"2eaf52e085e6d04767e97b224e82688dd0debd231c6536d6034f431376aa8bf0","src/lib.rs":"3b3cea76afb3befca1163c578d030a07a621b2e4b6d44e988cec57f820ba9818"},"package":"9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8"} \ No newline at end of file
+{"files":{"CHANGELOG.md":"0d910c4e21c0e6cb07753a942af001f0b8b3e34f1c1ad9ae9d0f150351f4ca28","Cargo.toml":"c1473a43df40e39c90e58d0d604279b1958768330b600a1899aebdc1d6162a38","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"65f94e99ddaf4f5d1782a6dae23f35d4293a9a01444a13135a6887017d353cee","README.md":"e5fb332ab51aed303b6c94ebad5c817fd7108285e671e0c4e7d67aa2909cd182","src/alloc.rs":"3a9645d9e8db1f2a8549ee928cafa5263a828f25c88ce4d2b07996ecc14bfa81","src/boxed.rs":"5fc935f8e1a7bc1b8f6a39b2bcc4355a2be4743f2308fe3ffd557455a3a27cb2","src/collections/collect_in.rs":"0588a4ff3967a4323abb4218bbd615af4b123639ab4fae9130c6590c258b3d15","src/collections/mod.rs":"d58dc46eb4f9fcdde574f09bc5b8646f53e42d49c169561d98e0c23e5b36848a","src/collections/raw_vec.rs":"8829cc9a693fde38aa93e47a7bbbc2dac247620d07f60519f2e6cb44f5494bc5","src/collections/str/lossy.rs":"c5d62b16e01071e2a574ae41ef6693ad12f1e6c786c5d38f7a13ebd6cb23c088","src/collections/str/mod.rs":"d82a8bd417fbf52a589d89a16ea2a0ac4f6ac920c3976ab1f5b6ac0c8493c4f2","src/collections/string.rs":"388d39b999788baf5c14ccc3f5cb57da728060ea3295ddfc28f0f2e1ca5858ec","src/collections/vec.rs":"2eaf52e085e6d04767e97b224e82688dd0debd231c6536d6034f431376aa8bf0","src/lib.rs":"0e88d5a3272a4e4f9a94f60824cf9f07ce7fcdfcd4b11794d804c8277cf1d917"},"package":"a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1"} \ No newline at end of file
diff --git a/vendor/bumpalo/CHANGELOG.md b/vendor/bumpalo/CHANGELOG.md
index d7b510f20..969d69c29 100644
--- a/vendor/bumpalo/CHANGELOG.md
+++ b/vendor/bumpalo/CHANGELOG.md
@@ -8,7 +8,6 @@ Released YYYY-MM-DD.
### Changed
-* The minimum supported Rust version (MSRV) is now 1.60.0.
* TODO (or remove section if none)
### Deprecated
@@ -29,6 +28,36 @@ Released YYYY-MM-DD.
--------------------------------------------------------------------------------
+## 3.13.0
+
+Released 2023-05-22.
+
+### Added
+
+* New `"allocator-api2"` feature enables the use of the allocator API on
+ stable. This feature uses a crate that mirrors the API of the unstable Rust
+ `allocator_api` feature. If the feature is enabled, references to `Bump` will
+ implement `allocator_api2::Allocator`. This allows `Bump` to be used as an
+ allocator for collection types from `allocator-api2` and any other crates that
+ support `allocator-api2`.
+
+### Changed
+
+* The minimum supported Rust version (MSRV) is now 1.63.0.
+
+--------------------------------------------------------------------------------
+
+## 3.12.2
+
+Released 2023-05-09.
+
+### Changed
+
+* Added `rust-version` metadata to `Cargo.toml` which helps `cargo` with version
+ resolution.
+
+--------------------------------------------------------------------------------
+
## 3.12.1
Released 2023-04-21.
diff --git a/vendor/bumpalo/Cargo.toml b/vendor/bumpalo/Cargo.toml
index 34f92ad6d..4e6937978 100644
--- a/vendor/bumpalo/Cargo.toml
+++ b/vendor/bumpalo/Cargo.toml
@@ -11,8 +11,9 @@
[package]
edition = "2021"
+rust-version = "1.60.0"
name = "bumpalo"
-version = "3.12.1"
+version = "3.13.0"
authors = ["Nick Fitzgerald <fitzgen@gmail.com>"]
exclude = [
"/.github/*",
@@ -50,6 +51,11 @@ path = "benches/benches.rs"
harness = false
required-features = ["collections"]
+[dependencies.allocator-api2]
+version = "0.2.8"
+optional = true
+default-features = false
+
[dev-dependencies.criterion]
version = "0.3.6"
diff --git a/vendor/bumpalo/README.md b/vendor/bumpalo/README.md
index d0ee1431e..6a83b8c39 100644
--- a/vendor/bumpalo/README.md
+++ b/vendor/bumpalo/README.md
@@ -207,9 +207,17 @@ v.push(2);
[`Allocator`]: https://doc.rust-lang.org/std/alloc/trait.Allocator.html
-#### Minimum Supported Rust Version (MSRV)
+### Using the `Allocator` API on Stable Rust
-This crate is guaranteed to compile on stable Rust **1.60** and up. It might
+You can enable the `allocator_api2` Cargo feature and `bumpalo` will use [the
+`allocator_api2` crate](https://crates.io/crates/allocator-api2) to implement
+the unstable nightly`Allocator` API on stable Rust. This means that
+`bumpalo::Bump` will be usable with any collection that is generic over
+`allocator_api2::Allocator`.
+
+### Minimum Supported Rust Version (MSRV)
+
+This crate is guaranteed to compile on stable Rust **1.63** and up. It might
compile with older versions but that may change in any new patch release.
We reserve the right to increment the MSRV on minor releases, however we will
diff --git a/vendor/bumpalo/src/lib.rs b/vendor/bumpalo/src/lib.rs
index db5d41bbd..c25e03ca3 100755
--- a/vendor/bumpalo/src/lib.rs
+++ b/vendor/bumpalo/src/lib.rs
@@ -2,10 +2,7 @@
#![deny(missing_debug_implementations)]
#![deny(missing_docs)]
#![no_std]
-#![cfg_attr(
- feature = "allocator_api",
- feature(allocator_api, nonnull_slice_from_raw_parts)
-)]
+#![cfg_attr(feature = "allocator_api", feature(allocator_api))]
#[doc(hidden)]
pub extern crate alloc as core_alloc;
@@ -26,9 +23,13 @@ use core::ptr::{self, NonNull};
use core::slice;
use core::str;
use core_alloc::alloc::{alloc, dealloc, Layout};
+
#[cfg(feature = "allocator_api")]
use core_alloc::alloc::{AllocError, Allocator};
+#[cfg(all(feature = "allocator-api2", not(feature = "allocator_api")))]
+use allocator_api2::alloc::{AllocError, Allocator};
+
pub use alloc::AllocErr;
/// An error returned from [`Bump::try_alloc_try_with`].
@@ -1886,11 +1887,13 @@ unsafe impl<'a> alloc::Alloc for &'a Bump {
}
}
-#[cfg(feature = "allocator_api")]
+#[cfg(any(feature = "allocator_api", feature = "allocator-api2"))]
unsafe impl<'a> Allocator for &'a Bump {
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
self.try_alloc_layout(layout)
- .map(|p| NonNull::slice_from_raw_parts(p, layout.size()))
+ .map(|p| unsafe {
+ NonNull::new_unchecked(ptr::slice_from_raw_parts_mut(p.as_ptr(), layout.size()))
+ })
.map_err(|_| AllocError)
}
@@ -1905,7 +1908,9 @@ unsafe impl<'a> Allocator for &'a Bump {
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError> {
Bump::shrink(self, ptr, old_layout, new_layout)
- .map(|p| NonNull::slice_from_raw_parts(p, new_layout.size()))
+ .map(|p| unsafe {
+ NonNull::new_unchecked(ptr::slice_from_raw_parts_mut(p.as_ptr(), new_layout.size()))
+ })
.map_err(|_| AllocError)
}
@@ -1916,7 +1921,9 @@ unsafe impl<'a> Allocator for &'a Bump {
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError> {
Bump::grow(self, ptr, old_layout, new_layout)
- .map(|p| NonNull::slice_from_raw_parts(p, new_layout.size()))
+ .map(|p| unsafe {
+ NonNull::new_unchecked(ptr::slice_from_raw_parts_mut(p.as_ptr(), new_layout.size()))
+ })
.map_err(|_| AllocError)
}