]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
rust: init: remove doctest's `Error::from_errno` workaround
authorMiguel Ojeda <ojeda@kernel.org>
Mon, 26 May 2025 15:29:14 +0000 (17:29 +0200)
committerBenno Lossin <lossin@kernel.org>
Wed, 11 Jun 2025 19:13:57 +0000 (21:13 +0200)
Since commit 5ed147473458 ("rust: error: make conversion functions
public"), `Error::from_errno` is public.

Thus remove the workaround added in commit a30e94c29673 ("rust: init:
make doctests compilable/testable").

Suggested-by: Benno Lossin <lossin@kernel.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://lore.kernel.org/all/20250526152914.2453949-2-ojeda@kernel.org
Signed-off-by: Benno Lossin <lossin@kernel.org>
rust/kernel/init.rs

index 49b9497208864eea982a8cebc13dd68e77135ce8..49a61fa3dee811d92e5a19c6cd48544b74cf97f0 100644 (file)
 //! #     pub unsafe fn destroy_foo(_ptr: *mut foo) {}
 //! #     pub unsafe fn enable_foo(_ptr: *mut foo, _flags: u32) -> i32 { 0 }
 //! # }
-//! # // `Error::from_errno` is `pub(crate)` in the `kernel` crate, thus provide a workaround.
-//! # trait FromErrno {
-//! #     fn from_errno(errno: core::ffi::c_int) -> Error {
-//! #         // Dummy error that can be constructed outside the `kernel` crate.
-//! #         Error::from(core::fmt::Error)
-//! #     }
-//! # }
-//! # impl FromErrno for Error {}
 //! /// # Invariants
 //! ///
 //! /// `foo` is always initialized