diff --git a/src/ariel-os-threads/src/lib.rs b/src/ariel-os-threads/src/lib.rs index ef25b629d..f50e9fedc 100644 --- a/src/ariel-os-threads/src/lib.rs +++ b/src/ariel-os-threads/src/lib.rs @@ -522,24 +522,33 @@ pub unsafe fn start_threading() { Cpu::start_threading(); } +trait Sealed {} + /// Trait for types that fit into a single register. -pub trait Arguable { +#[expect(private_bounds, reason = "sealed trait")] +pub trait Arguable: Sealed { #[doc(hidden)] fn into_arg(self) -> usize; } +impl Sealed for usize {} + impl Arguable for usize { fn into_arg(self) -> usize { self } } +impl Sealed for () {} + impl Arguable for () { fn into_arg(self) -> usize { 0 } } +impl Sealed for &'static T {} + /// [`Arguable`] is only implemented on *static* references because the references passed to a /// thread must be valid for its entire lifetime. impl Arguable for &'static T {