linux/rust/kernel/alloc
Miguel Ojeda 161dd7b51e rust: alloc: simplify with `NonNull::add()` now that it is stable
Currently, we need to go through raw pointers and then re-create the
`NonNull` from the result of offsetting the raw pointer.

`feature(non_null_convenience)` [1] has been stabilized in Rust
1.80.0 [2], which is older than our new minimum Rust version
(Rust 1.85.0).

Thus, now that we bump the Rust minimum version, simplify using
`NonNull::add()` and clean the TODO note.

Link: https://github.com/rust-lang/rust/issues/117691 [1]
Link: https://github.com/rust-lang/rust/pull/124498 [2]
Reviewed-by: Tamir Duberstein <tamird@kernel.org>
Reviewed-by: Gary Guo <gary@garyguo.net>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patch.msgid.link/20260405235309.418950-15-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2026-04-07 10:00:24 +02:00
..
allocator rust: alloc: simplify with `NonNull::add()` now that it is stable 2026-04-07 10:00:24 +02:00
kvec rust: kernel: mark as `#[inline]` all `From::from()`s for `Error` 2026-03-27 12:49:00 +01:00
allocator.rs Summary of significant series in this pull request: 2025-10-02 18:18:33 -07:00
kbox.rs rust: remove `RUSTC_HAS_COERCE_POINTEE` and simplify code 2026-04-07 10:00:23 +02:00
kvec.rs rust: alloc: employ a trailing comment to keep vertical layout 2025-10-17 00:56:20 +02:00
layout.rs drm next for 6.18-rc1 2025-10-02 12:47:25 -07:00