Skip to contentSkip to conversation

rust: init: remove old workaround

PATCH Superseded Tamir Duberstein 3 participants 3 messages Jul 9, 2025 – Jul 13, 2025

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rust: init: remove old workaround

Error::from_errno is pub since commit 5ed147473458 ("rust: error:
make conversion functions public"), thus remove this workaround which is no longer needed.

---
 rust/kernel/init.rs | 7 -------
 1 file changed, 7 deletions(-)
rust/kernel/init.rs +0 -7
index 8d228c237954..be3a25932342 100644
@@ -77,13 +77,6 @@
 //! #     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
 //! ///

---
base-commit: 2009a2d5696944d85c34d75e691a6f3884e787c0
change-id: 20250709-init-remove-old-workaround-a6ec6792e010

Best regards,

Signature · 1 line
Tamir Duberstein <[email protected]>
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Tamir Duberstein

Error::from_errno is pub since commit 5ed147473458 ("rust: error:
make conversion functions public"), thus remove this workaround which is no longer needed.

Huh. We should just have made it pub right away when we felt the need to add this workaround.