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>
Mon, 17 Jan 2022 02:20:27 +0000 (03:20 +0100)
commit40458fc0ff2155ae158115ed57b8ecd5514d92ca
tree691d3b80968bca2b8c537f046df70b391c4fe59f
parentf28e962764419f21e82bdb7bdf8329e47ce4bfeb
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]