Skip to content

rust: alloc: vec: Add some missing fallible try_* methods

Asahi Lina asahi lkml rust-for-linux 1 version Applied

Status from this message: Applied to `rust-next`. Thanks!

Get series with b4
b4 am [email protected] change-id 20230224-rust-vec-df72fa4b806c

Versions newest first

  1. v1 Latest4 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/4rust: Import upstream `alloc::vec::set_len_on_drop` modulerust/alloc/vec/set_len_on_drop.rs+28 -00 replies
2/4rust: Import upstream `alloc::vec::spec_extend` modulerust/alloc/vec/spec_extend.rs+87 -00 replies
3/4rust: Add SPDX headers to alloc::vec::{spec_extend, set_len_on_drop}rust/alloc/vec/set_len_on_drop.rs rust/alloc/vec/spec_extend.rs+4 -00 replies
4/4rust: alloc: vec: Add some try_* methods we needrust/alloc/vec/mod.rs rust/alloc/vec/spec_extend.rs+217 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] rust: alloc: vec: Add some missing fallible try_* methods

Hi everyone!

This short series is part of the set of dependencies for the drm/asahi Apple M1/M2 GPU driver.

This series imports part of a commit from Miguel in rust-for-linux/linux, which adds missing fallible mutation/allocation methods to Vec. These are generally useful to make standard features available to the kernel environment, which does not have infallible allocation.

The additions in turn depend on importing two submodules from the Rust stdlib, which I have attributed using the same commit message template used for the original import of this part of the codebase. These versions come from Rust 1.66, but also build on Rust 1.62 (the current version upstream). I added the SPDX identifiers in a separate commit to clearly separate the original code from subsequent changes.

---
Asahi Lina (3):
rust: Import upstream alloc::vec::set_len_on_drop module
rust: Import upstream alloc::vec::spec_extend module
rust: Add SPDX headers to alloc::vec::{spec_extend, set_len_on_drop}

Miguel Ojeda (1):
rust: alloc: vec: Add some try_* methods we need

 rust/alloc/vec/mod.rs             | 137 +++++++++++++++++++++++++++++-
 rust/alloc/vec/set_len_on_drop.rs |  30 +++++++
 rust/alloc/vec/spec_extend.rs     | 172 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 336 insertions(+), 3 deletions(-)

---
base-commit: 83f978b63fa7ad474ca22d7e2772c5988101c9bd
change-id: 20230224-rust-vec-df72fa4b806c

Thank you,
~~ Lina