rust: add `alloc` crate
authorMiguel Ojeda <ojeda@kernel.org>
Sat, 3 Jul 2021 15:02:21 +0000 (17:02 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Fri, 11 Feb 2022 03:37:10 +0000 (04:37 +0100)
commit117a085fa0a8e6b2388029dab2883462b55e9903
treed0b2e2e7ae6a43d7249f116ae9deae4ea04eb563
parent47d11e4c476c7e8911c25f9dd3645f2bc0e54386
rust: add `alloc` crate

This crate is a subset of the Rust standard library `alloc`, with some
additions on top.

This is needed because upstream support for fallible allocations
is a work in progress (i.e. the `try_*` versions of methods which
return a `Result` instead of panicking).

Having the library in-tree also gives us a bit more freedom to
experiment with new interfaces and allows us to iterate quickly.

Eventually, the goal is to have everything the kernel needs in
upstream `alloc` and drop it from the kernel tree.

Co-developed-by: Alex Gaynor <alex.gaynor@gmail.com>
Signed-off-by: Alex Gaynor <alex.gaynor@gmail.com>
Co-developed-by: Wedson Almeida Filho <wedsonaf@google.com>
Signed-off-by: Wedson Almeida Filho <wedsonaf@google.com>
Co-developed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Gary Guo <gary@garyguo.net>
Co-developed-by: Matthew Bakhtiari <dev@mtbk.me>
Signed-off-by: Matthew Bakhtiari <dev@mtbk.me>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
20 files changed:
rust/alloc/README.md [new file with mode: 0644]
rust/alloc/alloc.rs [new file with mode: 0644]
rust/alloc/borrow.rs [new file with mode: 0644]
rust/alloc/boxed.rs [new file with mode: 0644]
rust/alloc/collections/mod.rs [new file with mode: 0644]
rust/alloc/fmt.rs [new file with mode: 0644]
rust/alloc/lib.rs [new file with mode: 0644]
rust/alloc/macros.rs [new file with mode: 0644]
rust/alloc/raw_vec.rs [new file with mode: 0644]
rust/alloc/slice.rs [new file with mode: 0644]
rust/alloc/str.rs [new file with mode: 0644]
rust/alloc/string.rs [new file with mode: 0644]
rust/alloc/vec/drain.rs [new file with mode: 0644]
rust/alloc/vec/drain_filter.rs [new file with mode: 0644]
rust/alloc/vec/into_iter.rs [new file with mode: 0644]
rust/alloc/vec/is_zero.rs [new file with mode: 0644]
rust/alloc/vec/mod.rs [new file with mode: 0644]
rust/alloc/vec/partial_eq.rs [new file with mode: 0644]
rust/alloc/vec/set_len_on_drop.rs [new file with mode: 0644]
rust/alloc/vec/spec_extend.rs [new file with mode: 0644]