summaryrefslogtreecommitdiffstats
path: root/rust/kernel/list
diff options
context:
space:
mode:
authorMiguel Ojeda <ojeda@kernel.org>2026-04-06 01:52:46 +0200
committerMiguel Ojeda <ojeda@kernel.org>2026-04-07 10:00:23 +0200
commit4ab22c543f18cfbcc2f8ae691dc5ec5cc0ac35fb (patch)
treeb5315eee0e5d628d28ec7abb18850ea9bd4e77f2 /rust/kernel/list
parent9b398d0565438e9929afbfbb8a1cd1f3242067ac (diff)
downloadlinux-4ab22c543f18cfbcc2f8ae691dc5ec5cc0ac35fb.tar.gz
linux-4ab22c543f18cfbcc2f8ae691dc5ec5cc0ac35fb.zip
rust: remove `RUSTC_HAS_COERCE_POINTEE` and simplify code
With the Rust version bump in place, the `RUSTC_HAS_COERCE_POINTEE` Kconfig (automatic) option is always true. Thus remove the option and simplify the code. In particular, this includes removing our use of the predecessor unstable features we used with Rust < 1.84.0 (`coerce_unsized`, `dispatch_from_dyn` and `unsize`). Reviewed-by: Tamir Duberstein <tamird@kernel.org> Acked-by: Danilo Krummrich <dakr@kernel.org> Reviewed-by: Gary Guo <gary@garyguo.net> Link: https://patch.msgid.link/20260405235309.418950-11-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/list')
-rw-r--r--rust/kernel/list/arc.rs22
1 files changed, 1 insertions, 21 deletions
diff --git a/rust/kernel/list/arc.rs b/rust/kernel/list/arc.rs
index e1082423909c..a9a2b0178f65 100644
--- a/rust/kernel/list/arc.rs
+++ b/rust/kernel/list/arc.rs
@@ -160,7 +160,7 @@ pub use impl_list_arc_safe;
///
/// [`List`]: crate::list::List
#[repr(transparent)]
-#[cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, derive(core::marker::CoercePointee))]
+#[derive(core::marker::CoercePointee)]
pub struct ListArc<T, const ID: u64 = 0>
where
T: ListArcSafe<ID> + ?Sized,
@@ -443,26 +443,6 @@ where
}
}
-// This is to allow coercion from `ListArc<T>` to `ListArc<U>` if `T` can be converted to the
-// dynamically-sized type (DST) `U`.
-#[cfg(not(CONFIG_RUSTC_HAS_COERCE_POINTEE))]
-impl<T, U, const ID: u64> core::ops::CoerceUnsized<ListArc<U, ID>> for ListArc<T, ID>
-where
- T: ListArcSafe<ID> + core::marker::Unsize<U> + ?Sized,
- U: ListArcSafe<ID> + ?Sized,
-{
-}
-
-// This is to allow `ListArc<U>` to be dispatched on when `ListArc<T>` can be coerced into
-// `ListArc<U>`.
-#[cfg(not(CONFIG_RUSTC_HAS_COERCE_POINTEE))]
-impl<T, U, const ID: u64> core::ops::DispatchFromDyn<ListArc<U, ID>> for ListArc<T, ID>
-where
- T: ListArcSafe<ID> + core::marker::Unsize<U> + ?Sized,
- U: ListArcSafe<ID> + ?Sized,
-{
-}
-
/// A utility for tracking whether a [`ListArc`] exists using an atomic.
///
/// # Invariants