diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
commit | ef24de24a82fe681581cc130f342363c47c0969a (patch) | |
tree | 0d494f7e1a38b95c92426f58fe6eaa877303a86c /vendor/bumpalo | |
parent | Releasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip |
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/bumpalo')
-rw-r--r-- | vendor/bumpalo/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/bumpalo/CHANGELOG.md | 16 | ||||
-rw-r--r-- | vendor/bumpalo/Cargo.toml | 5 | ||||
-rw-r--r-- | vendor/bumpalo/README.md | 11 | ||||
-rw-r--r-- | vendor/bumpalo/src/collections/vec.rs | 22 | ||||
-rwxr-xr-x | vendor/bumpalo/src/lib.rs | 8 |
6 files changed, 53 insertions, 11 deletions
diff --git a/vendor/bumpalo/.cargo-checksum.json b/vendor/bumpalo/.cargo-checksum.json index 7dc1ed8e3..7ed57af10 100644 --- a/vendor/bumpalo/.cargo-checksum.json +++ b/vendor/bumpalo/.cargo-checksum.json @@ -1 +1 @@ -{"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 +{"files":{"CHANGELOG.md":"2f3f6b5ae0beb2a5c97b3271ebd9d758b1f0d1cb303c035864668f7ebce8f66e","Cargo.toml":"0d9e665909b9251cefa7a045467396046b311cd39d67ad665272bc3faaee0b68","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"65f94e99ddaf4f5d1782a6dae23f35d4293a9a01444a13135a6887017d353cee","README.md":"2d137262a09477a0f46cd5383c6fb858649532e7c53a7de82cfc9145690f4f27","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":"c500cdfcf5b41bb5816c9984bf8b97ac2cec98a537dcb3178bfbf6e2219d4392","src/lib.rs":"d4b867af1cbe15b040aa56a4256458cfceebff9f11dd5aaf4c3dc15ccc251515"},"package":"7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"}
\ No newline at end of file diff --git a/vendor/bumpalo/CHANGELOG.md b/vendor/bumpalo/CHANGELOG.md index 969d69c29..c9469f633 100644 --- a/vendor/bumpalo/CHANGELOG.md +++ b/vendor/bumpalo/CHANGELOG.md @@ -28,6 +28,18 @@ Released YYYY-MM-DD. -------------------------------------------------------------------------------- +## 3.14.0 + +Released 2023-09-14. + +### Added + +* Added the `std` cargo feature, which enables implementations of `std` traits + for various things. Right now that is just `std::io::Write` for + `bumpalo::collections::Vec`, but could be more in the future. + +-------------------------------------------------------------------------------- + ## 3.13.0 Released 2023-05-22. @@ -530,7 +542,7 @@ Released 2019-12-20. from the allocated chunks are slightly different from the old `each_allocated_chunk`: only up to 16-byte alignment is supported now. If you allocate anything with greater alignment than that into the bump arena, there - might be uninitilized padding inserted in the chunks, and therefore it is no + might be uninitialized padding inserted in the chunks, and therefore it is no longer safe to read them via `MaybeUninit::assume_init`. See also the note about bump direction in the "changed" section; if you're iterating chunks, you're likely affected by that change! @@ -569,7 +581,7 @@ Released 2019-05-20. * Fixed a bug where chunks were always deallocated with the default chunk layout, not the layout that the chunk was actually allocated with (i.e. if we - started growing largers chunks with larger layouts, we would deallocate those + started growing larger chunks with larger layouts, we would deallocate those chunks with an incorrect layout). -------------------------------------------------------------------------------- diff --git a/vendor/bumpalo/Cargo.toml b/vendor/bumpalo/Cargo.toml index 4e6937978..2fa3c9339 100644 --- a/vendor/bumpalo/Cargo.toml +++ b/vendor/bumpalo/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.60.0" name = "bumpalo" -version = "3.13.0" +version = "3.14.0" authors = ["Nick Fitzgerald <fitzgen@gmail.com>"] exclude = [ "/.github/*", @@ -30,7 +30,7 @@ categories = [ "rust-patterns", "no-std", ] -license = "MIT/Apache-2.0" +license = "MIT OR Apache-2.0" repository = "https://github.com/fitzgen/bumpalo" [package.metadata.docs.rs] @@ -70,3 +70,4 @@ allocator_api = [] boxed = [] collections = [] default = [] +std = [] diff --git a/vendor/bumpalo/README.md b/vendor/bumpalo/README.md index 6a83b8c39..a21304152 100644 --- a/vendor/bumpalo/README.md +++ b/vendor/bumpalo/README.md @@ -155,7 +155,14 @@ in its space itself. ### `#![no_std]` Support -Bumpalo is a `no_std` crate. It depends only on the `alloc` and `core` crates. +Bumpalo is a `no_std` crate by default. It depends only on the `alloc` and `core` crates. + +### `std` Support + +You can optionally decide to enable the `std` feature in order to enable some +std only trait implementations for some collections: + +* `std::io::Write` for `Vec<'bump, u8>` ### Thread support @@ -179,7 +186,7 @@ First, enable the `allocator_api` feature in your `Cargo.toml`: ```toml [dependencies] -bumpalo = { version = "3.9", features = ["allocator_api"] } +bumpalo = { version = "3", features = ["allocator_api"] } ``` Next, enable the `allocator_api` nightly Rust feature in your `src/lib.rs` or diff --git a/vendor/bumpalo/src/collections/vec.rs b/vendor/bumpalo/src/collections/vec.rs index 312aa055b..66c821b10 100644 --- a/vendor/bumpalo/src/collections/vec.rs +++ b/vendor/bumpalo/src/collections/vec.rs @@ -104,6 +104,8 @@ use core::ops::{Index, IndexMut, RangeBounds}; use core::ptr; use core::ptr::NonNull; use core::slice; +#[cfg(feature = "std")] +use std::io; unsafe fn arith_offset<T>(p: *const T, offset: isize) -> *const T { p.offset(offset) @@ -2612,3 +2614,23 @@ where } } } + +#[cfg(feature = "std")] +impl<'bump> io::Write for Vec<'bump, u8> { + #[inline] + fn write(&mut self, buf: &[u8]) -> io::Result<usize> { + self.extend_from_slice(buf); + Ok(buf.len()) + } + + #[inline] + fn write_all(&mut self, buf: &[u8]) -> io::Result<()> { + self.extend_from_slice(buf); + Ok(()) + } + + #[inline] + fn flush(&mut self) -> io::Result<()> { + Ok(()) + } +} diff --git a/vendor/bumpalo/src/lib.rs b/vendor/bumpalo/src/lib.rs index c25e03ca3..a173321e8 100755 --- a/vendor/bumpalo/src/lib.rs +++ b/vendor/bumpalo/src/lib.rs @@ -1,7 +1,7 @@ #![doc = include_str!("../README.md")] #![deny(missing_debug_implementations)] #![deny(missing_docs)] -#![no_std] +#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(feature = "allocator_api", feature(allocator_api))] #[doc(hidden)] @@ -1430,7 +1430,7 @@ impl Bump { let aligned_ptr = ptr.wrapping_sub(rem); if aligned_ptr >= start { - let aligned_ptr = NonNull::new_unchecked(aligned_ptr as *mut u8); + let aligned_ptr = NonNull::new_unchecked(aligned_ptr); footer.ptr.set(aligned_ptr); Some(aligned_ptr) } else { @@ -1455,7 +1455,7 @@ impl Bump { let current_footer = self.current_chunk_footer.get(); let current_footer = unsafe { current_footer.as_ref() }; - current_footer as *const _ as usize - current_footer.data.as_ptr() as usize + current_footer.ptr.get().as_ptr() as usize - current_footer.data.as_ptr() as usize } /// Slow path allocation for when we need to allocate a new chunk from the @@ -1529,7 +1529,7 @@ impl Bump { ptr, new_footer ); - let ptr = NonNull::new_unchecked(ptr as *mut u8); + let ptr = NonNull::new_unchecked(ptr); new_footer.ptr.set(ptr); // Return a pointer to the freshly allocated region in this chunk. |