linux-stable/rust/kernel
Danilo Krummrich 2aac4cd7da rust: alloc: implement kernel Vec type
`Vec` provides a contiguous growable array type with contents allocated
with the kernel's allocators (e.g. `Kmalloc`, `Vmalloc` or `KVmalloc`).

In contrast to Rust's stdlib `Vec` type, the kernel `Vec` type considers
the kernel's GFP flags for all appropriate functions, always reports
allocation failures through `Result<_, AllocError>` and remains
independent from unstable features.

[ This patch starts using a new unstable feature, `inline_const`, but
  it was stabilized in Rust 1.79.0, i.e. the next version after the
  minimum one, thus it will not be an issue. - Miguel ]

Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20241004154149.93856-17-dakr@kernel.org
[ Cleaned `rustdoc` unescaped backtick warning, added a couple more
  backticks elsewhere, fixed typos, sorted `feature`s, rewrapped
  documentation lines. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-10-15 23:10:32 +02:00
..
alloc rust: alloc: implement kernel Vec type 2024-10-15 23:10:32 +02:00
block rust: block: fix wrong usage of lockdep API 2024-08-21 13:28:13 +02:00
init rust: treewide: switch to our kernel Box type 2024-10-15 22:56:59 +02:00
list rust: enable arbitrary_self_types and remove Receiver 2024-10-07 21:39:57 +02:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-09-05 20:37:20 -07:00
sync rust: treewide: switch to our kernel Box type 2024-10-15 22:56:59 +02:00
alloc.rs rust: alloc: implement kernel Vec type 2024-10-15 23:10:32 +02:00
block.rs rust: block: introduce kernel::block::mq module 2024-06-14 07:45:04 -06:00
build_assert.rs rust: upgrade to Rust 1.68.2 2023-05-31 17:35:03 +02:00
device.rs device: rust: improve safety comments 2024-06-20 16:14:58 +02:00
error.rs rust: error: optimize error type to use nonzero 2024-10-10 00:33:42 +02:00
firmware.rs rust: firmware: fix invalid rustdoc link 2024-07-31 13:24:29 +02:00
init.rs rust: alloc: remove extension of std's Box 2024-10-15 22:56:59 +02:00
ioctl.rs rust: start using the #[expect(...)] attribute 2024-10-07 21:39:57 +02:00
kunit.rs rust: kunit: use C-string literals to clean warning 2024-10-01 23:46:42 +02:00
lib.rs rust: alloc: implement kernel Vec type 2024-10-15 23:10:32 +02:00
list.rs rust: enable clippy::undocumented_unsafe_blocks lint 2024-10-07 21:39:05 +02:00
net.rs rust: core abstractions for network PHY drivers 2023-12-15 09:35:50 +00:00
page.rs rust: add abstraction for struct page 2024-07-08 23:44:01 +02:00
prelude.rs rust: alloc: implement kernel Vec type 2024-10-15 23:10:32 +02:00
print.rs rust: start using the #[expect(...)] attribute 2024-10-07 21:39:57 +02:00
rbtree.rs rust: treewide: switch to our kernel Box type 2024-10-15 22:56:59 +02:00
sizes.rs rust: sizes: add commonly used constants 2024-08-30 10:27:34 +01:00
static_assert.rs rust: static_assert: add static_assert! macro 2022-12-04 01:59:16 +01:00
std_vendor.rs rust: std_vendor: update dbg macro from Rust upstream 2024-10-10 00:33:42 +02:00
str.rs rust: enable clippy::undocumented_unsafe_blocks lint 2024-10-07 21:39:05 +02:00
sync.rs rust: sync: implement Default for LockClassKey 2024-05-05 19:22:25 +02:00
task.rs rust: kernel: remove redundant imports 2024-05-05 19:22:25 +02:00
time.rs rust: time: doc: Add missing C header links 2024-05-01 00:04:47 +02:00
transmute.rs rust: kernel: move FromBytes and AsBytes traits to a new transmute module 2024-10-10 00:33:42 +02:00
types.rs rust: alloc: remove extension of std's Box 2024-10-15 22:56:59 +02:00
uaccess.rs rust: kernel: move FromBytes and AsBytes traits to a new transmute module 2024-10-10 00:33:42 +02:00
workqueue.rs rust: treewide: switch to our kernel Box type 2024-10-15 22:56:59 +02:00