From ba7848fc8b6d0796b4ec9436daf59427699fc7e3 Mon Sep 17 00:00:00 2001 From: Matthew Leach Date: Thu, 11 Dec 2025 22:29:49 +0000 Subject: [PATCH] libkernel: CpuOps: add `'static` trait bound The CpuOps trait should never hold a reference to any other object. In fact, it should be a singleton object which is constructed at kernel boot and live for the entire lifetime of the system. Therefore, it's safe to add the `'static` trait bound. --- libkernel/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libkernel/src/lib.rs b/libkernel/src/lib.rs index c1115ae..73f1f00 100644 --- a/libkernel/src/lib.rs +++ b/libkernel/src/lib.rs @@ -21,7 +21,7 @@ pub mod sync; extern crate alloc; -pub trait CpuOps { +pub trait CpuOps: 'static { /// Returns the ID of the currently executing core. fn id() -> usize;